[R] Help: lme

Pryseley Assam assampryseley at yahoo.com
Thu Jun 1 12:25:22 CEST 2006


Good day R-Users,
   
  I have a problem accessing some values in the output from the summary of an lme fit.
   
  
The structure of my data is as shown below (I have attached a copy of the full data).
  
 
  id trials endp Z.sas       ST
  1      1   -1         -1        42.42884
  1      1    1         -1         48.12007
  2      1   -1         -1        43.42878
  2      1    1         -1         46.82817
  3      1   -1         -1        45.56736
  













.
  598  10  -1        1          49.59715
  598  10   1        1          55.46324
  599  10   -1       1          46.80873
  599  10    1       1          53.52223
  600  10   -1       1          48.58257
  600  10    1       1          56.78674
  
 I used the following code to fit my model of interest:
   
  ggg <- lme (ST~ -1 + as.factor(endp):Z.sas + as.factor(endp), data=dat4a,
  random=~-1 + as.factor(endp) + as.factor(endp):Z.sas|as.factor(trials),
  correlation = corSymm(form=~1|as.factor(trials)/as.factor(id)), weights=varIdent(form=~1|endp))
   
  hh <- summary(ggg)
  hh
   
  Below is the following part of the output of interest I wish to access:
   
  Correlation Structure: General
 Formula: ~1 | as.factor(trials)/as.factor(id) 
 Parameter estimate(s):
 Correlation: 
  1    
2 0.785
Variance function:
 Structure: Different standard deviations per stratum
 Formula: ~1 | endp 
 Parameter estimates:
       -1         1 
1.0000000 0.9692405 
   
  I wish to access the value of the correlation (0.785) and the vector of the variance function estimates (1, 0.969). I know these can be done through the intervals function, but sometimes when the estimated Hessian matrix is not positive definite or something like that (i am not quite sure), the intervals function delivers an error message. 
   
  Thus, i will like to ask if there is another way to access these values. I tried using the following code:
   
  hh$modelStruct$corStruct[1]
  hh$modelStruct$varStruct[1]
   
  Rather the output was:
   
  > hh$modelStruct$corStruct[1]
[1] -1.308580
> hh$modelStruct$varStruct[1]
[1] -0.03124255
   
  I presume there is a way to calculate the correlation and variance function coefficients using these values. 
   
  Could you tell me how to access those values (without using the intervals function) or better still how to calculate the values from the last output values. 
   
  Kind regards
  Pryseley
   
   

__________________________________________________


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dat4a.txt
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060601/49b07c35/attachment.txt 


More information about the R-help mailing list