Re: var-covar matrices comparison

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: var-covar matrices comparison

David Duffy-2
> Date: Mon, 20 Feb 2006 16:43:55 -0600
> From: Aldi Kraja <[hidden email]>
>
> Hi,
> Using package gclus in R, I have created some graphs that show the
> trends within subgroups of data and correlations among 9 variables (v1-v9).
> Being interested for more details on these data I have produced also the
> var-covar matrices.
> Question: From a pair of two subsets of data (with 9 variables each, I
> have two var-covar matrices for each subgroup, that differ for a
> treatment on one group (treatment A) vs (non-Treatment A).
>
> Is there a software that can compare if two var-covar matrices are
> statistically the same?
>

This can be done in various structural equation modelling packages.  I don't
think it can be done automatically using the sem package, as that does not allow
multiple groups.  You can roll your own LR test (assuming MVN):

  f <- (N-1) * (log(det(E)) - log(det(O)) + sum(diag((O %*% solve(E))))-p)

  N=size of group
  p=number of variables
  E=expected covariance matrix
  O=observed covariance matrix

  where in your example, E will be the observed covariance matrix for
  the pooled groups.  There are GLS etc alternatives - see eg Bollen's book on
  SEM.

| David Duffy (MBBS PhD)                                         ,-_|\
| email: [hidden email]  ph: INT+61+7+3362-0217 fax: -0101  /     *
| Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: var-covar matrices comparison

Peter Dalgaard
David Duffy <[hidden email]> writes:

> > Date: Mon, 20 Feb 2006 16:43:55 -0600
> > From: Aldi Kraja <[hidden email]>
> >
> > Hi,
> > Using package gclus in R, I have created some graphs that show the
> > trends within subgroups of data and correlations among 9 variables (v1-v9).
> > Being interested for more details on these data I have produced also the
> > var-covar matrices.
> > Question: From a pair of two subsets of data (with 9 variables each, I
> > have two var-covar matrices for each subgroup, that differ for a
> > treatment on one group (treatment A) vs (non-Treatment A).
> >
> > Is there a software that can compare if two var-covar matrices are
> > statistically the same?
> >
>
> This can be done in various structural equation modelling packages.  I don't
> think it can be done automatically using the sem package, as that does not allow
> multiple groups.  You can roll your own LR test (assuming MVN):
>
>   f <- (N-1) * (log(det(E)) - log(det(O)) + sum(diag((O %*% solve(E))))-p)
>
>   N=size of group
>   p=number of variables
>   E=expected covariance matrix
>   O=observed covariance matrix

..and an asymptotic approximation to order n^-3 is found in TW
Anderson: An Introduction to Multivariate Statistical Analysis
(formula (7) section 10.5 in my 1958, 1st ed. reprint).

 

>   where in your example, E will be the observed covariance matrix for
>   the pooled groups.  There are GLS etc alternatives - see eg Bollen's book on
>   SEM.
>
> | David Duffy (MBBS PhD)                                         ,-_|\
> | email: [hidden email]  ph: INT+61+7+3362-0217 fax: -0101  /     *
> | Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
> | 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

--
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])                  FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html