Displaying 3 results from an estimated 3 matches for "mycov".
Did you mean:
myco
2000 Jun 19
1
outer problem
why does teh following code not work?
a<-rnorm(50)
dim(a)<-c(10,5)
mycov<-function(mat,i,j){
sum((mat[,i]-mean(mat[,i]))*(mat[,j]-mean(mat[,j])))
}
covmat<-function(X){
outer(1:dim(X)[2],1:dim(X)[2],function(v1,v2){mycov(X,v1,v2)})}
from what i know
covmat(a) should give the covariance matrix of a, but it gives a matr...
2011 Mar 17
2
Incorrect degrees of freedom in SEM model using lavaan
...del then it should have. I have 7 variables, which should give (7)(8)/2 =
28 covariances, and hence 28 DF. The model seems to only think I have 13
DF. The code to reproduce the problem is below. Have I done something
wrong, or is this something I should take to the developer?
library(lavaan)
myCov = matrix(c(24.40, 0, 0, 0, 0, 0, 0, .03, .03, 0, 0, 0, 0, 0, 6.75, -
.08, 519.38, 0, 0, 0, 0, .36, .01, 2.74, .18, 0, 0, 0, .51, .0, -.31, .02,
.2, .0, 0, -.17, .0, -1.6, -.04, .01, .25, 0, -.1, .02, -.03, .0, -.01, .01
, .02), nrow=7, byrow=TRUE, dimnames=list(c("Internet", "Stress3...
2003 Dec 05
0
simple sphericity test using bartlett and cov?
Hey,
Is this right for a sphericity test?
x <- mymatrix
mycov <- cov(x)
bartlett.text (array (mycov), myconditions)