ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
#Loehlin problem from table 2-12
#Note that version a is a classic example of congeneric measurement.
#Alternatively, this could be thought of as underidentified higher order model
obs.var2.12 = c('a', 'b', 'c', 'd')
R.prob2.12 = matrix(c(
1.00 , .30, .20, .10,
.30, 1.00, .20, .20,
.20, .20, 1.00, .30,
.10, .20, .30, 1.00),
ncol=4,byrow=TRUE)
model2.12a=matrix(c(
'g -> a', 'a1', NA,
'g -> b' , 'b1', NA,
'g -> c' , 'c1', NA,
'g -> d', 'd1', NA,
'a <-> a', 'e1', NA,
'b <-> b', 'e2', NA,
'c <-> c', 'e3', NA,
'd <-> d', 'e4', NA,
'g <-> g', NA, 1),
ncol=3, byrow=TRUE)
sem2.12a= sem(model2.12a,R.prob2.12,120, obs.var2.12)
summary(sem2.12a,digits=3)
#a 1 degree of freedom model
model2.12b=matrix(c(
'g -> a', 'a1', NA,
'g -> b' , 'b1', NA,
'f -> c' , 'c1', NA,
'f -> d', 'd1', NA,
'a <-> a', 'e1', NA,
'b <-> b', 'e2', NA,
'c <-> c', 'e3', NA,
'd <-> d', 'e4', NA,
'g <-> g', NA, 1,
'f <-> f', NA, 1,
'g <-> f', 'fg', NA),
ncol=3, byrow=TRUE)
sem2.12b= sem(model2.12b,R.prob2.12,120, obs.var2.12)
summary(sem2.12b,digits=3)
#the following higher level model has 0 degrees of freedom
model2.12c=matrix(c(
'g -> a', 'a1', NA,
'g -> b' , 'b1', NA,
'f -> c' , 'c1', NA,
'f -> d', 'd1', NA,
'a <-> a', 'e1', NA,
'b <-> b', 'e2', NA,
'c <-> c', 'e3', NA,
'd <-> d', 'e4', NA,
'g <-> g', NA, 1,
'f <-> f', NA, 1,
'h -> g', 'hg', NA,
'h -> f', NA,1,
'h <-> h', NA,1),
ncol=3, byrow=TRUE)
sem2.12c= sem(model2.12c,R.prob2.12,120, obs.var2.12)
summary(sem2.12c,digits=3)
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
#Loehlin problem 2.9
obs.var2.09 = c('w', 'x', 'y', 'z')
R.prob2.09 = matrix(c(
1.00 , .40, .50, .30,
.40, 1.00, .55, .35,
.50, .55, 1.00, .40,
.30, .35, .40, 1.00),
ncol=4,byrow=TRUE)
model2.09=matrix(c(
'g -> w', 'a1', NA,
'g -> x' , 'b1', NA,
'g -> y' , 'c1', NA,
'g -> z', 'd1', NA,
'w <-> w', 'e1', NA,
'x <-> x', 'e2', NA,
'y <-> y', 'e3', NA,
'z <-> z', 'e4', NA,
'g <-> g', NA, 1),
ncol=3, byrow=TRUE)
sem2.09= sem(model2.09,R.prob2.09,500, obs.var2.09)
summary(sem2.09,digits=3)
obs.var2.09b = c('w', 'x', 'y', 'z')
R.prob2.09b = matrix(c(
1.00 , .40, .50, .30,
.40, 1.00, .55, .35,
.50, .55, 1.00, .40,
.30, .35, .40, 1.00),
ncol=4,byrow=TRUE)
model2.09b=matrix(c(
'g -> w', NA,1,
'g -> x' , 'b1', NA,
'g -> y' , 'c1', NA,
'g -> z', 'd1', NA,
'w <-> w', 'e1', NA,
'x <-> x', 'e2', NA,
'y <-> y', 'e3', NA,
'z <-> z', 'e4', NA,
'g <-> g', 'e',NA),
ncol=3, byrow=TRUE)
sem2.09b= sem(model2.09b,R.prob2.09b,500, obs.var2.09b)
summary(sem2.09b,digits=3)
|