Rev 3734 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
S> ### $Id: Bond.St,v 1.1 1999/10/13 00:50:09 saikat Exp $S> ## Set optionsS> options( prompt = "S> ", digits = 5, width = 65,+ contrasts = c(factor = "contr.SAS", ordered = "contr.poly") )S> plot(Bond) # dotplot by IngotS> plot(Bond, inner = ~ Metal) # different symbols for different MetalsS> formula(Bond) # check the formulapressure ~ 1 | IngotS> fm1Bond <- lme( pressure ~ Metal, data = Bond, random = ~ 1 | Ingot,+ method = "ML")S> summary( fm1Bond )Linear mixed-effects model fit by maximum likelihoodData: BondAIC BIC logLik125.71 130.93 -57.854Random effects:Formula: ~ 1 | Ingot(Intercept) ResidualStdDev: 3.1325 2.9816Fixed effects: pressure ~ MetalValue Std.Error DF t-value p-value(Intercept) 71.100 1.7655 12 40.271 <.0001Metalc -0.914 1.7214 12 -0.531 0.6050Metali 4.800 1.7214 12 2.788 0.0164Correlation:(Intr) MetalcMetalc -0.488Metali -0.488 0.500Standardized Within-Group Residuals:Min Q1 Med Q3 Max-1.4551 -0.81901 0.08048 0.52228 1.9611Number of Observations: 21Number of Groups: 7S> ## default criterion in lme is maximum likelihood (ML).S> ## Re-fit to get REML resultsS> fm1RBond <- update( fm1Bond, method = "REML" )S> summary( fm1RBond ) # compare with output 1.1 on p. 6Linear mixed-effects model fit by REMLData: BondAIC BIC logLik117.79 122.24 -53.895Random effects:Formula: ~ 1 | Ingot(Intercept) ResidualStdDev: 3.3835 3.2205Fixed effects: pressure ~ MetalValue Std.Error DF t-value p-value(Intercept) 71.100 1.7655 12 40.271 <.0001Metalc -0.914 1.7214 12 -0.531 0.6050Metali 4.800 1.7214 12 2.788 0.0164Correlation:(Intr) MetalcMetalc -0.488Metali -0.488 0.500Standardized Within-Group Residuals:Min Q1 Med Q3 Max-1.3471 -0.75825 0.07451 0.48354 1.8157Number of Observations: 21Number of Groups: 7S> logLik( fm1RBond ) # log-restricted-likelihood[1] -53.895S> c(3.3835,3.2205)^2 # variance estimates[1] 11.448 10.372S> ## To test the need for the Metal term in the fixed effects,S> ## re-fit and use anova. You must use ML to do this. RML results areS> ## not comparable if the fixed-effects specification changes.S> fm2Bond <- update( fm1Bond, pressure ~ 1 )S> anova( fm1Bond, fm2Bond )Model df AIC BIC logLik Test L.Ratio p-valuefm1Bond 1 5 125.71 130.93 -57.854fm2Bond 2 3 131.82 134.96 -62.912 1 vs 2 10.116 0.0064