Hi,
I have been learning how to structure the analyses and scripts for examining twin data and I am having some trouble with 'adding a covariate'. When I run the following code.(which I didn't write)...............
mxModel("Sibs",
mxMatrix( type="Lower", nrow=ntv, ncol=ntv, free=TRUE, values=1, name="Chol" ),
mxAlgebra( expression=Chol %*% t(Chol), name="expCov" ),
#regressing out covariate
mxMatrix( type="Full", nrow=1, ncol=ntv, free=TRUE, values=0, labels="intercept", name="grandMean" ),
# adding a beta x covariate to full mean
mxMatrix(type="Full", nrow=cov, ncol=nv, free=TRUE, labels="betaSes", name="regBetas"),
........it will not run past the last line, and I receive the following error message..........
dding a beta x covariate to full mean
> mxMatrix(type="Full", nrow=cov, ncol=nv, free=TRUE, labels="betaSes", name="regBetas")
Error in matrix(values, nrow, ncol, byrow = byrow) :
non-numeric matrix extent
In addition: Warning messages:
1: In is.na(nrow) :
is.na() applied to non-(list or vector) of type 'closure'
2: In is.na(nrow) :
is.na() applied to non-(list or vector) of type 'closure'
3: In is.na(nrow) :
is.na() applied to non-(list or vector) of type 'closure'
Help or suggestions to improve the 'functionality' of the code will be greatly appreciated.
Best wishes
jane