"Rogelio" <rogelio.a....@student.bi.no> wrote in message <gu4pni$k0p$1...@fred.mathworks.com>...
Hi,
I have tried to specify 'Options' usig the statset and didnt work the nlmefit function. I can specify 'CovPattern','Covparameterization', 'ApproximationType' and 'OptimFun' but not 'Options'. I have wirtten options = statset('MaxIter',350,'TolX',1e-8), for example, and I can see that the structure has changed to the new values and then I write in the nlmefit function 'options' and doesnt work (I have tried with and without ' ' ) what Im doing wrong?
How can I get the covariance matrix for the fixed effects? Under stats I just get the standard errors for beta but if I want the covariance matrix of the coefficients??
The example that I want to replicate is from the book Applied Longitudinal Analysis of Fitzmaurice, Laird and Ware. You are right about the sligthly different results, but for some parameters (inside the same model) I can see that the difference is relatively bigger.
Thank you for helping me!
to use statset do:
options = statset('nlmefit')
options = statset(options,'MaxIter',350,'TolX',1e-8)
and then
nlmefit(x,y,grp,[],f,Beta0,'CovPat',CovPattern,'Options',options)
when doing mixed effects it is very easy to overparametrize the covariance structure, so make sure that you start with 'CovPat' set to eye(number of random effects).
Also trying to reduce the number of random effects in your model ('FEParamsSelect'), perhaps start with only one.
I recommend start with approximation type set to 'LME' and once you have a relative good idea of the covariance structure try FOCE for a more accurate estimation.
I am not sure what is what you mean to the "Covariance Matrix for the Fixed effects", are you refering to PSI? the second output of the function?
Feel free to send me your current 'm' file to my e-mail, I can take a look.
Lucio
The covariance matrix that I mean is cov(B)={X'*COV*X)}^-1 (subscripts are missing). Where B is betahat (the estimated fixed effects), X must have a subscript i (where i indicates individuals) and is the design matrix and COV is the covarinace matrix of the response variable which is multinormal.
PSI is the covariance matrix for the random effects (b) but what about if I want the covariance matrix of the fixed effects (B). I dont know how to use R but in R you get the correlation matrix for the fixed effects.
Thank you again for your help
"Lucio Cetto" <lce...@nospam.mathworks.com> wrote in message <gubrj7$7r8$1...@fred.mathworks.com>...
"Rogelio" <rogelio.a....@student.bi.no> wrote in message <gubu3p$53o$1...@fred.mathworks.com>...