nlme/0000755000176200001440000000000013616760516011220 5ustar liggesusersnlme/NAMESPACE0000644000176200001440000003474213336503465012446 0ustar liggesusersuseDynLib(nlme, .registration=TRUE) importFrom("graphics", pairs, par, plot) importFrom("stats", # many S3 generics for which we define methods AIC, BIC, anova, as.formula, asOneSidedFormula, coef, coefficients, confint, contr.SAS, contr.helmert, contr.poly, contr.sum, contr.treatment, contrasts, "contrasts<-", delete.response, dist, fitted, extractAIC, formula, lm, logLik, mad, median, model.frame, model.matrix, na.fail, na.omit, napredict, naresid, nlm, nlminb, nls, nls.control, nobs, optim, pchisq, pf, predict, pt, qchisq, qf, qnorm, qqnorm, qt, quantile, resid, residuals, rnorm, runif, simulate, setNames, terms, update, update.formula, var, vcov) importFrom("utils", head, tail, capture.output, packageDescription) importFrom("lattice", Rows, bwplot, dotplot, llines, lpoints, lsegments, ltext, panel.abline, panel.bwplot, panel.dotplot, panel.grid, panel.histogram, panel.linejoin, panel.loess, panel.superpose, panel.xyplot, splom, strip.default, trellis.par.get, xyplot) if(getRversion() >= "3.3.0") { if(getRversion() >= "3.5.0") importFrom("utils", warnErrList) importFrom("stats", sigma) } else { export(sigma) } export(ACF, allCoef, asOneFormula, asTable, augPred, balancedGrouped, "coef<-", "coefficients<-", collapse, compareFits, comparePred, corAR1, corARMA, corCAR1, corCompSymm, corExp, corFactor, corGaus, corIdent, corLin, corMatrix, corNatural, corRatio, corSpatial, corSpher, corSymm, "covariate<-", Dim, fdHess, fixed.effects, fixef, gapply, getCovariate, getCovariateFormula, getData, getGroups, getGroupsFormula, getResponse, getResponseFormula, getVarCov, gls, glsControl, glsStruct, gnls, gnlsControl, gnlsStruct, groupedData, gsummary, Initialize, intervals, isBalanced, isInitialized, LDEsysMat, lme, lmeControl, lmeStruct, lmList, logDet, "matrix<-", Names, "Names<-", needUpdate, nfGroupedData, nmGroupedData, # << Deprecated --> TODO: Defunct nlme, nlmeControl, nlmeStruct, nlsList, pdBlocked, pdCompSymm, pdConstruct, pdDiag, pdFactor, pdIdent, pdLogChol, pdMat, pdMatrix, pdNatural, pdSymm, phenoModel, pooledSD, quinModel, random.effects, ranef, recalc, reStruct, simulate.lme, splitFormula, varComb, varConstPower, VarCorr, varExp, varFixed, varFunc, varIdent, Variogram, varPower, varWeights) # called directly via do.call export(anova.lme, nlsList.formula, plot.lme) # needed as name stored in the call via match.call export(lme.formula, lme.lmList, lmList.formula, nlme.formula, nlme.nlsList) # exported for package rms export(glsApVar, glsEstimate) S3method("[", groupedData) S3method("[", pdBlocked) S3method("[", pdMat) S3method("[", reStruct) S3method("[<-", pdMat) S3method(ACF, gls) S3method(ACF, lme) S3method(anova, gls) S3method(anova, lme) S3method(as.data.frame, groupedData) S3method(as.matrix, corStruct) S3method(as.matrix, pdMat) S3method(as.matrix, reStruct) S3method(asTable, groupedData) S3method(augPred, gls) S3method(augPred, lme) S3method(augPred, lmList) S3method(coef, corAR1) S3method(coef, corARMA) S3method(coef, corCAR1) S3method(coef, corCompSymm) S3method(coef, corIdent) S3method(coef, corLin) S3method(coef, corNatural) S3method(coef, corSpatial) S3method(coef, corSpher) S3method(coef, corStruct) S3method(coef, corSymm) S3method(coef, gls) S3method(coef, gnls) S3method(coef, lme) S3method(coef, lmList) S3method(coef, modelStruct) S3method(coef, pdBlocked) S3method(coef, pdCompSymm) S3method(coef, pdDiag) S3method(coef, pdIdent) S3method(coef, pdMat) S3method(coef, pdNatural) S3method(coef, pdSymm) S3method(coef, reStruct) S3method(coef, summary.lme, getCTable) S3method(coef, summary.gls, getCTable) S3method(coef, summary.nlsList) S3method(coef, varComb) S3method(coef, varConstPower) S3method(coef, varExp) S3method(coef, varFixed) S3method(coef, varFunc) S3method(coef, varIdent) S3method(coef, varPower) S3method("coef<-", corAR1) S3method("coef<-", corARMA) S3method("coef<-", corCAR1) S3method("coef<-", corCompSymm) S3method("coef<-", corIdent) S3method("coef<-", corNatural) S3method("coef<-", corSpatial) S3method("coef<-", corStruct) S3method("coef<-", corSymm) S3method("coef<-", modelStruct) S3method("coef<-", pdBlocked) S3method("coef<-", pdMat) S3method("coef<-", reStruct) S3method("coef<-", varComb) S3method("coef<-", varConstPower) S3method("coef<-", varExp) S3method("coef<-", varFixed) S3method("coef<-", varIdent) S3method("coef<-", varPower) S3method(collapse, groupedData) S3method(comparePred, gls) S3method(comparePred, lme) S3method(comparePred, lmList) S3method(confint, lme) S3method(confint, lmList) S3method(confint, nlsList) S3method(corFactor, compSymm) S3method(corFactor, corAR1) S3method(corFactor, corARMA) S3method(corFactor, corCAR1) S3method(corFactor, corNatural) S3method(corFactor, corSpatial) S3method(corFactor, corStruct) S3method(corFactor, corSymm) S3method(corMatrix, corAR1) S3method(corMatrix, corARMA) S3method(corMatrix, corCAR1) S3method(corMatrix, corCompSymm) S3method(corMatrix, corIdent) S3method(corMatrix, corNatural) S3method(corMatrix, corSpatial) S3method(corMatrix, corStruct) S3method(corMatrix, corSymm) S3method(corMatrix, pdBlocked) S3method(corMatrix, pdCompSymm) S3method(corMatrix, pdDiag) S3method(corMatrix, pdIdent) S3method(corMatrix, pdMat) S3method(corMatrix, reStruct) S3method("covariate<-", varFunc) S3method(deviance, gls) S3method(deviance, lme) S3method(Dim, corSpatial) S3method(Dim, corStruct) S3method(Dim, default) S3method(Dim, pdCompSymm) S3method(Dim, pdDiag) S3method(Dim, pdIdent) S3method(Dim, pdMat) S3method(Dim, pdNatural) S3method(Dim, pdSymm) S3method(extractAIC, gls) S3method(extractAIC, lme) S3method(fitted, gls) S3method(fitted, glsStruct) S3method(fitted, gnls) S3method(fitted, gnlsStruct) S3method(fitted, lme) S3method(fitted, lmeStruct) S3method(fitted, lmList) S3method(fitted, nlmeStruct) S3method(fixef, lme) S3method(fixef, lmList) S3method(formula, corStruct) S3method(formula, gls) S3method(formula, gnls) S3method(formula, groupedData) S3method(formula, lme) S3method(formula, lmList) S3method(formula, modelStruct) S3method(formula, nlme) S3method(formula, nlsList) S3method(formula, pdBlocked) S3method(formula, pdMat) S3method(formula, reStruct) S3method(formula, varComb) S3method(formula, varFunc) S3method(getCovariate, corSpatial) S3method(getCovariate, corStruct) S3method(getCovariate, data.frame) S3method(getCovariate, varFunc) S3method(getData, gls) S3method(getData, gnls) S3method(getData, lme) S3method(getData, lmList) S3method(getData, nlme) S3method(getData, nls) S3method(getGroups, corStruct) S3method(getGroups, data.frame) S3method(getGroups, gls) S3method(getGroups, lme) S3method(getGroups, lmList) S3method(getGroups, varFunc) S3method(getGroupsFormula, default) S3method(getGroupsFormula, gls) S3method(getGroupsFormula, lme) S3method(getGroupsFormula, lmList) S3method(getGroupsFormula, reStruct) S3method(getResponse, data.frame) S3method(getResponse, gls) S3method(getResponse, lme) S3method(getResponse, lmList) S3method(getVarCov, gls) S3method(getVarCov, lme) S3method(Initialize, corAR1) S3method(Initialize, corARMA) S3method(Initialize, corCAR1) S3method(Initialize, corCompSymm) S3method(Initialize, corIdent) S3method(Initialize, corLin) S3method(Initialize, corNatural) S3method(Initialize, corSpatial) S3method(Initialize, corSpher) S3method(Initialize, corStruct) S3method(Initialize, corSymm) S3method(Initialize, glsStruct) S3method(Initialize, gnlsStruct) S3method(Initialize, lmeStruct) S3method(Initialize, reStruct) S3method(Initialize, varComb) S3method(Initialize, varConstPower) S3method(Initialize, varExp) S3method(Initialize, varFixed) S3method(Initialize, varFunc) S3method(Initialize, varIdent) S3method(Initialize, varPower) S3method(intervals, gls) S3method(intervals, lme) S3method(intervals, lmList) S3method(isBalanced, groupedData) S3method(isInitialized, pdBlocked) S3method(isInitialized, pdMat) S3method(isInitialized, reStruct) S3method(lme, formula) S3method(lme, groupedData) S3method(lme, lmList) S3method(lmList, formula) S3method(lmList, groupedData) S3method(logDet, corIdent) S3method(logDet, corStruct) S3method(logDet, pdBlocked) S3method(logDet, pdCompSymm) S3method(logDet, pdDiag) S3method(logDet, pdIdent) S3method(logDet, pdMat) S3method(logDet, pdNatural) S3method(logDet, pdSymm) S3method(logDet, reStruct) S3method(logLik, corStruct) S3method(logLik, gls) S3method(logLik, glsStruct) S3method(logLik, gnls) S3method(logLik, gnlsStruct) S3method(logLik, lme) S3method(logLik, lmeStruct) S3method(logLik, lmeStructInt) S3method(logLik, lmList) S3method(logLik, reStruct) S3method(logLik, varComb) S3method(logLik, varFunc) S3method("matrix<-", pdBlocked) S3method("matrix<-", pdMat) S3method("matrix<-", reStruct) S3method(model.matrix, reStruct) S3method(Names, formula) S3method(Names, listForm) S3method(Names, pdBlocked) S3method(Names, pdMat) S3method(Names, reStruct) S3method("Names<-", pdBlocked) S3method("Names<-", pdMat) S3method("Names<-", reStruct) S3method(needUpdate, corStruct) S3method(needUpdate, default) S3method(needUpdate, modelStruct) S3method(needUpdate, reStruct) S3method(needUpdate, varComb) S3method(needUpdate, varIdent) S3method(nlme, formula) S3method(nlme, nlsList) S3method(nlsList, formula) S3method(nlsList, selfStart) S3method(nobs, gls) S3method(nobs, gnls) S3method(nobs, lme) S3method(pairs, compareFits) S3method(pairs, lme) S3method(pairs, lmList) S3method(pdConstruct, pdBlocked) S3method(pdConstruct, pdCompSymm) S3method(pdConstruct, pdDiag) S3method(pdConstruct, pdIdent) S3method(pdConstruct, pdLogChol) S3method(pdConstruct, pdMat) S3method(pdConstruct, pdNatural) S3method(pdConstruct, pdSymm) S3method(pdFactor, pdBlocked) S3method(pdFactor, pdCompSymm) S3method(pdFactor, pdDiag) S3method(pdFactor, pdIdent) S3method(pdFactor, pdLogChol) S3method(pdFactor, pdMat) S3method(pdFactor, pdNatural) S3method(pdFactor, pdSymm) S3method(pdFactor, reStruct) S3method(pdMatrix, pdBlocked) S3method(pdMatrix, pdCompSymm) S3method(pdMatrix, pdDiag) S3method(pdMatrix, pdIdent) S3method(pdMatrix, pdMat) S3method(pdMatrix, pdNatural) S3method(pdMatrix, pdSymm) S3method(pdMatrix, reStruct) S3method(plot, ACF) S3method(plot, augPred) S3method(plot, compareFits) S3method(plot, gls) S3method(plot, intervals.lmList) S3method(plot, lme) S3method(plot, lmList) S3method(plot, nffGroupedData) S3method(plot, nfnGroupedData) S3method(plot, nls) S3method(plot, nmGroupedData) S3method(plot, pdMat) S3method(plot, ranef.lme) S3method(plot, ranef.lmList) S3method(plot, simulate.lme) S3method(plot, Variogram) S3method(predict, gls) S3method(predict, gnls) S3method(predict, lme) S3method(predict, lmList) S3method(predict, nlme) S3method(print, anova.lme) S3method(print, compareFits) S3method(print, corNatural) S3method(print, correlation) S3method(print, corStruct) S3method(print, corSymm) S3method(print, gls) S3method(print, groupedData) S3method(print, intervals.gls) S3method(print, intervals.lme) S3method(print, intervals.lmList) S3method(print, lme) S3method(print, lmList) S3method(print, modelStruct) S3method(print, pdMat) S3method(print, ranef.lme) S3method(print, reStruct) S3method(print, simulate.lme) S3method(print, summary.corNatural) S3method(print, summary.corStruct) S3method(print, summary.corSymm) S3method(print, summary.gls) S3method(print, summary.lme) S3method(print, summary.lmList) S3method(print, summary.modelStruct) S3method(print, summary.pdMat) S3method(print, summary.varComb) S3method(print, summary.varFixed) S3method(print, summary.varFunc) S3method(print, varComb) S3method(print, VarCorr.lme) S3method(print, VarCov) S3method(print, varFunc) S3method(qqnorm, gls) S3method(qqnorm, lm) S3method(qqnorm, lme) S3method(qqnorm, lmList) S3method(qqnorm, nls) S3method(ranef, lme) S3method(ranef, lmList) S3method(recalc, corAR1) S3method(recalc, corARMA) S3method(recalc, corCAR1) S3method(recalc, corCompSymm) S3method(recalc, corIdent) S3method(recalc, corNatural) S3method(recalc, corSpatial) S3method(recalc, corStruct) S3method(recalc, corSymm) S3method(recalc, modelStruct) S3method(recalc, reStruct) S3method(recalc, varFunc) S3method(recalc, varIdent) S3method(residuals, gls) S3method(residuals, glsStruct) S3method(residuals, gnls) S3method(residuals, gnlsStruct) S3method(residuals, lme) S3method(residuals, lmeStruct) S3method(residuals, lmList) S3method(residuals, nlmeStruct) S3method(sigma, gls) S3method(sigma, lme) S3method(sigma, lmList) S3method(simulate, lme) S3method(solve, pdBlocked) S3method(solve, pdDiag) S3method(solve, pdIdent) S3method(solve, pdLogChol) S3method(solve, pdMat) S3method(solve, pdNatural) S3method(solve, pdSymm) S3method(solve, reStruct) S3method(summary, corAR1) S3method(summary, corARMA) S3method(summary, corCAR1) S3method(summary, corCompSymm) S3method(summary, corExp) S3method(summary, corGaus) S3method(summary, corIdent) S3method(summary, corLin) S3method(summary, corNatural) S3method(summary, corRatio) S3method(summary, corSpher) S3method(summary, corStruct) S3method(summary, corSymm) S3method(summary, gls) S3method(summary, lme) S3method(summary, lmList) S3method(summary, modelStruct) S3method(summary, nlsList) S3method(summary, pdBlocked) S3method(summary, pdCompSymm) S3method(summary, pdDiag) S3method(summary, pdIdent) S3method(summary, pdLogChol) S3method(summary, pdMat) S3method(summary, pdNatural) S3method(summary, pdSymm) S3method(summary, reStruct) S3method(summary, varComb) S3method(summary, varConstPower) S3method(summary, varExp) S3method(summary, varFixed) S3method(summary, varFunc) S3method(summary, varIdent) S3method(summary, varPower) S3method(terms, gls) S3method(update, corStruct) S3method(update, gls) S3method(update, gnls) S3method(update, groupedData) S3method(update, lme) S3method(update, lmList) S3method(update, modelStruct) S3method(update, nlme) S3method(update, nlsList) S3method(update, reStruct) S3method(update, varComb) S3method(update, varConstPower) S3method(update, varExp) S3method(update, varFunc) S3method(update, varPower) S3method(VarCorr, lme) S3method(VarCorr, pdBlocked) S3method(VarCorr, pdMat) S3method(Variogram, corExp) S3method(Variogram, corGaus) S3method(Variogram, corLin) S3method(Variogram, corRatio) S3method(Variogram, corSpatial) S3method(Variogram, corSpher) S3method(Variogram, default) S3method(Variogram, gls) S3method(Variogram, lme) S3method(varWeights, glsStruct) S3method(varWeights, lmeStruct) S3method(varWeights, varComb) S3method(varWeights, varFunc) S3method(vcov, gls) S3method(vcov, lme) nlme/README0000644000176200001440000000243212633761730012076 0ustar liggesusersCopyright (C) 1999-2001 Jose C. Pinheiro and Douglas M. Bates Copyright (C) 2006-2015 The R Core team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this file. A copy of the GNU General Public License is available at http://www.r-project.org/Licenses/ ---------------------------------------------------------------------------- This package contains the nlme (nonlinear mixed effects) package version 3.1 for R. Authors: Jose Pinheiro Douglas Bates Saikat DebRoy --------- Copyright (C) 2015 Quantitative Solutions, a Certara company Authors of 'fixed sigma option' of Nov. 2015: Siem Heisterkamp Bert van Willigen Paul Matthias Diderichsen (sponsor) nlme/ChangeLog0000644000176200001440000012130313573672302012767 0ustar liggesusers2019-12-10 Brian Ripley * DESCRIPTION (Version): 3.1-143 (released) * tests/augPred_lab.R: change yet another 'plucked from air' tolerance. 2019-11-07 Martin Maechler * DESCRIPTION (Version): 3.1-142 (released) * R/nlme.R: use vapply and is.matrix. * man/pairs.compareFits.Rd: change example. 2019-09-26 Brian Ripley * src/nlmefit.c: suppress warning from clang trunk. 2019-08-01 Kurt Hornik * DESCRIPTION (Version): 3.1-141 (released) 2019-07-27 Kurt Hornik * R/lme.R: * tests/nlme2.R: Robustify against using stringsAsFactors = FALSE by default. 2019-05-10 Brian Ripley * DESCRIPTION (Version): 3.1-140 (released) 2019-05-01 Brian Ripley * src/init.c: correct declaration of fit_nlme 2019-04-10 Brian Ripley * src/nlmefit.c: remove clang warning. 2019-04-08 Brian Ripley * DESCRIPTION (Version): 3.1-139 (released) 2019-04-08 Brian Ripley * R/groupedData.R: *GroupedData are exported, so use :: not ::: 2019-04-07 Martin Maechler * Release 3.1-138. 2019-04-02 Brian Ripley * Start preparing to release 3.1-138 for R 3.6.0 2019-04-02 Martin Maechler * po/{R-de,de}.po: updated 2019-01-23 Martin Maechler * R/lme.R (lme.formula, lmeControl): new option 'allow.n.lt.q=FALSE' by default now triggers error "fewer observations than random effects in all level groups". * src/nlmefit.c (finite_diff_Hess): prevent integer overflow (and later seg.fault) for large 'nTot' (already for npar >= 305). 2018-08-04 Martin Mächler * DESCRIPTION (Version): 3.1-138 (unreleased) * R/groupedData.R: deprecate the *undocumented* functions nmGroupedData() and nfGroupedData() in favor of their wrapper groupedData() (to allow subsequent code simplification. 2018-08-03 Martin Maechler * R/lmList.R (plot.intervals.lmList, ..), tests/lmList.R: make 'xlab', 'ylab', 'strip' regular arguments (instead of wrongly trying to use them from `...`). * R/lme.R (plot.ranef.lme, ..): (ditto) 2018-05-08 Brian Ripley * tests/sigma-fixed-etc.R: increase tolerance for ATLAS run. 2018-04-07 Brian Ripley * DESCRIPTION (Version): 3.1-137 for release with R 3.5.0 * po/*/.pot: updated * po/{R-de,de}.po: updated 2018-03-09 Brian Ripley * DESCRIPTION: Update Date, release for R-devel. * tests/nlme-stall.R: Add comments. 2018-02-27 Martin Mächler * R/nlme.R, man/nlmeControl.Rd: nlmeControl() gets new `msWarnNoConv` option. When it is true, as by default, nlme() now warns about non convergence in the LME step of the 'alternating algorithm'. Applies e.g. also to the nlme-stall.R example. 2018-02-27 Brian Ripley * DESCRIPTION: Update Date. (Still unreleased.) Relax R (>= 3.5.0) to 3.4.0 so it can be released generally once 3.5.0 is out. * src/init.c, src/nlmefit.h: Remove broken utilities added on 2018-01-31. * src/pythag.c: New file, contents moved from init.c. * tests/nlme-stall.R: New regression test, optional. * tests/sigma-fixed-etc.R: Changed tolerance after win-builder run, change t7.fix.REML.lme to use optim() (as done for LME, and Solaris has false convergence with nlminb()). Drop all uses of platform-dependent tolerances. 2018-02-26 Brian Ripley * src/init.c, src/rs.f: The 2018-01-31 change is broken (passes pointers as doubles). Try a simpler approach, to replace PYTHAG in rs.f by a wrapped call to the C99 function hypot(). 2018-02-16 Brian Ripley * DESCRIPTION (Version): 3.1-131.1, for R 3.4.4. (and 3.1-131) are available at https://svn.r-project.org/R-packages/branches/R-3-4-branch/nlme * tests/deparse.R: comment on failure with macOS's Accelerate. 2018-01-31 Martin Maechler * src/nlmefit.h, src/init.c (risnan, risfinite, ..): utilities to check for NaN, NA, Inf etc from Fortran. [Since removed.] * src/rs.f (PYTHAG): prevent infinite loop checking for finite arg. as reported in https://stat.ethz.ch/pipermail/r-devel/2018-January/075459.html . * src/nlme.c (nlme_iterate): add R_CheckUserInterrupt() 2018-01-02 Martin Maechler * R/lmList.R (warnErrList): bug fix. Added to the 'utils' package for R-devel, keep here for R <= 3.4.x. 2018-02-16 Brian Ripley * DESCRIPTION (Version): 3.1-135.5 (released for R-devel only) 2018-01-23, 2018-02-16 Brian Ripley * tests/predict.lme.R: increase tolerance. 2018-01-01 Brian Ripley * DESCRIPTION (Version): 3.1-135 (released for R-devel only) * tests/anova.gls.R: increase tolerance. 2017-12-24 Brian Ripley * tests/anova.gls.R: increase tolerance. 2017-12-01 Brian Ripley * DESCRIPTION (Version): 3.1-134, R >= 3.5.0 * R/VarCorr.R: correct breakage in r7326 (2017-03-07) (broke packages joineR and lme4). 2017-11-28 Brian Ripley * DESCRIPTION (Version): 3.1-133 (released for R-devel but withdrawn) * tests/coef.Rout.save: update for R-pre-3.5.0 chanages to str() 2017-09-18 Martin Maechler * tests/nlme2.R: 'tweak and investigate platform dependent results' 2017-03-07 Martin Maechler * nlme/R/VarCorr.R, nlme/man/VarCorr.Rd: see below. * 'correct default for VarCorr.lme() to what it has really been.' * 'Fix print.*()'. * 'Cosmetic (not changing any results)' 2017-02-27 Martin Maechler * nlme/R/gnls.R, nlme/man/glsControl.Rd, nlme/man/gnlsControl.Rd, nlme/man/lmeControl.R: 'cosmetic' 2017-02-22 Martin Maechler * DESCRIPTION (Version): 3.1-132 (unreleased) * R/gnls.R, src/gnls.c: 'small cosmetic related to getting closer to the root cause of PR#17227' 2017-02-11 Brian Ripley * src/nlmefit.c: gcc -Wconversion pointed out misuse of long constants '0L' and '1L'. 2017-02-06 Martin Maechler * DESCRIPTION (Version): 3.1-131, tweaked test tolerance to also pass openblas 0.2.18, in * tests/sigma-fixed-etc.R example 6 2017-01-23 Martin Maechler * DESCRIPTION (Version): 3.1-130 * NAMESPACE, R/zzmethods.R, tests/deviance.R: workaround design error in 3.1-129 re deviance. 2017-01-17 Martin Maechler * R/groupedData.R (groupedData): must prepend 'nlme::' for call, fixing PR #17211. 2016-12-12 Martin Maechler * R/lme.R (Variogram.lme): fix PR #17192, with thanks to Sebastian Meyer. 2016-07-11 Martin Maechler * DESCRIPTION (Version): 3.1-129 * NAMESPACE, R/zzMethods.R (confint, sigma, deviance) methods (the last giving an error). 2016-05-04 Martin Maechler * R/lme.R, etc (lmeControl): 'sigma = 0' is now allowed (and equivalent to 'sigma = NULL'); this fixes mgcv::gamm()'s use of the equivalent of 'do.call(lmeControl, lmeControl())'. 2016-04-26 Martin Maechler * DESCRIPTION (Version): 3.1-128 * R/lme.R (qqnorm.lme): fixed bug introduced in v 3.1-127 * R/lme.R, R/nlme.R, etc: "fixed sigma" now computes 'apVar' correctly; thanks to patches from Siem Heisterkamp * R/lme.R, R/gls.R: coef(summary(.)) now also works for "gls", "lme". * R/gls.R (anova.gls): fixed a very long standing bug in the F statistics for the ML case, thanks to Siem H. 2016-03-21 Martin Maechler * R/nlme.R (getParsNlme): wish of PR#16614 : now predict REs as NA for non-existing levels instead of signalling error. * R/*.R: cosmetics: More vapply(); quote(.) instead of as.name(), passing '...' down in print() methods, etc. 2016-03-16 Martin Maechler * DESCRIPTION (Version): 3.1-127 * R/lmList.R, R/nlsList.R: same kind of error catching -> warning * */*.R: speedup cosmetics: seq_along; vapply(); lengths(); lapply(a, `[[`, i). Less eval(parse(text = ....)) 2016-03-12 Martin Maechler * DESCRIPTION: version 3.1-126 * R/nlme.R (predict.nlme): fix bug PR#16715; +cosmetic; also in * R/lmList.R, R/nlsList.R: better error catching -> warning() 2016-02-27 Brian Ripley * DESCRIPTION: version 3.1-125; released * tests/coef.Rout.save: update for R 3.3.x 2016-02-13 Brian Ripley * src/*.[ch]: remove use of S.h, clean up. * src/nls.c: Unused in R, so remove. 2016-01-25 Brian Ripley * src/*.c: include directly headers included via R.h. 2016-01-19 Martin Maechler * DESCRIPTION: version 3.1-124, and released 2016-01-19 Brian Ripley * src/{corStruct,gnls,nlme,nlmefit,nls}.c: Avoid clang warnings on implicit conversions. 2016-01-18 Martin Maechler * nlme/man/lmeControl.Rd, R/lme.R, etc: in lmeControl() etc, currently 'apVar' to FALSE when sigma is fixed, and document that somewhat. 2016-01-11 Martin Maechler * R/VarCorr.R, man/VarCorr.Rd: add optional '...' and remove 'rdig' from the argument list of the generic (for other methods). 2015-11-25 Bert van Willigen --- with modifications by MM * DESCRIPTION: version 3.1-123 (released 2016-01-17) * man/*Control.Rd: Fixed "sigma" (residual error) added. * R/gls.R, R/gnls.R, R/lme.R, R/nlme.R, R/reStruct.R: Fixed sigma added. * src/init.c, src/nlme.c, src/nlmefit.?: * tests/example_[1-9]_wequantify.R: 9 files added. * README: Credentials added. 2015-08-18 Luke Tierney * DESCRIPTION: version 3.1-122 * src/nlmefit.c: Added PROTECT/UNPROTECT calls. 2015-06-29 Brian Ripley * DESCRIPTION: version is 3.1-121 * NAMESPACE: tweak imports. 2015-02-20 Brian Ripley * DESCRIPTION: version is 3.1-120 2015-02-07 Brian Ripley * man/bdf.Rd: change markup for a dead URL 2015-01-29 Brian Ripley * po/*.de.po: updates. 2015-01-23 Brian Ripley * NAMESPACE: register lme method for simulate() 2015-01-10 Martin Maechler * remove non-useful legacy "code": q(); emacs "Mode: S" etc 2015-01-09 Brian Ripley * DESCRIPTION: version is 3.1-119 * man/bdf.Rd: update URL. 2014-10-20 Brian Ripley * R/*.R: remove unused assignments. 2014-10-07 Brian Ripley * DESCRIPTION: version is 3.1-118 2014-09-30 Brian Ripley * R/nlme.R: nlme with self-starting model incorrectly required 'start'. * tests/nlme2.R: regression test for above. * R/*, src/* correct copyright information. 2014-03-31 Brian Ripley * DESCRIPTION: version is 3.1-117 * po/R-fr.po: update. 2014-03-28 Brian Ripley * DESCRIPTION: version is 3.1-116 * R/{lme,newMethods,nlsList}.R: modify messsages. * po/{R-pl,pl}.po: update. 2014-03-19 Brian Ripley * tests/missing.{R,Rout.save}: reduce 'digits' for cleaner results on platforms without extended-precision hardware. * po/R-de.po: Update from Detlef Steuer. 2014-03-09 Brian Ripley * DESCRIPTION: version is 3.1-115 * R/{gls,gnls,lme,nmle}.R, man/{lmeScale,*Control}.Rd: remove msScale and nlmStepMax arguments which were used for nlm(), where that is not longer used. 2014-03-08 Brian Ripley * DESCRIPTION: version is 3.1-114 * R/new-methods.R: labeling from fitted() was sometimes wrong as the 'groups' component lost row names. (PR#15678) * tests/fitted.R: add regression test. * R/lme.R: clean up * man/{lmeControl,lmeScale}.Rd: update.. 2013-11-17 Brian Ripley * DESCRIPTION: version is 3.1-113 * src/{matrix,nlOptimizer}.h: typos in guard names (clang 3.4) 2013-10-21 Martin Maechler * R/gls.R, man/gls-internal.Rd: remove redundant parentheses. 2013-10-03 Brian Ripley * man/{gls,lme}.Rd: add links, warn on no-covariate formulae. 2013-09-30, 2013-10-02 Brian Ripley * DESCRIPTION: version is 3.1-112 * R/gls.R, man/glsControl.Rd, man/Initialize.glsStruct.Rd. Remove 'qrTol', which was unused and set to the non-existent .Machine$single.eps, that is to NULL. * NAMESPACE, man/gls-internal.Rd: export glsApVar and glsEstimate for use in package rms. * R/gls.R, lme.R: more use of integer constants. * man/*.Rd: classes in quotes, more links, remove CVS lines. * R/lme.R, R/newFunc.R, tests/predict.lme.R: fix asOneFormula and predict.lme for y ~ 0. (see https://stat.ethz.ch/pipermail/r-devel/2013-September/067600.html) * R/lme.R: Several of the return components were incorrect for a model of the form fixed = resp ~ 0. 2013-08-17 Brian Ripley * add start on ko translations. 2013-08-15 Brian Ripley * DESCRIPTION: version is 3.1-111 * R/lmList.R: Adjust to cope with failed fits and fits with fewer coefficients returned by lm(). (Contributed by Ruth Ripley.) 2013-07-02 Brian Ripley * DESCRIPTION: version is 3.1-110, * R/{gls,gnls,lme}.R: Replace as.name() calls by quote(stats::nls) etc. * inst/LICENCE: remove. 2013-03-21 Brian Ripley * inst/CITATION: modernize. 2013-03-11 Brian Ripley * LICENCE: remove (it was not a licence file). 2013-01-26 Brian Ripley * DESCRIPTION: version is 3.1-109, depends on R (>= 3.0.0). 2013-01-26 Brian Ripley * DESCRIPTION: version is 3.1-108, depends on R (< 3.0.0) and has chol.f and rs.f in .Rbuildignore. 2013-01-23 Brian Ripley * man/[n]lme.Rd: add a note about the need to scale the response. * man/lmeControl.Rd: correct description of 'msTol' argument. * man/[n]lmeControl.Rd: correct description of 'opt' argument (it is a character string). * man/*.Rd: s/Jose/José/ * R/[n]lme.R, man/[n]lmeControl.Rd: allow '...' for further control arguments to be based though to nlminb() and optim(). 2013-01-13 Brian Ripley * DESCRIPTION: add accent on JCP's first name (and declare UTF-8 encoding). Add EISPACK authors. * src/rs.f: minimal version of eigen.f containing just RS and ancillaries (replacing eigen.f). 2013-01-12 Brian Ripley * DESCRIPTION: version is 3.1-107 * src/{chol,eigen}.f: port files from R (where they are deprecated/defunct). 2012-12-06 Kurt Hornik * DESCRIPTION: version is 3.1-106, add roles to Authors@R. 2012-11-28 Brian Ripley * NAMESPACE: import selectively from lattice and stats. 2012-09-24 Brian Ripley * DESCRIPTION: version is 3.1-105 * R: improve messages for translation. 2012-09-01 Brian Ripley * po: add Polish translations. 2012-08-30 Brian Ripley * src/init.c: force use of registered symbols in R >= 2.16.0 2012-05-23 Brian Ripley * DESCRIPTION: version is 3.1-104 * src/gnls.c, src/nlme.c, src/nlmefit.[ch]: type mismatches shown by clang's -Wconversion 2012-04-25 Brian Ripley * src/nlmefit.c: type mismatch shown by clang's -Wconversion 2012-03-29 Brian Ripley * src/nlOptimizer.c: increase PROTECTion (reported by Andrew Runnalls). 2012-02-15 Brian Ripley * inst/CITATION: protect against TRE bug in UTF-8 locales. 2012-01-14 Brian Ripley * DESCRIPTION: version is 3.1-103 2011-12-25 Brian Ripley * DESCRIPTION: needs Suggests: MASS for data(package=) 2011-07-19 Brian Ripley * DESCRIPTION: version is 3.1-102 * R/newMethods.R: getData.nls (aka getData.lme) used the na.action of the call on the whole data and not on the model frame: should have used the na.action component of the result. * tests/{lme.R,lme.Rout.save,ss2.rda}: test for above. * man/simulate.lme: document as method. 2011-07-11 Brian Ripley * COPYING: rename to GPL-2 * LICENCE, inst/LICENCE: adjust wording accordingly 2011-05-30 Brian Ripley * R/newFunc.R: name arguments to lapply() when ... is present. 2011-05-06 Brian Ripley * DESCRIPTION: version is 3.1-101 2011-04-23 Martin Maechler 2011-04-14 Martin Maechler * man/augPred.Rd, R/groupedData.R, R/gls.R, R/lme.R, R/simulate.R Changes he failed to document. 2011-03-26 Brian Ripley * src/{nlmefit,pdMat}.c: remove unused variables detected by -Wunused-but-set-variable 2011-03-11 Brian Ripley * Release 3.1-100 for R 2.13.0 * NAMESPACE: no longer re-export BIC * man/BIC.Rd: removed. 2011-02-23 Brian Ripley * DESCRIPTION: version is 3.1-100, require R >= 2.13 * man/BIC.Rd: make a stub referring to stats::BIC() * Everywhere: remove obsolete email addresses of former authors 2011-02-23 Brian Ripley * DESCRIPTION: version is 3.1-99 (unreleased, used for R-devel), remove email addresses of former authors (and JCP has moved). * R/{new,zz}Methods.R: Put all BIC() methods in one place, as the default method. * man/BIC.Rd: remove aliases to methods (not all of which actually existed) * man/BIC.logLik.Rd: merge into BIC.Rd * tests/lme.Rout.save: update for R 2.13.0. * NAMESPACE, R/newMethods.R: prepare for migration of BIC() to stats. * R/{gls,gnls,lme}.R, NAMESPACE: add nobs() methods. 2011-02-10 Brian Ripley * DESCRIPTION (Version, Date): 3.1-98 2011-02-04 Brian Ripley * data/{MathAchieve,bdf}.rda: resave with xz compression. * DESCRIPTION: depend on R (>= 2.10). 2010-10-01 Brian Ripley * DESCRIPTION (Version, Date): 3.1-97 2010-09-22 Brian Ripley * man/residuals.gls.Rd: incorrect default, see https://stat.ethz.ch/pipermail/r-devel/2010-September/058487.html 2009-12-22 Brian Ripley * man/ACF.gls.Rd: has \seealso to itself: seems ACF.lme was meant. 2009-12-18 Brian Ripley * DESCRIPTION: add BugReports field. 2009-10-12,16 Brian Ripley * DESCRIPTION (Version, Date): 3.1-96 * po/R-de.po, po/de.po: update 2009-09-16 Martin Maechler * DESCRIPTION (Version, Date): 3.1-95 * R/nlme.R (nonlinModel): use unname() instead of clearNames() 2009-09-02 Brian Ripley * DESCRIPTION (Version, Date): 3.1-94 * man/*.Rd: remove unnecessarily anchored links, including several incorrect ones. 2009-08-16 Brian Ripley * DESCRIPTION (Version, Date): 3.1-93 * R/lmList.R, tests/lmList.R: bug fix for predict.lmList (PR#13788) * R/gls.R, tests/anova.gls.R: bug fix for anova.gls (PR#13567) 2009-05-30 Brian Ripley * R/gnls.R, R/corStruct.Rd: minor message wording changes from Debian 'bug' report. * R/R-de.po: add [ Missing entries for 3.1-9[12] which were concerned with German translations. ] 2009-01-16 Brian Ripley * man/*.Rd: expand tabs 2008-12-30 Brian Ripley * man/summary.pdMat.Rd: avoid embedded newlines in \code strings. 2008-12-27 Brian Ripley * DESCRIPTION (Version, Date): 3.1-90 * R/gls.R: call dist correctly (PR#13418) 2008-12-19 Brian Ripley * man/*.Rd: clean up some reference formats and misuse of $...$. 2008-12-11 Brian Ripley * man/*.Rd: spelling * src/nlOptimizer.c: missing PROTECT 2008-06-07 Brian Ripley * DESCRIPTION (Version, Date): 3.1-89 * R/lme.R: fitted.lme() always dropped, when it should drop for one column but not for one row. * tests/lme.R, lme.Rout.save: add regression test for single-row predictions. 2008-04-10 Brian Ripley * R/zzMethods.R: add .onUnload() to unload the DLL. 2008-03-30 Brian Ripley * DESCRIPTION (Version, Date): 3.1-88 2008-02-19 Brian Ripley * man/logLik.lme.Rd, man/logLik.gnls.Rd: correct description of 'REML' argument. 2008-02-19 Brian Ripley * inst/CITATION: add file (essentially what citation() would produce, without the warning). 2008-02-18 Brian Ripley * DESCRIPTION (Version, Date): 3.1-87 * R/gnls.R, tests/gls.R: fix for PR#10364, missing row names on predict.gnls. 2008-02-11 Duncan Murdoch * R/*.R: Return invisible(x) from numerous print methods. 2007-12-30 Douglas Bates * [r4884] man/plot.nffGroupedData.Rd: Correct malformed link reported by Yihui Xie . Remove reference to nonexistent URL. * [r4885] Initialize.reStruct.Rd, collapse.groupedData.Rd, fitted.lmeStruct.Rd, lme.Rd, lme.groupedData.Rd, lme.lmList.Rd, logLik.reStruct.Rd, nlme.nlsList.Rd, plot.nfnGroupedData.Rd, plot.nmGroupedData.Rd, recalc.reStruct.Rd, residuals.lme.Rd, residuals.lmeStruct.Rd: Remove reference to nonexistent URL 2007-10-04 Kurt Hornik * DESCRIPTION (Version, Date): 3.1-86 2007-10-04 Brian Ripley * R/corStruct.R: check for uninitialized corARMA structures. 2007-09-17 Brian Ripley * DESCRIPTION (Version, Date): 3.1-85 Also, use approved form of GPL (>=2). * R/varFunc.R: fix for PR#9831. * tests/coef.R: test for the above. * tests/lme.Rout.save: update format for R >= 2.6.0. * man/corRatio.Rd: wrong formula, reported to R-devel by Ben Bolker on 2007-09-03. 2007-07-26 Brian Ripley * DESCRIPTION (Version, Date): 3.1-84 * LICENCE, inst/LICENCE: clarify this is licensed under GPL >= 2. * README, R/*.R, src/*.[ch]: Update source for GPL. * man/*.Rd: add header with licence conditions 2007-07-02 Brian Ripley * R/varFunc.R: varIdent did not look at its 'fixed' arg, PR#9765 * tests/varIndent.R: test for the above. 2007-06-13 Brian Ripley * R/VarCov.R: correct getVarCov.gls, PR#9752 2007-06-13 Brian Ripley * DESCRIPTION (Version, Date): 3.1-83 Also, update authors and email addresses where known. * R/lme.R: called quantile on potentially missing values. * tests/missing.{R,Rout.save}: test summary methods 2007-06-12 Brian Ripley * DESCRIPTION (Version, Date): 3.1-82 Also, R >= 2.4.0 because of seq_along. * tests/lme.Rout.save: back to 2.5.1 layout. 2007-05-29 Brian Ripley * R/{gls,lme,pdMat}.R: qualify uses of nchar() by 'type'. * R/lme.R: layout of over-long error message. * tests/lme.Rout.save: update for above and for 2.6.0 layout. * R/{gls,gnls,lme,nlme}.R: copy row names to fitted values and residuals. * R/{gls,gnls,lme}.R: support naresid and napredict. * man/{residuals,fitted}.lme.Rd: document this. * tests/missing.{R,Rout.save}: tests of missing-value support. 2007-05-20,24 Brian Ripley * R/*.R: partial matching issues, switch to seq_along. 2007-05-15 Brian Ripley * DESCRIPTION (Version, Date): 3.1-81 * NAMESPACE, R/zzMethods.R: migrate vcov methods from stats to here. 2007-05-04 Brian Ripley * man/{Extracr.pdMat,getdata.*,summary.varFunc}.Rd: remove surplus }. 2007-03-30 Brian Ripley * DESCRIPTION (Version, Date): 3.1-80 * R/nlme.R (contrMat): Allow for expressions in 'fixed'. * tests/contrMat.R: regression test for above. * R/gls.R: bug fix for the case of y ~ 0. * tests/gls.R: regression test for above. * R/{lme,lmList,newMethods}.R: patch for lattice 0.15-x. 2007-01-30 Brian Ripley * DESCRIPTION (Title): Capitalize for consistency. 2006-12-29 Brian Ripley * DESCRIPTION (Version, Date): 3.1-79 * R/corStruct.R, R/pdMat.R, R/reStruct.R, man/corStruct.Rd, man/pdMat.Rd, man/reStruct.Rd: add '...' argument to as.matrix() methods. (Needed for 2.5.0, but works in earier versions.) 2006-12-10 Douglas Bates * DESCRIPTION (Version, Date): 3.1-78 2006-12-06 Douglas Bates * R/nlme.R (contrMat): Ensure that the contrasts component is a list of matrices by expanding function names if necessary. 2006-11-29 Douglas Bates * DESCRIPTION: Prepare for new version. * R/newMethods.R (getData.nls): getData.nls for R's nls objects * inst/scripts/ch*.R: update Pinheiro and Bates (2000) scripts 2006-11-29 Brian Ripley * R/reStruct.R: fix PR#9262, multiple-line deparse. * R/gls.R, groupedData.R, lme.R, lmList.R, newMethods,R, nlme.R: more deparse width issues. 2006-09-28 Douglas Bates * R/nlme.R (getParsNlme): backed out change that caused failure reported by Christian Ritz. 2006-09-18 Douglas Bates * R/VarCorr.R (VarCorr): Clean up problems in this file and several others detected by codetools. 2006-09-11 Douglas Bates * R/nlme.R (getParsNlme): '[[' not '[' in case start$fixed is a list * R/gls.R,gnls.R,newMethods.R,nlme.R,pdMat,Rsimulate.R: fix problems exposed by codetools. 2006-07-31 Douglas Bates * man/ranef.lme.Rd: Modified the description of the `standard' argument to more clearly describe its effect. 2006-07-24 Douglas Bates * R/lme.R: Patch by Andrew Robinson and Berwin Turlach to set maximum number of function calls in nlminb. 2006-07-03 Douglas Bates * DESCRIPTION: Version is 3.1-75 * man/{many files}: Documentation changes contributed by Spencer Graves . Most of the changes add Pinheiro and Bates (2000) as a reference or add additional \seealso{} entries. Some examples from Pinheiro and Bates (2000) have also been added. * R/nlme.R: reformat the code, typo. 2006-07-03 Martin Maechler * R/lme.R (lme.formula): when control()$returnObject is TRUE, only warn instead of stop() in the case of non-convergence. * tests/lme.R: test the above * tests/lme.Rout.save: 2006-06-02 Brian Ripley * DESCRIPTION: Version is 3.1-74 2006-05-31 Brian Ripley * R/lme.R: Keep terms and optional model frame in lme.formula. Use terms for prediction (get safe prediction that way). Add keep.data argument to lme and methods. * man/lme*.Rd: update for keep.data argument. * R/newMethods.R: make use of saved data in getData methods. * tests/getData.R, tests/predict.lme.R: new tests. 2006-05-24 Brian Ripley * R/gls.R, man/comparePred.Rd: 'minimum' and 'maximum' were evaluated on a formula in the comparePred methods. Instead, evaluate 'primary' in the 'data' used to fit object1, and document what is done. (Reported by Mark Difford.) 2006-05-22 Brian Ripley * DESCRIPTION: Version is 3.1-73 2006-05-21 Brian Ripley * LICENCE, inst/LICENCE: add and install a licence file. 2006-05-18 Brian Ripley * R/groupedData.R: adjust method of as.data.frame. * R/newFunc.R: fix bug in gsummary with objects that have classes, e.g. Hmisc labels. (Reported by Mark Difford, in a private followup to https://stat.ethz.ch/pipermail/r-help/2006-May/094549.html.) * tests/augPred_lab.R: tests for the above fix. 2006-05-12 Brian Ripley * R/gls.R, R/gnls.R, R/nlme.R: missing data=data in terms calls, needed to resolve '.' on rhs of formulae. * DESCRIPTION: Version is 3.1-72 2006-03-29 Brian Ripley * R/newMethods.R: as.list() did not work on symbols in R. 2006-03-14 Brian Ripley * R/lme.R, man/Variogram.Rd: make example work (na.omit in the wrong place). 2006-03-10 Brian Ripley * DESCRIPTION: Version is 3.1-71 2006-02-17 Brian Ripley * R/nlsList.R: need to allow for multi-line deparse. * tests/deparse.R: add regression test 2006-01-05 Brian Ripley * DESCRIPTION: Version is 3.1-70 * src/init.c, src/Makevars: make use of gcc4 visibility where supported * inst/mlbook/ch0[45].R: remove unnecessary use of data() * inst/scripts/ch0[58].R: all allowed versions of R have nlminb * R/gls.R: element 'optimMethod' in the return value for glsControl was unnamed. * R/{gls,ngls,lme,nlme}.R, man/{gls,ngls,lme,nlme}Control.Rd: let the user (rather than the version of R) choose the optimizer to be used. 2006-01-05 Brian Ripley * src/init.c: missing registration for ARMA_constCoef * inst/scripts/ch02.R: correct argument names in simulate.lme call 2005-12-31 Brian Ripley * DESCRIPTION: Version is 3.1-69, require 2.3.0. * NAMESPACE: use registration. * R/*.R: use registered symbols. 2005-12-31 Brian Ripley * DESCRIPTION: Version is 3.1-68. * src/init.c: new file to register symbols * R/corStruct.R: corrected one use of PACKAGE="base" * R/lmList.R: remove attempted use of 'frame = 1' 2005-12-09 Deepayan Sarkar * R/newMethods.R, R/groupedData.R: fix for problem described in https://stat.ethz.ch/pipermail/r-help/2005-December/082890.html (superpose.line/symbol components were being truncated to length of an arbitrary component). 2005-12-09 Brian Ripley * DESCRIPTION: Version is 3.1-67. * R/gls.R: Replace do.call by eval.parent on massaged call. * po/fr.R, po/R-fr.R, inst/po: add French translation by Philippe Grosjean and automated en@quot translation. 2005-08-25 Douglas Bates * R/gls.R: Added option "optimMethod" to gls, gnls, and lme. 2005-08-24 Douglas Bates * R/lme.R (print.intervals.lme): Replace calls to print.matrix by print(as.matrix()). 2005-07-25 Douglas Bates * inst/scripts/ch08.R: Cleaned up examples in ch04, ch06, ch08. * src/matrix.h: Include R_Ext/Linpack.h in addition to R_Ext/Applic.h 2005-07-19 Douglas Bates * R/gnls.R: Added definition of convIter when using nlminb or when using optim. Reindented this and other R source files. 2005-07-12 Douglas Bates * inst/scripts/ch01.R: Clean up and check these scripts * src/nlmefit.c (gls_loglik): re-write contributed by ?? (I accidently deleted the email message). * R/lme.R (lme.formula): Use nlminb if available. 2005-06-08 Douglas Bates * R/lme.R (predict.lme): Fixed bug when using a name for a formula in original fit. (Reported by Arne.Mueller@sanofi-aventis.com) 2005-05-20 Douglas Bates * man/contr.SAS.Rd: Removed 2005-04-04 Douglas Bates * R/newFunc.R: Removed contr.SAS definition as it has been revised and moved into the stats package for R-2.1.0 2005-03-02 Douglas Bates * src/nlmefit.c (gls_loglik): Replaced rnkm1 by p. * po/,inst/po/: Added localization support. 2004-11-04 Douglas Bates * src/nlmefit.c (dimFree): Fix memory leak reported by Brian Ripley. 2004-11-03 Douglas Bates * man/varWeights.Rd: Remove all calls to data() * man/corExp.Rd: Remove all references to the mva package 2004-08-10 Douglas Bates * man/pairs.compareFits.Rd: fix syntax errors (new check available in R CMD check) 2004-01-14 Douglas Bates * man/getCovariate.varFunc.Rd: Syntax correction from Kurt. 2003-12-16 Douglas Bates * install.R: Create stored image 2003-08-29 Douglas Bates * tests/lme.Rout.save (Coefficients): Now consistent with i386-linux result. * src/base.h: Replace R_ext/Mathlib.h by Rmath.h 2003-08-09 Douglas Bates * man/Covariate.varFunc.Rd, man/Matrix.pdMat.Rd, man/Matrix.reStruct.Rd, man/Names.pdMat.Rd, man/Names.reStruct.Rd, man/coef.corStruct.Rd, man/coef.modelStruct.Rd, man/coef.pdMat.Rd, man/coef.reStruct.Rd, man/coef.varFunc.Rd, man/getData.lmList.Rd, man/gnls.Rd: Use \method for replacement method documentation as per Rd changes * R/lme.R: Changed check for intercept-like column in getFixDF (PR#2418) 2003-06-12 Douglas Bates * DESCRIPTION: New release * man/ranef.lmList.Rd, man/nlme.Rd: Overdocumented arguments 2003-06-10 Douglas Bates * man/MathAchSchool.Rd, man/MathAchieve.Rd, ChangeLog, DESCRIPTION, R/groupedData.R, inst/scripts/ch03.R, inst/scripts/ch04.R: Release 3.1-42 * inst/scripts/ch01.R: Protecting power in formula 2003-06-10 Douglas Bates * R/groupedData.R: Fixed bug in groupedData constructor when outer is not missing. 2003-05-16 Douglas Bates * src/nlmefit.c (internal_EM): Fix by Peter Dalgaard for compound symmetry EM calculations (PR#2985) 2003-05-05 Douglas Bates * R/lmList.R (update.lmList): Changed this and several other update methods. * R/groupedData.R: Use eval instead of do.call (Dieter Menne) 2003-04-17 Douglas Bates * NAMESPACE: contributed by Brian Ripley * man/print.corStruct.Rd: Removed this and many other redundant documentation files for S3 methods. * R/ Remove redundant GPL notices. 2003-03-25 Douglas Bates * R/nlme.R (nonlinModel): Moved definition from AAA.R to here * man/summary.nlsList.Rd: Remove references to summary.nls * R/newMethods.R: Remove vestigial definitions of AIC.lm * R/zzMethods.R: Remove references to AIC.lm 2003-02-08 Douglas Bates * R/lme.R (lme.formula): Removed hessian=TRUE in calls to optim as suggested by Brian Ripley. 2003-01-30 Douglas Bates * R/lme.R: Incorporate change from Brian Ripley in response to Dieter Menne * man/lme.lmList.Rd, man/lme.groupedData.Rd, man/lme.Rd: Documentation of the contrasts argument added (Greg Warnes). 2003-01-30 Douglas Bates * R/lme.R (lme.formula): Incorporate Greg Warnes' changes for the contrasts argument. * R/nlsList.R: Correct check for is.null(class(FUN)) 2002-12-27 Douglas Bates * R/newFunc.R (gsummary): Fix comparison in check for varying columns (PR#1775 - bug report with fix provided by Dieter Menne. 2002-12-11 Douglas Bates * R/lme.R (print.lme): Removed one more as.vector() * R/varFunc.R (print.summary.varFixed): changed instances of deparse(as.vector(x)) to deparse(x) here and in many other places. 2002-09-10 Saikat DebRoy * nlsList.R (nlsList.formula): Use "try" instead of "restart". 2002-08-09 Douglas Bates * R/groupedData.R: Fixed creation of grouped data from a formula only * R/newGenerics.R: Renamed the initialize generic and all methods and calls to Initialize so as not to conflict with the methods package. 2002-07-23 Douglas Bates * R/lme.R (update.lme): Fix formula handling in update methods (Brian Ripley). 2002-04-20 Douglas Bates * R/nlme.R: Bug fix by SDR - convergence criterion was being calculated incorrectly. 2002-04-04 Douglas Bates * man/getVarCov.Rd: Added an example of the type="marginal" Corrected misplaced brace. * R/VarCov.R (getVarCov.lme): Added the getVarCov functions contributed by Mary Lindstrom 2002-03-27 Douglas Bates * R/lme.R (anova.lme): Change strvar != "NA" to !is.na(strvar) 2002-03-05 Douglas Bates * man/ACF.gls.Rd: Changed Jose's email address on this and all the other man pages. * R/varFunc.R: Incorporate fix from Thomas Lumley and from Setzer Woodrow for the logic where ifelse(length(el) == 1, is used instead of if(length(el) == 1) * R/pdMat.R: Change all vestigial instances of T and F to TRUE and FALSE. 2001-12-18 Douglas Bates * R/corStruct.R: Finally resolved the print.summary.corSymm controversy so it prints and it prints the correct value. 2001-12-10 Douglas Bates * R/lme.R: unclassed the logLik component of an lme summary before trying to put it into a data frame for printing. 2001-12-01 Douglas Bates * R/zzMethods.R: Removed the .Alias calls. 2001-10-30 Douglas Bates * man/pairs.lme.Rd: Modified many documentation files to pass the codoc checks. 2001-10-23 Douglas Bates * man/ACF.lme.Rd: Modified many, many method definitions and documentation files to get them to pass the R-1.4.0 (in development) package checking process. 2001-10-08 Douglas Bates * R/lmList.R: Fixed definition of logLik.lmList to work with R (but it is still rather ugly). * R/varFunc.R: Changed definition of logLik.varComb to return a logLik object. 2001-10-05 Douglas Bates * R/lmList.R: Fixed selection of id[subscripts] in the panel function of pairs.lmList (and several other functions) so it does not produce a warning from evaluating is.na(NULL). 2001-09-17 Douglas Bates * R/nlme.R: Incorporated a change from Setzer.Woodrow@epamail.epa.gov for using nested grouping factors in nlme. 2001-06-20 Douglas Bates * R/varFunc.R: Changes in calling sequences and in documentation so the package passes codoc() checks. These affect many files in both the R and the man directory. No changes of substance. 2001-05-29 Martin Maechler * R/zzMethods.R: Use .Alias() * R/newGenerics.R: Generic AIC() * R/newMethods.R: logLik.lm() moved to "base R" * man/AIC.Rd, * man/AIC.logLik.Rd: AIC.logLik() and AIC.lm() as well * man/logLik.lm.Rd: 2001-03-28 Douglas Bates * R/simulate.R: Modified simulate.lme for default pdMat class of pdLogChol. 2001-02-24 Douglas Bates * R/newFunc.R: Removed the old fake xyplot function. The new work by Murrell and Sarkar will make this superfluous. * man/MEestimate.Rd: Added manual pages for MEEM, MEdecomp, MEestimate. * R/newMethods.R: Revised assignments in plotting methods to be compatible with the Murrell/Sarkar preliminary trellis package. * src/nlmefit.c (internal_decomp): Corrected an error reported by Kathryn Chaloner where Srows >= ZXrows. 2001-01-10 Douglas Bates * DESCRIPTION (Maintainer): Added Maintainer entry to DESCRIPTION. 2000-12-09 Douglas Bates * R/lme.R: (Variogram.lme) Coerced n.pairs to numeric and corrected calls to dist. 2000-12-08 Douglas Bates * R/lme.R: Changed all calls to dist in lme.R, gls.R and corStruct.R to use the argument "method" rather than "metric". * R/pdMat.R: Replaced calls to .Fortran("dbksl", ...) with calls to the R function solve() for R-1.2.0 where the S_compat.c file has been removed. * inst/scripts/ch01.R: Added the chapter scripts from "Mixed-Effects Models in S and S-PLUS" to the inst directory. * man/formula.nlme.Rd: Modified the examples in this and many other .Rd files to use the Loblolly data and the SSasymp self-starting function. There were many occasions where the Soybean data was being fit to a default formulation of an nlme model just to get things like a formula. This fit of the Soybean data is difficult and time consuming and not very illuminating. 2000-11-30 Douglas Bates * src/matrix.c: Removed dependency on S_compat.h by replacing calls to dqrdca with the equivalent call to dqrdc2. 2000-07-24 Saikat DebRoy * Changed various uses of do.call to eval. The reason for doing this is to allow calls to the function calling eval from within another function. It's the old scoping problem again. 2000-07-07 Saikat DebRoy * src/nlme.c, src/nlmefit.c: Added mixed_grad in calls to optif9. * src/nlmefit.c : Added handling of pdLogChol objects (pdClass = 4) in various functions. * src/nlmefit.c (mixed_grad): New function giving analytic gradient for mixed-effects log-likelihood. * R/nlme.R (nlme.formula): Added updating of the pdFactor in the PNLS step. * R/reStruct.R: Made pdLogChol the default representation for reStruct objects. * src/pdMat.c (logChol_pd): new function. * R/pdMat.R: Added back the pdLogChol class and associated methods. 2000-07-03 Douglas Bates * man/corFactor.corStruct.Rd: Added an alias for corFactor.corNatural * src/nlmefit.c (internal_loglik): Changed the return value on error from R_NegInf to -DOUBLE_XMAX so the optif[09] optimizers will work properly. * src/corStruct.c (corStruct_factList): Provided a correct call to the R version of F77_CALL(chol) here and everywhere else in this source file. * R/zzz.R: Removed the deprecated call to provide 2000-03-17 Douglas Bates * added many data sets * incorporated patches from Brian Ripley to use optim for the optimization rather than nlm * src/nlmefit.c (internal_loglik): Returned R_NegInf instead of generating a error on a singular precision matrix. * DESCRIPTION (Depends): Changed Depends to R version 1.0.1 because of problem with assigning components of lists. 1999-12-23 Douglas Bates * TITLE: Changed the title to nlme nlme/LICENCE0000644000176200001440000004343112740165251012202 0ustar liggesusers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. --- All the above is an exact copy of http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt (on 2016-04-15) nlme/data/0000755000176200001440000000000012213262320012107 5ustar liggesusersnlme/data/Muscle.rda0000644000176200001440000000147513615562454014060 0ustar liggesusersVnPӔ(}* J%b;q6-nuؕ7#ذ(83ӨTɝ=3s(EV U)(3Z<_hKdm<9PA@dfpLL0 ,sX̡JKev]z TvTXX%QofQpEتWX C2"nd2)\Z]B@8Fm/ڲQۊ(p[ep}uy X]?[$^7綼cy7e&sثwǂ^^ ex9`/Xwr7_@eПamŽ*r?l".OFL7UIaߓ|ϩ.&E}nvq%W౐o7]}Oi=ONMs 4>qDr *Ǜ*ǣ*G**穠 (hn dFY+hP B'>0hA; 9MIq&5)IUbJ5ֈ^fעlYN|ubS 6^fMϦ6oz¢΢bEE:t>u>t>t=`k08֨XKA\ >pc7ΞJD.Q(i?z,R+.;Q NJzJITwlh-fC?BWsԆw7Mr5 ?e~BTq' C}0Bzusiq‡kjxRIíq[o_S ^i1 nlme/data/Dialyzer.rda0000644000176200001440000000357413615562454014415 0ustar liggesusers[lTEOwݶM Ԟ^ ޺-H">,.쥞bA% &o˓b"xyUb ㅄDg?۳h|'?ӝ5Si*IKr7$=.OZ̺9281$a7uY1KCq;FPǡ4;C:P;.P8EeCt(m9)ٟMwPjpAႏ *t.\J$)$HRIHI ڜkɥ'o.lьȦGJEsYI5KiZi:\iDs+}|USzy?k9:uroW Mu讞 ߾iuIժvһ?yrBZ^c\̃uz5`"O#w }kq}xƺuMY?UwBSǹ ̍:w2\%սy^93ȷ4<.׳sC=~r Uz's0.L¼y_;~IҌ<<}>ף|혿:;]d'Cøp)N8C>?9,SkݿG+U[>Z?`cV6e7kw}5Wle}ŶNj]>V/._?a~!a,$Kp}g%WxZc:^ W@/^x9숯yػ=K 슮WϠ=y> W> 7a}%8eA>'3Ky☯'c\zAÿB\"C/Ḙ%859?~ B^{qK'x~zX|$>yt/Oc8^x/OT|"dBf~uEX7k1@ca>pbK}vAoAoAoA_ |owˌY0?X72e##]rXa43i(>[8RwAG%C) IK4Hnw,"C C(PC!B 8!B *1TbPC%J *14bhЈC#F 14bhЉC'N :1tbЉG 1|G 1|G 1O ?1O ?1#@1#@1#@1#H 1#H 1r[8r,DE5!B /ĀM4YdAM4YdAM4YASM4EASM4EASM4UTASM4UTASM4U a-.d qXόFҥ45ro0_7[4\D6s'lB>S($8 Ip%mMuo:lWn뫀kXH&nt j{uȕtv4V,tU~T0Ʌ\+gLSh>|F%CK"R\F=ۑ2Mw>Q,#@̖ #V'{u]tе}hfm8KI N9QX}n~ Z},nlme/data/MathAchieve.rda0000644000176200001440000010014013615562454014773 0ustar liggesusers7zXZi"6!Xn"])TW"nRʟKMd[_;zk 0Sǀ;\h~춪2#ߵ3!:m[5UKy %n\vg\ISyAS)]= _(NvjZg#W#t`4AAh/GjP#y"9R1rʙ/e2\߈`51J$}'emdEɭ߃X,RAc]R[~`aI{,֘)v ѳxAn Ǧ-X 9wfU6voXl2h{̟ҭOH /b fg,E˔-*ݠ'aFE1n}Q~WVsuGwܕS%YB? iOk٨R e报ퟺv$wQ&3qz`L=_*+ K=?2NP7N߿ql|6:Aty`Qxt6"ۆS*GmLj|q*7Y-"䟕4ݿ>s6.{]~~CH2(CX˒?4!Oc٠(Vhq\Գ^׸rR}P/l| jiպrKPNyƙDM8&Hv&d\w?TKFW7/jETPDVS&X綇+1ǁ94w[57dݖrD[ΣxaW+VDiAWQÖo13ٲ<!iTCf\ePhhWgMOGՅ{r΋*=GcCQBL:FD1m*F2P9(:z@ 'RXs0GMX>k ! ;k+ؗEgzz. ֽ [^:/%N|uǃcH`a.ءL@rh~FߴV u\$BxںE ؒ)D/@S3YY=ڇx3.hICM#:$ެnHjca H{FuH~<= f8yq҆Nװắ8>RGjҿަZq]TT6EwaKڶj:Ũu $sȷ!$Om} Vj1{Z\]t^t_mh3{ٷ|LI>s]v;t5mL"q @3usmԕ(OB?L.vzNq6;d_b P<%{m҆$C[?XլSR e^ sW92H,$P\jQrf%ʡDP/DzT~!bFƹDkG.! ?{wuޝ8]jS7#򆕮 Pxܩ1R+AiMLtx ۟ L Ipm"ƬU|e{|+_Iމr.8̀51׏ цǘ!VD\whYzRP D"fۀͲ4-Ś>@z MC!`5\Hwȶ!'}`i@҇Af3ۉG&~ [hČN(REʷp9!RLp^E/M!”q%AZnx,=UtX9H^e/\}B Vq65.F%PSPD~Y}<7rJL~PG]53iE &icC{nge4[SӞl*Fx*8az όukUn,;.K]!M-H"R!W ig;!GfhU Uŕ3N@>tOR]=LblX24}| bULNRM>C0 3}hQvr+Mtny](v3d^(QPkY.ނl6rp#X+r7w.qџ`)}/s\ഹd]U<M:JN%Mu hENߴ3ZǑLG;ڕe}.//xzuglcx$쓙Faw}hx!R [20GYbJnO#$_Py#*tZƂ iBAn)ȆÄ:Sc_{_nT"rT@阙G(TYF<лI;gd\9X\y1vwiQn4P)71nst7}pӪV%8X?j3̡K,6s4_"Ϥ[{ĭULQcX-GR4 E53Gf_M@x^  UR^4퍮ǖ <~.)APvG=cAkZ}߯BTq%':#&߭8Ġ~>k 䟵<߬UBµ4L3%dN{dx}hnKȒWC D-4Np񾍜p6$ b  m`O`A[kd6W42``E}NrCn5(CR+䎊WcW.c,(zcJXu>8u"A,1iC YӭM!;Amzs9f{bp #ҕjK<خC? 3\| -xиUہH222NⰴEm]e).G u@ l* j8"ܿ X0GDƱqc8Y,&Cj ѫ=ɯ>dK7R1U3 \yRO%5t1m՛}B_fЫaUZa|qk`xCnW0/d͛3dRZʋ;iIWڢ=FeR _" p"/[y,}k4|J($n?Wd͏)5!L0ש1"K'aopCi1']BCBk İ8#}'3Ȣq0P*wׯ ?^$+s9`f zsސ/!qT*hJͅ+Qsbq[/!ϭmhӡ! D\!>YkduZi #~ˑgGh؇8v ɢ{|^ӈ[xMlc[SX0SĀH'[lޣΡㄓ3&PP$ 3h[xbܗ&sZT%r?-rQq@yXICzF=X)t}' SŹ)c"e$.۽sh"si\,qAgH2gOSuHt0!'tRΥ47hOjܨr L8HbV=R/GP%)n6 ۠YٻKJq7LMboqEwFXw:0Ba\ł|Ƴ5%;e˺hH|/0$J;GgW=ϭ7:+ϫ狓>l (e\'<ȿ0%lԄHU>lIۭ>DU~GۥԖ%r%5gYD ='G[D3-cێ:԰"=ꐖԄ1tnҔҙ`RnRصN%/rɱoU.Qg2hRr2=GOkj Vr?)MHdA8oXx_x}Jf_(= 3PO7̊!?7xJEGia+rxKcHVPfbŽun:fdzEIZhRgK|j- ]JBmVɴIui=<_r}R>arڣPpb-] kK'?7ܩ\99i@%&CVqoz;J Z3?sr֙ !~m@¯+Žr8eg[Q-z†Beɂ!YvT?adpFbu.gB b7XeCV;MmOX֞D$SRqFGڠ]5mk55D]5!W0pF2o Xx_F֨H z}AFh1F$MVA |xL6v{x.i#$mSF+75j?KM_ oȢjSmК0k_2Y .t$Ilikw=Ѱ'X9xNI3$-( UŸ4OL~-gCq$/7XNoM'#cO$˓!uOr<|-0-E j=L6ĜVEVfR mXydEp '\5}z,|p9r$B }ѐF𩣷YzHhAQm#b{~n[vp iC&umCb4xwմڊ/_"Ħ̈SҀbPG.|Qb|ܓ0c z._KQOwi9@6&)d xO-? 8T*N$XpaٟUn˃Cj4@ Rυ{J{,<"LjS+\mW|d-CFo5ˈd0{a&QzBk*#9TCMU%@" 7ɽ]xeټOmn #+=s4lԭM$MDnBB=KY74J^ "hJH߆>W6f"Cɜ 20(ATIMg%*/YJ6dY7vrC5^=JF%v7X>KU.$ `,h>lDԶk t%iR'D2jjoQ$qCnx[m<9$I\W7Y}:3nQ aH5$0=Y90B$݊ͬ!;zU Tc%"]SW~jVY 16#8Ekǧ+2'[1ڡ^ʸ4Ko?."$*\&:OB~89J,uD+)]SAj\{VVg뻙P|ݭ`U͍ pFC*`kF}j4Cvxҵ2?0i)^ 4$Ҧ̋9,0(V+: uA|YmB P[W(Ȅ}C"U6a[xpVϥ,3< q67ˈW:-_{ٗZ '3NsTG"=^#lDexcJ1%#ctym3Q'!S8E)\KYdф0?jE\A:YKMz|gr/!.ã}fU|_ߢpO֋ЖX#2w8ʾ XJΟLe|źnLD(%c+&+ B$꽌_'z~BfMܧqqHjw଩]J~enf\C{oǮ 6.A~:  qXd_K[)p:VoGY~Aj1ƩU =S-3Cڶ*kƒ,l:1 AD`q>֨R~F–q]B6 "+e{4f@4uL^}+>D,`øqJ*P`^bcM%såԞg^(h 3fZ'>bU[O&:>d<NFfr~e qgL 3Q滕V?'04JKw#RꇑD' . JJ;w׬: ~"%(< *Hv[` Ra'QDc]ظPqGQfbHphSlWq3cetbdEYH8`qgd\n=-'Z vtuHs+ACs"EXvzTA]~LfXCot!@xU,|B>ٷ3Djdn6M96٣O~m}A㇉vi-UT @3>,r iR{5JаÉX q龡~\i=-PȁgP;351i~s :5g6_=1J +aP 8=$k*TIϙPJ3v 'R|/XzcYZ';LKB4 $~ *vo5Pj-[( Z="Eт^XYyI{pCΉ 燯{䶖/ upzѠfK (n@1:)b6}ZXpẁ8rsj Z',G+ oI>eEn`cEה‰Ewr#oBx1NNc}IO VOrpuڮ6cڭc-Vƫb9._qӶMq r{y̸5|}T1PU^j!Q)k uEjhm+@e?~,rxڄ/s2D|kҧT{oF o6!"MדF!PL!S"U(6UWKxZtd&v'f''ȥJa.N(6`GEXKr!ZY ֓7 1 O~_Cͮ N}ϧ5/h\[=^;DӋg QS+ V hYgyMk2OϵQen1xCr ̜7iT8B=<}=@ԇ̒e΀ׇgYgQG8)BA;~E -e̺ZAWz;Mwt%gx6p@I3V;>σ{@Q 0y^3?{A*)th(&ɭ<'`%4cd,/Dp=Bv'6kH}js7(p(O6Uy<+S5ݙGk2uhw@2u7!*OOÿ+C^Nng[ ' N-d~XخR(:){*M҆)zd 0P.F"w-șcƅOM'CI.92'CMdΩTbD./tWt"+y7Pv6nTT}\߁U GP|5˝@ U ׯ7I5yn8d@Hg2q{aaxca9 tvS L3[9Z; Ar=;u/^\bΡD,"@{ K7\7%7[[M<Ԁ 2 'Vߝ^<ZT76 * oAe0І>el=NRa jǚ [ 5)J3g:5z{$AE,+"/W'UR P&qٴO~ͰᱡFݲX9oAiɴ_jRo*^?b|fT 4e pNiSKf 1*B:()}jn`*F֪&){`_.y\;=ߊ\T {!2m߄!>hRWf@`8y3DZPSnٕE5kl? ߛ̕m@]={ghKl/1i#3ܗb}Ȧ>K]RMW 2A'u?kzExxX3lr&4 ۅt㞫3)[[GHXky*|T } ]1, .- %;7RsA&5C%7OKi:ٳuVVj ٗ[]P4G",#m"RlF~h0;o,?,PEzh Fى%׆'f_h ˏ\0PR1("Cģ~9y(gŝJxNwzbHf3]j!;6r/2MlmmrPw,ʆ,]'%ڑ<%0e'ٳDSD KFݗU*Z(>"s56!B+G`S/= V߽qQ~EH& rRePXڪTeHk ɧSs[{ 7Mk7/OP# I8C[l^GY9o?!)?S7$R'IBΉ 8߿@Ѹ^>+#3{ҁ :D Co cʨE:O9 F!0~ֶE˲G7 jF(ֺ2#U i[Zds:vY -42нQjfV_~ʳ b#ׇt~zU‏cF޻|5ܕ:X Yh A6,|`}%s_SMtO. 300gw"S-*r^ -~iI*.Q9׫͊귖B)n[T)ăh,(Q1xn䔆{&]ޤPz|Ȋ. "c$oCLTKtaWSmL .*<@IS/y/R"tv!z qYd.:ZW^*Ꞌ?." $ Lx6ۓTÒ6],p0H~7 +,\y]{$wd77sנ=0df DU%{nKO\a$A׮bQ6/K}5|xf1l&__|IB49/ƈZ=axl;Ep(Il1&~yJ .`u ~2-ү\ܘFې7L2Aun\|T}ı-S!3Ϝ ʉҮQGrOIhKȼ&;p7\xv!Q^P%m8-tQ V YD_[W:o.t@, 62Vw-JYO؅b`?AF+mmщGS6հ}' [.ʃpgXPڵ ll}ygwn ){2%hwU+NF SVe;%l$ߩ d!ѓ"*NNk⏮lQ鳘MY@}ƾ'\Vw(S=4;;UܯbkWX9c\:"_jp^T׆?ucf]]O ,C"[t-/ЩYjQP wQUG鏍IyJڊldP<6X9F`3^i70mA!h{=񯻣"t,5ox~{p *:+KOqG*}"F'݊SӪT'hPNs SPgJ@?[f`[E_Nbk,&1୚ IpNVMɎWF}euR4V;V> \%CTHܱun?.k =Q}kxbnz+|KTRԋ1ڭt.^fqRq%8$ANIAr[f ƚw ,<{ nFPA1/q7=ݍ"a8Zl1CO !?#F 4:~=2t}2 e}MxRw#;ő0btuNzbʠɃYC]Fv G6MAπ'&J'~XŝN9cL \@f͍]2?E҈|WեFU^}- ģ0\d8ԓn;הooH~;QIWڛ"A&-l̕U2Jl'٬AMע]D>ҢQx!%YvƇw3:_n+qw3 s Hf,l[GA%%E 6c/K%Q7oCX>-Q…mymIݙ&‘ݼ9߄g8@H(6iXtDrwLCzTV4 ^T'ZVaOPX)[X5q0bٿW!jDٯL.FY2iBx{8[H AMჲC2$}:,<îw,Qx9ʼbFY]\Y|N6c )(e28Ը@ggJt!a>L.{EH}V'Q ]N.Ėf|2Rl'x gp@S'Q^C5ԯ3l݉kH}pZGjF3hU4|ELGYv$ȒS{of]aEk~8{36qVGPZz_X8%`'?Z[Ϗxٟd1^~Q=zےc)V Ze1M+G B`tUjnȖxpAo.L/+Ṵ!PGme"X^*6D W'l7\wR.U)>$Ķy^z]Ca<0 iZl*":)S7()]ͽx`ѐȁCU$jjkT^&j𤴿Ak 3s7:%xJCH)*%4P&A+%]9`Lm ƈpMyh&Sߋ,96~(TȰ0e^*Ī #)J}T+tA5^#˝7ggK^M<0(cDn.dņ& Vk./m :Αu@Dٗ^qU(2HS{@3~Jh_ZJ僑,K=4ψE]" y~[΀&jd*.!8+I4Lgy`׿W#'헙T4|r_;դv\PBNK1ƶ'8YYY0IM'$~qql_J,q~8{~ B1I^O,!tT6o g^6iYw!kbjC9Wva2W cKL-Yzo`YI|}6>$vMyG`p8J&DeHj0tZP ؀xp +Tb`JjJ&ZD[1PIC3|x\HҋPURa ֙tB-I>:N6w5h36510cɑG>!P)')g_ &1H?T>Sgm60gg&on`);$Nu)h?y-@,!K\hT]~c+;ͮۈQJ$\LkF4A* "%0 +p:I-W+^T'VD`2j\i֎ ٙa+MjɥP{I=9WO. K2݈|/DS1'uV_ZRl6o)(w_? IK0C9\Qᐏ :+#‘pF:~J^RrbzHmƤ&bP,.$2hyFaټϷິURi? ^4}TOXEe=V: =M4_:a}a[ 9/O>v%J@7j?^yaOm$~uAm[sJ@ӣ>i^PNd>@n8~3˩~L9T 2lAzq,i}G7U{VFIC^YdD~L"ɪߏ?ө(*`#[F(Oz9\t0oo>$oݐDx3 y&JWt0rR/zo/4@{Y/>cgyWem< dݲh]EK1#"{x˄|+{mh{mS!h+2Y7Iu4z>]$_o+D!l^F;j;.~\͟GƏ2[JTtJC$;]E{ck47㡐gMҹYYsa \5)Jg5I6P߂KJ〗$_?_ޘfi)v37g- atv?2 7sd59P3o|ӭ7V߄H\?92*|+BY2XF_WԨC`OFě1)憃1B~mXh =P[]5s^NaE C2T$@QrR IK!ۚpv7{q8'Dey@PXo,"@/+2}GE?R}J#odw񫩚I5c{ R\q|WƁJvMvw%7#-VO=Xa$bU~`?I!]`+  xYmؚjPFt9b3q݆mʀkž ,n+2Wi4s%GF "8M,DAzs/1'&rA9 JjA/ ӟ'HIGml̊ UȥJ3qxjq{_t.`ŞJx@r;=#΂ܳ$P˯G7}t ; >V ?fS^ qw?x(*1]RжŮl rTifNj9ۧ}\c,l|ݹ5jJHi%㌉`[M0HquU{ggZ$j5daHa Sݦi좉gǝJ% 5 FuOB?=V t11L>(G0fғ͸Ş(.6 8ZK47.`ȩ{~!%zŞ}Fo,%cĭGIһ[f_5KV0re#Ԧ[ӫx*?́ m4[}ڝE!+,ގd2R*zj%g'$J5Zc~^㛳C'H6LIE+?^45u (^ -bZ{&% cߪ~2x[{$T+fpZ~^'!51zeb ?S\Ɂ5Z4|(ФeSiKRbp99,7!9)ؘp1X禿/L۠Տwϕ" 0e3Z X!W>PWpE#l$Yc2Rġ #+7:ۙorX>۲Aؽd8@{N}LHIiw&A6/ 1:] :&T oW-ȅ5,HGe{ l7L٦ЃюGޘ?RǯNOlh!8cnDܜ9 hD! .,>n]3_O!Cهm2`^"gy#Nδ-e:F#6Հ$?k(2Mn6/*}~_KbRs.1 ek̎=Ɉ4K "C-UOI]Cۂ.f` Zͻ@ V`!T5=2fΪ WjaPבb Pc5R'y2[f8to…m{}Ž%di/Yc |R[T4]ڤzO0~*ۆ:t֧ A3JB δsK:XB'TVG1"%h~}U@)7{T1o 1倗Θc:p\Ȕy9MLyNro[uy=p}> J.ݠWF9K>2.ƨKA栐 @;>#;=\+t!7g#X,q i;ŷNO؛jLB-g X?aO̔~G%44 /<"&&筮88w mĎ\ dgKNuusPR㬠]h'J1-6iOGX1݋o@ѣKM& W GfLĊW)rwU,4w75BԄ^kqrϨ/b0 Xs4CUF5Cn6һx/[RǮ=>5x$1ƀ㵚hvz=p8 c"@rC#0%O0zp!4n{)6OM9)[ j&Ky*.H \?fIz]剾"H-BەockJ@ {7s)ǝTCO &J,}N}/7┷)4)<0,kC(2.!qSJ}5}Xѯvg&I}H;>pR`UK9n\fxU\\׾JHʄK .xxxAֳx(7ƗvF\שJleY2e[B|IVF;|gt<>Bg3%B1?Y,dv[ 'zn60?jh⍺)IԒpR .Oe5:|ȶ+r5!qS`֧\3OѰFÑdǗPjkF[?G|Zgnt6Ӟu'e#\]x4'6AXl:]t(N3ơ?7ؗ;DehWTDZ! hź'ǰW{'Pbچj}vEt |.5:EXÞ7C$`<@uGarb's8 VKNo.'qG0Q]N0")I~~9NGed^t6&yMؠgbĬ3m-?JC/Ԣoiq-/#U2(7H JTwzy7N(ۯzFJ7ToYZ%lO}UQRa?(z[̼ nqJ{58N|S&l>L0{_ Ǫ1MJ@= cBAn>8@¶* O%?3qߙw(Ls dէ 4ClPc@u޽DK~YnUg]/۵ocziF3&XK7 lE)%rNm %gz 5gcD$SeyLմZpH9ۓqP?jAGD?GK1d &6|gƑKw^_%<&K|“n)ƣiƟ,/Ɲp f0<W\_A;hyW@ÑLi:𠯺To (Ԇ A迹o HvA2o8"_|t ~YWKTAOC޹3\jI%zcey)ƹt;&6qR v5?\}cDcgOKw M3?3DspcʵKf,7'PZwɊ,nt -iïMw}q1 оhXwo=qٰQI7Z:VU o]]O~alēQZa^^s-=˪x7:l(ջErMx‘mA8}B>nLd|u4^r{ItVj*A<V K_۸*M.&h] =>}$ @ao> {s\m 3@-QrK{s8>__>5j9(qT'xdIXW-ցl䆎Dnn<Aiظg$bFFa8>S9#dNai?\lnڥ9R)1@0Mh|_#gb1ݐW`-J{I}{\fǎWS$1_ƎJiun㰼3\pU$D/-wQK)rQC~ײcr1_jc}/}=2s %"j$`fH-K<^1!Yz¦pBU9;7 *юcԛNNA!? p1Nq=P5)ZBձ1 n0\Y;V;.Dz,"u|~ᎳD6=}Vc&ı?pYpѬFXk! {T[[6Cv,ޢl׺(i O]ч)Œܔ˾w6v 㰰'pw+ej0wMzooJ6Ur$$×|w9)({Koh(*huR_sq:U;[JFf$izn?vξKH#k@`yHYl]6@R%{?x^HeBfiGCYG1 Z1Fo%x3xe%uyp| ]'xt|SZ2W-=I'RN?'L3H%78=BL*eyUUxpE챘oK%{E f}X-LKdtPm"mnu^&\_,Nk 8K&޻ecL+T;lR}lܲ*1Tel]w%MO % :4Y ^Iv:hCQ3?;`Ix&L=9ѡz`;|R77vdy<$6bqСWr:z5, f1[&JAxf7]4F9Wޝ#Oˎ0 baZM s)BZy~j\|Bx\'m}(u#\nW֠D; v;ӻ6^}{ ;@pg_BdMEf誀 ߛpvonji1V}<6E3,FYԹ< MMuxUY GDÄZ!@c hdoaE _ిG{ +F$\2Oigp$#tT;n\(`Tk ;LQb`]jPuȠ^l>H;26+|pxE|/= KSd~%3&JM\!SP?B$~B"UmӍu4S]@7?P6K&pj BjFiJ0~."z55[G!2 mT,?ˇr6`kxb^`Nb$- yJH;h#- ax OLkI{sޱh Ș'3l壤_ |D@6YK)lԬԀq/C`{òP%pʕ^nQڙ[!; p4ZN㸱zxhP:RK{D\03ɵr]^!*`fW .Թ!`6M HXq3Ϡן#¤~JWij.GnOH@$c )9'[-~=r: QߒT`#"VG9JxUF٪GLww۰ȹ7~|-#O'x\6N :ib&hͼ|'}7W~TJ#gq0@wa3O9e mtmǜqۨ|3 E᤭/ŧ&ТZpȔ =26F3h2+R3T^S[.RpX2v[3Kb?>sw钡;FKdhO`~6%wZQiv,|ًik11~1oګ2{ԜlɋwU޺tacl%*IhyeZ~,;:eUFR$ҪD'Y ~:ww$C1nT4M-3 dMJu q蔷 Շ_m;p58ս.%"@kܛ4J)3cwiyd&N*IBgN*u ~.\Y_vߚH@mv9ŧӺGD$V* N] ɓZnUn!v,{?hTorL<[d#FK"V})Cno[ =nZ%䲟_:dW8@׻YKI}@H 6)퇂[6b;\,Dfm[+8߿/CCx(4(F+Dp"^¤Hs淧6!ȷaV$r $(RůgK #攊:͐:NF (}+DufFp/Ghw+_3?Nh-SB7h\Ĥ< ".Gl<`O))ib,Bڞ!Cތy1@Yӥe-D[_emq_)>>H7B,hO !q}3%фBJ+_ a05J:^TNV]Ϧg5Rwt$/! _2ʨ988 z~Ӥ5Xbqt`33MVH '@;@kZ%R0DwOz`ZS@rJF^j*?^IfvVvK|VU`$Z1J+f80ĶywD˶}]ꅲK0irs ˗kqҏ)OxBoCV%x h"?>ǃ+DUR9#lmvGɅ@+ncef3>kfR&T"u왥?Pm IcHgÚ *nZ p;;rÑ(al A=fPH ,93lan'oOe1\zs̤܍ ECFuHKHE6-MQn)Z}͟ñ%I i3b=H  1CC:zWaQ1 j2^FNE{BځSGSkJAI9 4솋nzp3N7^M9'{}Y{kd{ќ^w*CTy (F{! h씳 C7)=3nPS-hai/Q;_T82J.!R򊸪C7[&6j}lDP)"[}Ezy=#V[ZzȯZ1 BOD0!g(s}rskGy77uyJAP#Xn۪ԞnvN*Ok,ISu\@2`>] )@>TM),HކKp` kB=\.ga;YrY 8sp&uX|2|s .ة7+[>U͵E MoU\tXQorE{mC`vPBG=wƘ#laAt$-]g1VT-픤fm˘߬9{?TSҽPr7LQY0-YVҡQ0q@XoO7 sǾ͐c|SO؝Hg}H; l$ևbWOt{Prݡ6"y!=)$Y+ hFalrrOEoY ) ;kfj4 @ ?2Rtf7w"bhܿWK84\`Ɵ)yh_fN9ɂ3U|*&So/(9s.21TxzѸRYX:v8j+Q v;Gp)># QvrKUBD_ xP^Tҫ|V) mn#|>1-ÙyX(":3&E)!8ПlԶ%L*L1k~FU犲y@[{ }mA4Wfag+rɿE{-D7WB>. >^Y_Q^/Rگ[~|ߔP9Pۧ*2TE}Gқpl&1îtQf-ᘜKXE-0DLBdz"Y@" v,-ܧslt Z O X6ltfv½nNh gS}(?z%L+D#N7lkv_aLc$58%7SV-WgiA2Kx ' L.%jhIl^C%)d#׺yN5Tμ2mT=4}Zm=xf\K\nf];2Uo_ s@f[rA3s=%gP3.`XkC+R鸏QBy; )V+NhS?,fYo c8}UQKrUWlA[D,Y<ʙtK.s,s|9LIaDwJQ m{pj8AJ: D0DZ;j4>2/sO@2 L {ےdt輪RV 2O 9e O$ ۙ!-)h].[*, bUˆ :\unb]ܶ7Hi.nT6&@dd9HaeAXNۧ;*焚=fPbҹ=! f}^(_&~zMDP-S=dikZ6FSKjƽqnP]]'?#NE7$(fʣ6TPӝx};.ٌz#EHc('Lr !᎔'B>0 YZnlme/data/Phenobarb.rda0000644000176200001440000001015213615562454014520 0ustar liggesusersBZh91AY&SY|/LB0$@0Q$H I& Idmo<@k3G>$ZJRvHL ȩ3EF)z24=AhA7TmU=OPڀ@$**ʁ 44Ѧ  ɉ2d4ѦM"MMP=@ =M@h44OHT#b!F4MGF&#4 fɑɠhLTPѦhzi4d4ѣ@d= i4$pIYXTkED!G=멚c򷃕NC@cBZq$d`|B"MEo7V`PTJM@)@C3c@@yxs'\zh4*ʔ5K=Ttzw%םBU|5fP:rbzcr|X!p=;:[T[vD K-pocpr@Ǯ.c/2}a^o2~NĹG?+HG9ixauǴ=\+Z3oZ2)'H};PөOHbBɩ?RXZЧR:2,I_2!$;>]eaԝF|gnnK?{NP^ѐ+JId];#fP$ yD"lSSԱDr"" "*]N!>Vbf"(Hк EKE!ݔ⃂ */CÀRd_[2b=T K]!d ) 7!l`"@!t".D -"cZL@* ]bY:D$ů "dA'!t'lxda c*3XCXݐʹ3Knr]Ik$\Z ٻg(SMx,Rָ];cEN,>],hvRQ]zw­!T ͪIKM’ RrSQ)Z<^N Q QxG.@rG9!H" `8ݑjOV|SoLZL"%AEL$omIxʺ6#6xꤘ ϗ9\.y~{fL!5gm%o6Z詛JVX/<6k/i2K:1clr\Ls&TU(Ic"$ *Bw;4 Ub* TQb1 HFU1Q U0XT"[j"[c#!YUKVjB N *"ȑ!3 P ,(AD "Jh ABRbȄVHJTU ZIBTU$Fl!Y+Pՠ -i+d*(0Bf&[Em!RQ(*0*²[ZUZDUjE8@";AbD"PUűA`V 8wfXT[(QB*HEdF c- N$:yaiْ! CyhS&LaaetYϹqx0 a2I0!DK_:@Z2\4X) @b bYgʧ=^";^z\D"S@ ;΃Eq`KxkL~oy6mmmVkw+S>w1ڶi1ZI$UTI%ZI$UTI%ZI$UTI%ZI$UTI%ZI$UUWJV*͌e1ӧLVZI$UTI%ZI$UqʬRI**I$RI**I$RI*ԵWar,8kUW>kT$JJI$T$iVZw__qn!j`;}S\\ˎ#K(×B0ClNR΍l.%]mέ֮a%ZI$UTI%ZI$UTI%ZI$UU[kV݋bx~.}+M4}VRI$j$IVRI$JV@JUeF**1UYQʗVUWkÖ4-u>8nt1bŏ<UUd*ֵfTbUUeF**Z$_2ŃWqƠsM4}Vz^vTUUZֵʊ**ʊ&YRec\qiZ{Ԫ**j*ֵk5UT$dL6ɓ&F0{;9 RVfe,WWWQuimmmm 29BH ˆ6頝ǐo110&ThP 1D$PB[HED$*k ه$NIXCXp蔓'L韑P=ϐ3y?E Ta+bKcs9iHD aHc`H<``EQ`*!kHq+$TV@THd!P ' L%F E"˦яAC B9Ă9D'3̊8ʽ y:uJ[%QBD U&0VE6̱ +lV|]b T8JwE\-ADƸR&ȷ qƈٹRbrM18TcZŌrRbj6.Z$ĪhTȘbTV-QZ2ԈZ(*%r1ĸ,EDb ٙdDF#ն%Q1kds u)g{srB*ޅ{,u.Q ϿQ{89g@]|<]oXq8%=N*롣9ɻh)CŨ:p#(38JT^bI/@svK_XE̬H,ۃ#YyVn4 l7z[_9$!R0TBsCMP95S"PlZma,j:]_xuhQE2t`:(~ZR67/Ntס@ k{ȘDl1h(DQP3mł+:qj"^MY2ݗlFijT!t5ܾZjًILv6鲐Q <'ļfnWi{4-8ˍ8х07 ֠afRIYĔdY,yYum m3 X(k -%d+Xk dP1La h.Ь(ݳ)5@+Sn+i5X)qR]u6kQSu7 ѹ_yylRO^ZݿD^:lv/xB)?{13= u=K\:RSsr$!́ A^CGާs#;'C)NSӠzKǥp=d$EV* b1'٭@BH-%ݏDXr lΗ$s,ۣUvX9f]Mk&|i $ cUi_Ltm%g] :O#{ ID#мvW,̦^ǽGw~}&0Z5a! 00PQbF Td35#FՊH{jijAEQT}$EF(NݞM|bZ쯙.;c/\:r/^߇܇-ۯ_o~^C7.~:a;~_;o?sd=YRE~؃^GiF9_iSuNuⷌ72NpLNgu8鬏fFm;C+&-c{SAb^[jd$oI^VusR_zxA]S7/ivDld?;+3Yү|Dl-k7][_4Ѻ3hQߘN|CsNJ}nwPw%5XeFꨣъBz$,Mm |osX+>2iG>oHˡ ^/y; b{LǟNj;y!m^w:;QĖBb-zf43~+L^/y[gXdcukkɸ)KU8g.rUP7iW1Wof"{0JQy1>6m:[B}9r\'*yjg^?AENY錟;3:s؞u3\ xNƵFOݮĿ]7ףbz>bee ޞsYMTph]CJ/\uO}IQx 짖0ӎL0 pJQ0c8Vx @-I@Nj{@^f<0 0[A ` sN,`1X@9P[`)@nP :P@#h+J Z*<` V~ mvA`hwqi'`X6` wp[6xl vGcq<O3` sy^/e 8^Mp;]8GCp  |N)p|4"B-?x"`oC]ROi?qژ&[+ʹ0`?v ֤c]zL]lvCfgِc }=A=;p_%]9Qm&"{Lp%Ƴ&rpc`ՏX0l Y!VX Nt*/*%蓚tm})J6 rmP'Wۜ¿nlme/data/Orthodont.rda0000644000176200001440000000171213615562454014602 0ustar liggesusersBZh91AY&SY= %de烞@?@ Ǒ1sQh&#hjM=A'm#3%4T dd L *P4h4iC MbA&S5?T OԚ@hH $Ds> Y6@zhr@TG̎"ϰ`q ?CYZ& 2e˻$ X-4I,Ӝ*]lVI;NX'|D#Z"+xl֬yRkEQ3|Ky ˗SkQؼj"=점 I; {Y! AWa38vmApnIs$IN~?lٸZ;X.ml0v[oK+Zre-e͸ў|HQ{i @)!1HA F `H2$&m$Z@uto͋ G$BH)vay2SNf6vfO DDDDeILe8_:{sUjBUUUU(N!mjmP-nF m5 mjJ#JTtqP2"E+ RbNF}V@:wlx-6řhJa2yz$Fs>$y `c6a$V^ݦ˱ڜ";cwbjC,(kn S}OKq_RŶN 0ee3J&ȑ@h8vU:B%0;"0-cj6@21"Xfbڼ^mPǗá:KDW!tL,˜Jw$S `>`nlme/data/IGF.rda0000644000176200001440000000342513615562454013232 0ustar liggesusers͘YtE;`LL PobUH2$Mfq]]pWww]qW8|oۤ&s0'_ꪮ[nf ZrV żXyVwhnUe^-N.F@םH 9;i sQ*fk!0|F0,ba$ cT7r܀VvMjx U7'S(mwwZl辆ohcTǪSzljk{=X'ɖZX U΢%~0Io u yU*2}=/Tmc~sFg1f[OjAizz]:_hkv>ȦHCGj7Kds<vdzTsuDZ|}\ 3y\gcpC߷O澧&g?_NDYPŪos4~4۹ZEC=Cmx>4k6L>i.u*Wً6Nq#>f鬒k]"Ҭrk{bQT⎛\[~qq/EVlq?m}Lwr:O띥^G9}f5ǕD=>/һiyD:w->Gۇ9VvA~3qwhXo wPt}T[i^CV?Q?/GO~Qm_d{!~7Yǥ?@+ ߸6יv]a^soUKT~t/[:^Rqj{suI_t^Qak?>8/:N_oȰ7|.i79UG<Ï+OoƟງg@~>] ] ÀdJ%YdXJ&+٫dZ]IF%$I2VH$ّdIF*ٻ2]2`*8 Gi`:8ǂ`&8Np*8 lŲj@Ԃ:p:g3Ah M`w!͠,p8Z

欋p) \WRp5\ ׃&p3X[6p; w`% !0x $x < ς9|>O39_-|~'3 ~?`ly{V6uVzMT-MIJfV˨ ֠\V`]kƖin1tfv={MN̫O%D?VHgW߶wUr -efl23NmHŪ# WUV *0T>H?:ʜ,,.-l-5]ZP¢nlme/data/Tetracycline1.rda0000644000176200001440000000135013615562454015327 0ustar liggesusersU=LA[8~WXş9hI -L(hYX;s{(j쬩՚Z[LhQB9'f޾yቁD!dJCZH])t k8 i[CI?B..dqyd1h.f_.l$ސ&Ys ys?qu0x#TK[>֗|ֽWݵ݇pQoZqEI{+ŕPҏs>^c*y$2z>^Qz">- g쫚竔 Q\[zR?p, 5\);M\WĠ"qM1SMk%M2}V qi>j.aq'}V q%E0PH*^GGM钩[>=xD%t4uXl3䚁ӘV?)dS,+chz}8$;8 opp ppo)iY9@7`.zW̩TtR04K f`w3ۦws6Dl}#lݠsGh߿EUkΪRGyCrͩ k]R>nn(:"F 9)BHV -D&D 6x=~!1W磞a}go߽}wC)a\N [Goxmnlme/data/Earthquake.rda0000644000176200001440000000434013615562454014714 0ustar liggesusersY p,bT(*Pǿ[cbR^VD0l &q *>:鴎:Z(VĢFdPe!֊008V;?s_ӆ!鴙9s|uE@@KT@Ӡ6-Kfs-ׯH^ ڜa6enWžaJ`1|ƈA7c 1FW1㫧88gr2퀒T['2_2C43b8D}\DN~Q?:H}abQ(RP~Vu3y bkGѧs9YByyW!֍k^^*<@je=yj|/kC`mJyfοyIstpF?@B0jFϤz;K/5[{ӏ~_Xtz'Я7=s[ߦ. :3Cǯ+?kt>{w9l[lУ>g/ܭ3>G:O{.Te^/Cz+佶o|Jw,;r<{fM];QeoV-.My׾ N=c< f;Sy5ȳ^1q ih'úqgGlڜlaL9vrx9yE།|S|$g:s?4S6&GF*IҒE:zrwpa5zC@)n/#7s #Xv]NGwq"W'-ءn Oz[O`]7R"@\6עO)O!/WЯo;a(NgstN¾s |yw{ގ>|ezǒ5䔇mN״ɓ?C災FҏA&97ni+%ᄷL)]X Gu&2lOћaĜ^KƖ\*刦\2H`g>llLFf37LG醠2 4"ӨLc2diL ZD"E5%3~_l7a08:)Mqh*,BL1IMLRXKRc]KRcIj,A4K,A Z\QQ1ّ(b"{LqTLzq֋ kZJĹV wAk@ 1"!F%ĨKX\=e ] oCVX/E0䊄CJfT ` [NH! ?$$> I?BO!IvH A34C A34C A34SLA34SLA34S‚*1X׋)S;A`ŊOb%1F~Q]śE^GѣQ|NὟ\LA%_$ VT|8k.ts>YёjMJ72O[V*mӚ׹k~xs&۾-iC (*>Y6.5I9{i{$yѭz~3ekiʏYtVc ka9iHu6n>2T6kͤ=`*n [n E*rY`9&v+"nlme/data/PBG.rda0000644000176200001440000000147213615562454013235 0ustar liggesusersV[OAn[Z.^*LZ&lee.ٶ(1@>h1&F;0M1qognߜ9b~5Y*3=Ccj(t=jj$TE9_"<{ׂ?%_*ߍ8UVM(&e4_Mhզ%Yh&oICgEHA;ꕐ&beVs0xU H "i~k8Lb>8 `Y9yE8\E{ 5^7}p & wSНaB4&(saB$̐_ ݶvЯo;`!+ a0dF$ZnMeG0w-'(QuEQ.0rlf<ֽ j׻*gusc[^mtlu6xt}cnꄤ!9kal0tw۪ƤDi>?}z{{ַ+Ij/Ot nlme/data/Alfalfa.rda0000644000176200001440000000177213615562454014156 0ustar liggesusersKpG!FaN`SJ_IHĺ"ⲑVVVJQq\3g䚜9 E ;;#ivACO3=]44̌&)+~f}(GQC}1D3{k={)'Z)}CbSvYt%7RKSfz+NBUXhe_NqZ.e2EL  '?CM9ы0}RH+dL2Lʴځx=lrnˬpswh뷳_o-5Z_l۱A\ܹXm6e߲|B[#~^hUo0b:wn~ o&ͷ1w{rGؓq-9_?leMFv|(M%Zg?߶m2e&.&yɯ7x ErSѓquS.7N2兒>Kˊ}Qx vc4A ~4.OgπgA>σ%2x ^a`#uxȃw{(x88&$`jHq1| x̂$XI~b QXvȿC#Kۚe )W{*aTmwOf0\0Ar ٯVAMvPWMlmM}B:1&,JIb>_8t©9Rz0ŒIzkIg?Ï}aj~OuL`cj:u~+*肨7ゟ%3"[s:d\C8ffP*E*wEsn9ΝT':H]dSKXg0ijگi o /^8;uFi  9/aׇNO-zy90!~UWWն\@M9Y9IR1'F8jY 2I54(c{c )!)MgyL-^gDဳiy %Ӄd$eP5m ZYn fFt\kM p? 36WŰIJ _yϺ2(B,|H_+F@ dTI:b+=$©5F$0{bV\ze,u Xٲ蒝ɉD^Um٥8>NqH(MA_(Ҽ$(quu^@WcP-BCmILn/Dʚ"m﮺o-gCCr\qcM<&`dI,r(WO50I]~ីi{C0wIh2pӂӖц w~,2?]'j1ћC!lf[ d]QoEmEJ sG4J6MSnWd0A/ɺtå!~ܧs5}m$v/VwF(0ʑJ@nKQk 7;9-Y$ͫ"+r4 z}:X.'`>l+\]bȖX)2F%KǤwe6o `a!v[I\Td/.$J#)Z]*yu̻KܘKo R *NAW<4miGVy)}Ld1χ4s34 M?8zb)ɉfk۫i j-~x:^SAyvM"JՊ|x[U)'':OOzP`dHB/鲲O|1Ԫ+ *ƗA !05գRL3fiS DQF>blz\wZnB>8xua"?X'<%C™tk,u&VW Kqϔ)M,_\>mR.jR3}$&nԒkM{~Ti ǀSK:/"+)"C\9@9ޖߢ'7NSK*ng{!&VT>ywK (xo!Ze&uBY7)7imݫf(؊$D!s@ ;C3ue;LXb\X{[>eΞK{-c8wW.c_|mdM,2/9q3ے݁BuoZ0gD6ku^Q)%k ʈJ͕Z&+^Ӂֽ/x~Ptk7W\|;(l}dߊLY_~agPw7-q> q F!-ܳHLsFohyg&(z 윍E8o[O*eQ65`8&]n_SRcOH~QIZyDZjZ$$RC ^8m,1'zτ}t K&tC(N'ɦU?>1L<< *z%P1RIԸǫ*+I@,ˍjSFX\ԗQG4^ZJۋ!w$͛[&:^9ht\u{7/O`5n]l>ωt׾BWN2MTYs [(' a[#:-*7;Ƽ7JUrCmD _VH́U_䳽A<E /l F'[B =Ml! fh#CG)rZ#1hVlT;5jk5Q+HH.308<{fhۧw.D- &جw꜄1=~6eJ{W9͟Hzh¿ߨqd]}:,I2X/Pl+<9o~3:*fKThpQQ%ZTh7]t99_h\z کU j/>G#t'γPOa[/~? /b=.`35{MjsM -Bc~?]7.GD>̒oKyʕqp mH);cBBU)iCtڳ@V- (X@Fbܴt;u؆ޯIJuyMA]AK#+lAh&z1LeQ~pqO\.NP<>2cQiHb]?YAN N14u8bE8$ޟi5o/J?y~]/h^-(0v][j0=EY=qq WzNɢ 9Q 7zbA Q=u`U Y3}|9YF Tz|\"wbfbĨWHpCBk㺀@ٺQHdmqqȃ@Bm "ѳR0mJ6TV2$vBL-mJ>et;,6w bhlRH)3x-00hW qidQ `.x^b'~V=%!!3Ntd'qGq~]9]j_e^EO= ,Ƣ AK!ienr/HP2mF<¾$%,Q9#S_ʕoxs8Є*+*XvBcCw02%cR_Z)'Q%}s!4P/@}>.ݪ؂OEs3WC_]?mA{ktEpf זS*:ͤ R?<ﱅ^ XչR'o.ӻ.԰ V'+ڀȇr=1WCLٺ8Af#] Va_ӂ>}R.LԳƌ/lw:9P{ s:>`o{6J_8E>.!G=MNZa6qH!Bs&d wŋ}nD;k=Q,cO4= M~7jɢG ±RGA5KT`k&!L_a/i}c 3::dKđx]Sl.mF٦u9BQW~]1׌f^E?gx tv7k?Najs{? T+=O-6l V5-؇8Uڳ¢7eB6Zrҥ5EjK2u 'S R6N%_ KE}B̍?*xIOV.%SWx㝈8z*K+7URGU4PA+/VEO N7jjV+$q@0^@nwg#lc_}67Y5J._#}4Tg)s!مvUE׊.q" BP~YV :`yFv~$#;oyzo!<nKX,?lSnC/|- xj3$ ۼ遻5U!s^DcQA8G>fkm~QK$@jTj 7ǚ i庝tث(*6v~|H //v'\Džd3)l[I,Z$8Y:eX:yw71(f7gQLDK&&dُxƳ*%ظ~`A64ءCn&)Gdc"4VTό;CO,5hc Bz9_EkAY<|G:@۴n@&[P5/*:^8ǝi,>NUvb6lxMXLEJtatJ#blC8.^L*"x FjY=ٷ9]⹁7-1踫hLg,֒4'ŒGS21aP>lt9?#Crd$1$r4ԺcNY3f3#NFO||ɨ:gHAc7 mA>w9/0"4O[ETy1^t-\urоw=v~5dA&0 Z}*nD'yrlOs֫8O,/sơby(er9_=zzٱD+ 0I;`&nJ!u'T+ dO"yQv ;,*uF4C0B@$-hea !7؍w,WWjYq-~O_xcR\#lL'?kQBvBb&Lh&6Ҿy]*YP\%WD-W^#!NYW0&>ׯ*8:ӧhLql*Bݨ@˂ N-CZ -_8@=V5:qY:_z 셨(e^XrӦl/^{e:"˦N-hg^1 {p:x 3";C! E0 A  #N rږtceEXd4~/sXzڞIR)-f!:ʰցp2բ*rG)JT_Er)r6C%? 8̐o4kNv[+.2S7S4>N,gWGQkYn]@!3Q9+OfY;zӕKxܔ2M%9)IwiIĒѡo)Sm@t=ؓZ` ̚=yˣw,[4,P‘_Jvc!ak] 铣ASiVXv/l#{ׂ<`U0ӒC ;/M47oHw]ðw/1bNLfA`0z}K6mE>+(al=Lƅ% m4b6 .AEoEɻ_>Xeitҥg7<9xH?(%åzgl3=(WY O#7x3m=fp+6{CuKQ:6vrzph]W=aY \? G{<[R7gdxn- wJ繝eog/>K(? wAl( =ʱ"ҺnIוep{DcJ }6H *?Ȋtލa۴vqX+gRrkKIl Gn. slį׋6ӱbF}2'ʼnBo4BD%ް 5rB .!PL ,\:H X;f0FZ2z~R2Q,x }t0w88˨&%]P\ZbKD5yJ:FyZOR$ẰLFdn$z# UJ[okkOauAسޙ鈙"4ĨzS+%8\ -r>L+a>րJ~~a3tV#NX Q^*Nl[$ScxO÷> 1ii$?&~S)x Oken0u՟ʭF!QBNK Q, 0/]]tv"jdsE:4@c؍ې4}}=_G%@fdÄ~XGy]7#fl2 +rtJ_dGEgh UgOZ'W|.uY۹>' h#;9IYJpٿ^yMA\5<X{A}p>0 YZnlme/data/Fatigue.rda0000644000176200001440000000326213615562454014210 0ustar liggesusersyXE=cU2%CC@K' E-Kee5ԴH-PK<"4o>"HMɌ<aþ;3탻?=|`x3Y""e2H$I]$"E' EN"W|oGW')E"i3Ƹbp$vNvrS;=f'WnxO8:;~2YHGǝ^?+B +tc VfVN KKԍx)Bx1tVY/%lb:e,8BաT%2'y5Ȝ)Wf5Jw 9.Aްd[L_"d=Rj6\4S}I~}8qo wi Җ#Ë[{79"Et]XšUW+;jZUdx=d6<fo燎3a}^>~_t_cWZ/?8,svlA]aqXѼb͓0'%gs܄q:yg?/vze-Wl뗵_W6Otꗭ`4y[Wv':~%yVHErXvTP'WR=H)$QvN ;3=;c'VS%xZSZ'< 6v:@G|@W@A !z "^9 ^W zC ? 00 "`8*:( o0A1XPB&Pq0ԐB"L!iNɐ`2L0 -H00;.{"x>Ű2X+CX U1jXkA > 6fKȆ-mvN0^_C|o;8cpNI8{ȅ ' p~KppA>wD'܄[p_p A1i.#CT,?|E/c-i㐢y; M&%*cz9Xg}a%Y,ʾq:l@Ziu Ij,0uZl[i5 JF})k՛KZe:@ǘ%je^{R-׫^ \1K]cvbNœXa?wNҨ,XwJVi5q^uWU vxnlme/data/Oxide.rda0000644000176200001440000000152313615562454013672 0ustar liggesusersISA{-( (bXdSA(XJ^d")'3dѣ\  V)f^'NxJS^w~6mn2dDe&+2Z@F2)1 A.y pHb4 3ZJ#\47/;IIv@e5DC߃iK:'&WƸ2Ε LrepWQa )Z&] jLz(N|TW*'HNgIc$z~ڹǂ#9,O H 7qIx)I!IоC3/$? ߑ($K1,ń.<&G|-=k'0·ݪweOPA]͸ܦem3|av2Vvѱ/ԜT5z<@TB-*Σwg?k4y.q$ Fome=_H]zM ^Cz*q!]5C[o'hGhJ˙;!3T̶w\*N*jϼ]o>@O9lB3m:CD켋=0JtԎĽ{ WY*,?819Xy+flK/ hYC ǝ6fI^uj`,L82;nlme/data/Wafer.rda0000644000176200001440000000770213615562454013673 0ustar liggesusersytTE; HwLm^uYTdS6GBH$C͂(88.((" 0ʢ,"B6YD̻["sgsGrM֧_}~E])6-ޖoOЊگ8[-YdPVnN͖JDRlQa_ JhWb4+_Mլ_ Ji%I&)?gtN~Vrc+X!+cP"B*-;?$.-r%VV}zxl_cؿ5i'fffgh7!e3-U`Wj 7~sk?`X^cz5kX^cza=[!'v{Qju%WL{tg 5Ko_PwyɴWڗ#0}'xm,1PRzjϭl96_v=⑔i=OJ/o!2Oʝg8w G;AFm=7o^}ZS6KJyo闺Y;A6i}DJ~ыW<#_rk7Lg5?ժ3:5ԓޤ/KGz+k=}DG҉_l~`?[;y?{}y]wmRɮufĐtr01y qz{Uo%OqMZ{%~Pt(jOR~3n<|n5׷]jҚR[]C5KXC:L$X#p JM<~smzQEc?vg-t7Z[T7(ticygljōR ٍz\{gZXSLϩ< ir7A_ ,Wk)v#Ԋ#ڹ/mNk2nv!y>ѷO )tV>Ϯ, %׎$j;$[*溨51/w 4$kVR2rIsm#*0"!9͌{1jFN#g)$5c%Oꉣ_-A?[5~#rZrarW;$vwIAU&L}9m@iwLj >. ̯ug}/47|Vϗ}!"rZfFPONUdʪTrMwQ8]~QYָ{Q1J&/}Փ+>R2 4azsڷl#>GS4L;~:ux"<*1)~W+G]U_kchwi#vݏ _#o5{|VGrmU+orl=U:h$2jeȩ ];C7:?`׿YknnZcO灲2H:eyu {-MOZ2C{ Ig*cƓydSyzfW0¢#IV6K=Y<M9~k?m$%iïE=(z؜+毕<>'>yAʋqF`MoQ\DewOyvjĥ6Vc;>#Ǘ0)ˍ@R+Uw|F72o9:$sf"sbZiy1(1e{B Ҍcu٧]j4Z x 9pJt3>VNaV[-kHs77)ǍS+پ芻1̻Zvo$?곚~ ERAݦ_3UuuyIYG-?)w?PU{ gwX妣K/ˊs K뵙\\`EM|!V%.JQ RH¢%`  &L0`0`  .\0`p `# F@0`#(A FP0`#(A FH0B`#$! FH0‚`#,a FX0‚`D#"FD0"`D#*Q FT0`D#*#((Qd(r(Q F1"h~A4?h~1h 4@c1h4Aq8h4Zh@ -ZhAЂA -Z hAЂ@ -Zh!B@ - Z0ha A - Zh"E@-ZhQТEA- Z(hQ0% .ap K\0% .ap K\0% .ap K\0% .ap K\0% .ap K\0% .ap K\0% .ap K\0% .ap K\0% .ap K\0% .ap K\0% .ap K\0% .ap K\0% .p K8\p%.p K8\p%.p K8\p%.p K8\p%.p K8\p%.p K8\p%.p K8\p%.p K8\p%.p K8\p%.p K8\p%.p K8\p%.p K8\p%.p K8\ᒀK5M>jYXУ]J7RFh⬂z_4-*.(Lϳ%wV8:vf>rP *eL)rX)GrT)Jy9X5YP&k:"6"zUg2+= 6V&JNrrt/?yݷ~6zK~^^M8&deVW⹖ؔ?)Y9F{SIVr\_qF'>wʸի\?'_s()N8h/r~{;y;kr˃gƹIۼ_;{x:$NS};ϸy/q|qeI}+p}~g(orm_wI#gB;8ѾU^Cn5σ K`/@ ` y= 8^ 0ok$8D&i0De`gY08x'Ad%ԖL`ҲIEZ艬TJ;zR zKʾĤb{"5M6Gj>􅦺# 㫁!\)$ 8(.O|HPmDBDiet x8@peH#an!JLj5d]u"3V{l9 SEE<*A,|!?oztܵb×jqz/x9<1gΫ i2Zzh6YoeN}v* efm?Zv`w:&@.mۖKJ?-{zP%2+m#>`V%>|b_sZ,9+DfJv Hg/˵L/츺Ni.#T9tGtRxޱD5k,se V6%-%,SxvQ=WkI$<+HK %W]yj(+p$q?f~IO*KB'~^j78sº,7KcìK6Ked6vᑏxeq2mBq~cGlCe>U#tH[$jn3c," E{]UZΏ|+ETxX1Ogy\؋&3mHaq26~I߼36ht9Mj)4&Q@0AF6`PcP8'{K wa63P%#1=h\'=C+Nf6ϹDak0@Ϫ"UVLz֛ < a$' ce^~n޳LPL7Iq𔱏 d2UvhgsHOy}q T?њ[5 t |a'eYwhlfV-6^QKWk{n"jc &4&ZUtH=zL)m?H!c!zi b/bb#QHjÞeJ쌚QZ i<6q ,0tPP@.9AUzSAuĘ P[v.מXlh9F$f/GU3dkՇt۞c.[2r"֩ <@7Z `+/X S7#3!ةo)č[ZN9C@v*_cћ-rMV!mW⩟T|PkAg-04!T.(}s(kb4! 'wr<^L"'A5i*  r'YLvq5;;X ]q%ąyt0f2r2e9` F,.;)T-#% {PI2t."g?V^)0xoL"3xG8&)p&`~Ph&21h.ww&^ICBM$/Arhlv%kza M-e"/1o:V+8[o.[ˏ[تÍ,+sv;^S 1ֹl)g-Nqcyc]Z|վfÊĪ?|#6.wdA.:.ʙ`S-ׄ&\|SS+!4O=d1_l{ F$jdf"4A=o7{s\nrXV84 |$&G% QpĂ-?f< CϿ(#q<<7#冠LzT|p ZYٚUn:70^%ARu'G5\iPTM-?l{A Ks P;%`7,#`$ח,Adwj?( i:rtԲH'z5='էOzB+(z:|Gp:emډ'ٹ,54T @2]|X>OM0gIע hpMmvg}\$;v X"{#zO~̅4mu(Jn:$)0qs-Jzt HgiI/0 ]xӎJN\([+&ܯ Ʋ0,(a'M[x H\{2&6y6+C̩Ze؇88zȴڥ6iBaMg1D&p Ԉ:~p Q__F> O[!)+l/k2iZ87Fvp!,ߊa/vͩ V_'zj&k:pu"%7.ao頊 zqmv$='-وV~;2T amzr'YUD&"V 5aahɩY'xhs AyaJLS8#S=RxJ d0TBs-~0_Ȱ[WGϔa# b0+ۃ06tLݷm0_)!PWt=B[gmjI_JlS`eyOӤےAm#ǒ E.,LiXY)s*/{^oR׶~uݥWtAO*I4%yMVrDGdSl I3a bE–5qwƚktWG s(/E 'hX+zA)խ lA%H{>tcBA6?Cl/$' Z1p8qj95:~#7iܮ_90Z)|$e6xRm9PW`״%]LmѦX7>i%3@>zSM WcV~RG4v.ęM|CzI(E;g4< 89ƕ>>>L9SQ9+ͪAԢ{}yTS-f9@HmG,f#:3ZnCI ,X7 @*ɘm BȭWҢQ AE1lg*\2PH 0eF(,*o'8ֿO-xW`pST۞;YƋs?X# {Mt8C؅@ ֱ ORP Hվ((g=Ng*X8"T8IKfGN-yohK=.i<_ c?-aiq1bBӗi4o.\e!G 6~ k}#r cT Gt Ѷ#QMΌ!cr3hZbXQT9) +ǎe kȀs>͹uiv Ð]!uŽTpX~ZAD鮊"lXne L1%iƤKυpE~E2":^F|Kܓ]ȖYY#LjdաcGUg Ӳ\ʫ-귚j{*fY-6!V UZ$a}F}Cq\fŚ;}$EneM8?v؄˵:0>',_=k:ce9(LUPm\u6x;N5*i܈1xDgg?Zq&=to><( 녵vQ910ˡ:()"y7btp L`ham៕]_q=:űI?ȼAK5v>RS O])%9L&hJ.t;THI1JU_v &aˌ9 ?=jETT+9 |'.6S  H6z 2 O' F39T);LFdjf|$ku4r(l3t_7N V4Ll"7 Є-RK)onp~e] o?~`iR4wv_^a9'"]i}l}OvǛ{35㱯;:D_߉lz jYaUpEX{x}-WR_cm6+ y.fHx/ypY`όBQܶƥJfQVzN ):(ѝz|k&~dJu/s)9Kn]Ȉgeu8S!SEkd^YqY{3@ܜ'ɗRK 7O/7@x!XUn7XNjmOB@R\]Οvɯm݆rkb!㗠۝zJ)>"dfv{>e[Q,͞TӌhBb3H,\5_ްr9e4'P=r/V=9߁$AhCh60a4kPH'6zF_{ #>##hϸ)e'$i^j6D;GbN<9e*UK/.H?Jham̝v~<õt6!5n.5*~鼲[ԛp)z򳞈L]saK٘K58##uvD;VOG*!zCtS/CXDQ[<#';RLag4|^pV\) 5hҫfw)0H.vLs+6#Inbd iX:k<^75?oT׵Y}Aݳ]UjNP$lQyh"/~8OTV$޽/4M$s~(iddeQic[&Do~Db8O*Su )d߭L Ҿ^"ur߇j~âwƣ3z˺sS".Fu#~8z@JVAQK }=48h]=&zBC||"3T3Ce{$ڠU]d^ XcȼEX쎾vil~8kև4aZ%ȕ;0fI{(ʠJpf'8J4szUcm٫QE`uR ӳZĠ5p^:Oln~ +CME!-=򚊈N,9D8E}[ȫDB#94QJ>3#=[nA_-`_B.J$b`0Jwam޲T̓ z8Hw~MUb+m|\@q @)7醜UWڠ*+K1/erA54̂ ذu 1eD<~7~o^Ư^‡Cd*Rc`9*?t(^,*+4hie'"m h)N'0(:VqF>1ߟyũbb1S0mRjmlE h6GhI:~Tޞٓ&ֹ{MhxD[܊s只& ۓyID}[%Zߐ+rB"ClJ6#%񊻖b8Ư,[M#g9- "dSxDzX"AF>"x'Irr瑂jO2UDdEPX#~Jͫ/ -<# ! `)?@8 GIUHٺ qۋl#A/;9W˷%c[%7;˶ `)̋B*>R;!(t%,cVt5-~irQT .H->l:o{8<-Z U$2_$0mI6ː˻5坷X6"~mMF-<%Ȅ3,r< }[loFYelOHkyt0{?rT`dbIl[9U;jE|k\SU[6Tu~1dn3@FhADxfRg}~j b- pmo3_>NwzhJfj/3 ܚ]5)M0Hh_Ee7 blJF)_Gu+dmﶚ,Jqݨ02œ*/M|&,ru*=zY>1p͊j'Mug"دCvӍ%uIs5MR?$:>uξ.k"xM4_WFH; My{5O{b#攻Քv{8лa(.L9T:: ldA3~6=EP+h1R9h'} R^QSg8a&s0)'i$S&3ٴnU8!? Z(i] qRXߣ?OS ع 㧟x){r%x1-9USMj7iw@x$"\5LsZ UAVj趏{/0[O 6#8jBFQ%gnE%s:_TaO >+hhk)]Ҷ빋#ދ;7"6}:6䉙~Hۥ/A,J2TlHǝ.iĝE~(sOeFAXshoW\lٮe]K57QN7Sg 5ԓC[ҝ 4bXN&Cm;0 z.O%$SMFyaVPX˛c#?RS4'ݭb|b!9\p/5DeuI)7ٿ+I~^OE]8%Ob5N|Fβ42bͽS\8ԱKi@ M<াYcH3, ?cV R'Hk{x-tr*?K߇laJsnT6Әh71u2T{rJ' 1p7EC2tݥ.D`Azh.w7oi+8H.?9>M/ڨ嬺g6&EuF &}3{In`8XAY= K#`1)ta#*׬|9J 5[9r3˪ `-R-9l6׸6-kIH'zfiCD C#cIWA7aA& tw` 6Cmvr#plYq젊{ryzgp\ =KH K\mLi ͕XlVs<ʬ^U`GUҘ{٭73MRҁ;Vf~zD۰_hUzeZ̄_SvvՖ(AG$9y^FMV<( {W3OS,z3 mUQNh<;!:#ǖ<Nir/yNtFH='iN8v\X@lYYP.Bq\Vm'%":ei4+( #CYƭ|Z!:҄*LS{PKY+Vu!{S:}Ƴ:G3ʂBiJEےDi^C;:qqggގn@vEᅉeOɏ&}<6F#`q"*ůo$Š=.(9 gYmVl7dΉ3X~@C-Z9q*3N7`/=sIQD_ p ~%m|%6 |oͧɖb5v:/5 ³xwH{=N%-%a#DhdKUu%u`Ev" * <p(cyPMeK=T}"qd"UHGdRG|fmVKp&vSt6ڛ́Esa'bo`23$%apysoa&uzb!/SI# SƎL8hb:u#t =$CyKb_S)c~īn ȂwN>"/ aW KR銢l*Y`W&s+r9pb,ʀ*!yh'oV*_kFVQU"U _e~4]>G:6§ M݇6V\Mc/I>>cOQ"l~09 O·|o>!t}&==uÃGAˣƵSJb*"A(Iޒ9;R ]b :W hQ{ 8z xEzp&>}l( *;HDiDi]83nNg!xx2f_>Ұƾ ,G7-’@m1sKz/XTOipC\Zd,Hg6^8]@{b 0!+QtWX01gDTE#X[בoPeyi'\aQ\x?yh"A /:_uSӆG~&;"ycXO @9-7:^/Vlν&WJ4HbdF~$sir 7D ֮=>+d nڅc{J*K=&,] ,A^i=-[2xiao j7i~e)g\?P0S+/1&T]K5z]U i%(yaN~Vr=ܶ;CMs*FO>-J(vx!d8,Vo) 50P&#1QLkgq2|+}-@FWF `oLJVkCP j?Q} a1M5Gl y%:0Map,NԐ9A#cKs4'Vz"p8rZ۾[5 m&q<21dBBΑ̻ۛj!#6t~85P%.Eҹ@9whv^"29ѿ-?]s "io@JB[OQF6ѨVЇ8X $=f _^%.ymFVm  }U6$xR[Z?Ȼ=/w;XgX s qGd˔>¬j{h"Z(,Wxk?~3GB[?dJͽU.t҆e, Y~-GeLmd)"0d^Ri=-3MZd+F4V\̦yNiw 80 %$^`>ji=XE[?O# !1L#S$asB%hQ'ʩfczQ먕V1kVR] FszΎ:KjuFʁ X<H (rR Ά){-pۆ$X"Y{ܞ7ѐउ.ƩIDː@/0Z'fB#*4 B O*j44"KAe~I7'cYe&nq~rz,^x[y^H7aZI?A9l%S4?L+[{yK2i퓢˙I/Q_=;BrĂLZPp+#ʊײ\\(q#.r'(?!oذpI G㕧7VUw ֑ bYͥ9/4 &[Z$weMVp>#v%[k:)$5ܟ2@4@mǖes2$`(CSc_L~WMA mGiS3LVM8q;Lk9PP1P2@@Nf$/?mo!;(aE?РWُ~ApaMb1~ؙumҖ-yQҴh"Ɨ  q=Yoڰ#,n[~J@85=߽[NxHGkY6c uQ5G7d(q$EAg$kX{kSu+m ǃIgI[_(jNrf/k2ΎS[eévSl7> DRG)0B8 \$^;CVʆ6 +'quov/ *'M`A逋ig'GK}unΏ7()GUsQnTp#ZEsa LVM5#ľlę'3%D+L@6lP($Ac}\/Yͤ2Spș?Iae ZŭM{g( ]jƒcrFx*:cšf;qN8G7Q[#YzZUt [EruzExiwa/E 4ǡR` ?*X{n(4?_5n{(#i@Ybմ F%s-`P-P33?!gmLB([T^凗pr@LtjG<`;:=>D1z]"3'/$,>q8o TT@k]$wH0\ ǎ68d*#*ӡK7dĺxg󉡏_6x!䰿^Ard ڏ[Oy"\&*/_+D ,*qV`eT/_dKTvMo '118x+KHV4|(maGZ$GpǪ?n/A

Њn\})4Wel)py/O_&l+F`VF(sc|8dbq£o?UtN0ɟ~$-oCOK662~7jFZ[Lhҏgw!M2 B) xP)oI<57?Y7&1j z&m,+vdL0;Re[^_a^n5mGTٿhi3J1HV~a_~A SusPsLX13{A_O}9)`h{Qk'gbtdY}0aJ}$ߴ{4YԙG,zJS Ddx/v7 e YG[~I'UکICo&u4:7 a*Z 4=j–y.n5/Ns, ڈO{é*\8#,%nRוA  {z>8re>r__6/"[O$ [F\S8e:.D(¤`),1Pϳ\~lug ;t˄)V/1d}brwa!/gaٶrE1j]%ÉL|BƵ#_s&az]-q*Y* |.l+nn%,v@~z1Zt$/;?ч{XB(x\4U@䈗[j4'm!qX m;|J;9M H^kP2Ta T`ZaQ(hL:i-~Qc`KͶ(6t_]=8y2EOng)(.辢#v ~f,g?,Fm.R 7WsN(׮@'㭑$r 61it2P*-HWݟ%)F_$NdM6,2wãөxsJt{tM &93qYv; ˖;l$y !NoNYCrNf6]bx,N2GZfaIbJ8=J9a}vp!S:+Na ݸ1p&~MP J^R(&IZp2BCsuə֚ZO(F>>ҡG^vsWQ`Q=MQVa9q (0ӕ&zкSz3>Mh4L/II}4S_>aŶ=bC1H>Ϗ:kB/Rx̯hk% m?CX-fjw-qR#i}(nenA^[șц8 LdUTbpĊ &BDӉ#=b^a<+#]-S~ #亂(Tiu3ޝ$aCWp˷ǟ,W{~}ȩ%Lr!rچ[UȬ)$WwS^"5 ZiH4FY=RK0.pa je׬&Mmemv4UdC0O'%M(rqRm ̿妫'v;5,9pW>V≮]2)+ 2|NsݼA chGC" T!V]vB&֦ dd֑h;>tB(r޹H Sۋd/R56@'DCR:_DJ]zSN]?HmfoQf4kwBxrd uǸ> q)i9uQ Z-Yo qOXb:3~ ctHR< M}; 'Sҿ}\$"t]Ґ sMy+ioz nwB@?}HtDD 0ҪO}SW̠t:b?_Xz*d7#zʤf^'68XʯԨ::MZZ@wنLh[a߱ޖ)2$̾MC?I/.OoԬ{{z ^L Rj`l '*˞sB4$^*llxKИʊIAÔE-jjFPu2D*9_`0(0v @W}amg:^%_!: pNr/O-$ґю# {뵑22R'{poLRއ3/=L]9M0()Oۤ>ik 'w ]C)!y.Igb1Ur]|f Qd*nhHccILrDNVH]>zuqΆ#iWUQ ['1͹? T~;X 5pxH1['P0Ӂ+\bn-)vsOA4c8 7VVxklqZ eԪ9FtxC\6(X_iŲv#xKH3{hKk,S EUpCXHK x4 ]L ^Y}2ƆHABĤ߲/];`Z. +C}WZ̛~m\mzK({yMSXlfwu6?鞙5YOl.ӷO\<co 6Fg]igDI:_\X,̬k"Ң0hMGKx_9tpi {U(vf&Wa b'Z=x`Z2)I/j8 pt) ;N@W氍T-Ga7 Wj&ZlU:ET_ƥVjRjhͽ-%Uq5fE\ֱ&X'(rt(I$5ﻐ?ƕK[ B $F :i-d vUx"?.znmFLagu^ ?'V%75ξBsAV} Ul X-WMi/oVOu2vݮt报*0iW,2p T c cb%C}0< ǫlx4t_:~'oVlỸlPQW{I1#{])\6f[QK,<\ !6S^6@ S`/:ҽTyJ8(ۣtk3 zvqG"׫o?HW5}v|k*U M^F ƨcYOu;,![&E6~+JK nKMslmzFOylpFW-Gg1K #Sí%0tMJt &`ؤ/ _,+m,7<4+U^h:o8sWkI{^85V#ѡ&ě̾ 8E3meaT7^[h2 E57T##ubX0ٱ`ˬrrAАPypIv>{ע;Ճ4u]vnr0{<'fZ[8{0y d4e%9 Xz;dٺ-8{vZpnNK՘ ;hb0٠r(W3輲b%'FK&hly֓[ [ߗR.;e C OǬ8ϯ:bdͺh;yƽ%: DŴNk2Qۃ5lro4 Ic" xlm7I*o&+&X'F @~xzMep;ݼFp#ĂRy$èTq[exFfwLd{m$8n*F\fve#EvMûc 7ɿ#j,o99؊AIΝ+"K Pc,h&8۬_W QA[$=[2H# Ly/i^2k}n[!Z;m,Iivc?}:5af`"[cyZ[%azhɿ X&VC6T ј' i=hv6O(9zuhb:vt li:B_lDw3:K_-(Z餯\= c*bz8]_v?X G<<:p rYEAqH>_UPleDNU{0:L kUbj/Ì鰁~2R]4~by˛~{WjoIz;:4)i#oX#gbz]^so> )quǞ ڈ>rA h6ET@l-G=b&K’Jɺ:[mFD~Z5VԞPɊ8Vȷ.]Ζ砑bôV~̮&aTnݦUsB I׶J!U $k܍e^S;,pq+ FX~6*3.E-&;-||?rEYGR8^H2'!&LfЪ9)KXTNx _9q\FHjm_c=(G,yI u}\L^8ǭE\*S!ria3.򃥆_;l1l@g5^yfřWDNgE3Bl/%ڍ1*fSixP>}7U5Qiw^`$&u!@? ,/ !§\t"- 11"''"c;L 25$ulٰq Y|RaWո3^{crHy(K1՞(MEO#D!'()?1VLJ:{/K'b,RIggtWVݟZ#`G}r\iE2[0u^M:3}Kfػi:x]|?ǒsJ$b 1dL6#x,YsƿZ wGl"u&(?eɔ҇.܎>2f?NŪ`ov.0 YZnlme/data/Remifentanil.rda0000644000176200001440000003166013615562454015244 0ustar liggesusers7zXZi"6!X:3q])TW"nRʟKMd[_;zkұ*9 FNeWX jbْa<Z?0* ^ OvQ| 2H([ r66ˤaeFǡl^qٷ}vs~;FJn l6al&d'ݠ )&..,Wֆ8):%Tb˪^%*'/c[EFcX/s~X]l-JxY  %Qʹ &k&'ok7'kK8t?/:&3d䈸yOécSlK_!Ү46_soəi[6-|4"[D|Y#@C u묞CUM @)K,FCI@%)ab;`怲H@]60}GHV 2wKr^?A,"8~+:,nEC5~Ҷ\eaۈeiH3=AC 9#LMN7&$rdublC1iIs4+[$X5i I%_^9{Ri#"Rg`IqCltIBڻ{igs tbvVθ`ʰn7!Qҋشۯ W03yH {b+@]b.KSt(qt*Ȋ~ɦBs2^ݵ q.!ߙA7|Ǧ6X'{C;Q |Q^W1&F@~n!*_%"mN+/ƵKXTt#d2ɥI*n} '֡m2G@th|^Vs[Ջ/#(=}I1Ji{D g㯀TqTQsyMqYOխл"40i cNHM: z&#F+/SM+~mڢ~"Vbwa4% ݽJ^H,m%N$Ć4d>ue@t<"=?{RyXܕU4"K}MC m1ʃj{<@=ȣ<*.$ z,=6\N(| j؉\OSU'LGR +!D2N*ct7&y~l`#P2bK@uc~$< sC-ixfYaeۻG>%ϔJ_5fّLmҊz7c~n sYAkƅ>PU1I㝚 ?U9vW Q[$:'f5 N~drQץ͌Lxm]C;IpwH$4i5ڝF LQl(C*w~vַ} jf'8)xy ڒk#$$ J1يVTePH-hJ@&Uz=L Ð5ыxpD22}z_K.[ ʝt] >u#f,fe/x ki`a&Vm+L}^W6uk2=%ћ7'4uD.T@ #35d(ra&ͦ$(68VY}4# Ї9Oj{B5>J&1)EV iuEpw p1"v;"7_O95.RQIK[ăa;pWғkvfx+".𜀧UFHy-\| £+(XDY G!]xa[$@n:R< ɼ|M;t2Q#`WO^ HXV[V{Nkk\y+ {cd^?P)Jהˏ묈& JK%zÊFԄ5*9'qJiVGo.@լ_!hh_+d_и'[}dچ)[8f OkiyavGP}RE\|f]ans mPD#3$S?'Im5Uo9Ͱ[}ن%I;lhjz#5wǽMG퐁Z{*[ koK;U;$ygaqq!@8s_֍bi#>kf86%#4mTh,^frkD<uirYrd̡l) "W|w(FL/;\Sr)sMMs*|PC瀾tQO9jJZv=d΍P~Թ|l] XUH=g3T]lO}os0Z$9ezlz<괣Гl^?,1kpV/}iMuL؇vM6º/LaО)ۜ|U$ O =S/ f7`{Glʝ0hʂPZQΑb7I>;%?k)) CTˆ&,jYDBkxA@Z35V'G9UCY~lN&1Z[S輛J|u8(*Q `8f9RbH+*rs 9Pq)#85GeZ\)lC1rGZ=5' Ht4;k IW&'9AIԥZ+WL&]T(GdzT-S`I;"ua?&O/:L"xG Xfuk9ńJYH$yO a K䭂>Ȟ;&~@ʭ{gU>{5Ŭ2`!2>7ߛƍLgdD)HSdȘġԦe[|IPyuݘF,se1-Uǖ]n+]|8 +3+uV+%m3 f}.s{!86 q?hƂ9FA4W%u0ŀXo[p2T𨕬"+x$h-4242jԙކ͕U8+y+Fj(MN#xCb/1}[w| x*2%G#/{V]]Gnʦoߘ͐#1I˥e Z@e>xƖz 4W<R7`J6[sz>O# @LbӣV3/F &~ΦgFbo\dqܷ30; +nJ..snhj ^\EU@BZpRۺջB:(I%8Gjd^%SjGXhf'O6L[jX=ܽ^9s[,& ]g^sGaBp.R1,_Y?0I((ۋla/ߛʭg%L u`G f%p6 :NʛA:<&(hIuI܇ӊ ɔX7`cm:V"xZ8ܳ\=,dĠEK^Sٖ ヂp::|^TuUM$_hM抳R29ְvrh[ B[;I7Lw>OM41( rsd^j'U?*FD Ax?1)Ը8A'{jB­[6;^q5Ѐ ^RE~3'%N%85۔^~sjM_RB =aC2R\9S9e4T`< RkFߕ&-"{QM;}%/R:`+Jm*%a3*wyRبIp iZ6wyNk Dyԋ\pi$L9T0 tͲk־7.aq7GW>iRUaIޫm/i=KDO$vemj U7á*>Y@LkIf`;B D^ .gوPk=?{1i\{,Qvv piX%Y9?Jț" i}%e8|gel)NPأKt1OX,(@Y@+3R͡3_|#ʨ)38EXuG0cZ4l; a:{ 2:\qnkh `P^z$ soٟ6gŠ$D­>32\q~(P3mAQ &l @p0A.0խ>z.8A B+QNb> ^@ ãg盈Ƅ&g '/^ .jCvڐ= 4M\a6o'F&}{de(QȬß Hh;e(v#( gC0!"%A/DaYa{jIP+qH7B[YV(݉8G -Ue`sZxNgqI`eWzn.ޜ})rSg+n'B,LxۜsfMȃ] }к)Sqmvyw;_ '{BnMA1!QYq.a V`, BL4;A ru[_5ĕvjYmgPD罛<] wrqI!نq@6woTB8uuK{w+8|9oRg>/aCnj-Ce01[}Ȏ"}$+-]% &I5\?5WmX@HLm5AuS_+tRPB&A?`BmS{?|"Alt*6g窴EEZ~" mV"n j$ly|].0m9Q D(* 4thu"t{ȳ+խsWN J HӗgyQlT}*^(1?zt隍0ҙ 5&ԤOfw!D5#$^q鵮wVhge`6$szG IAx[ }/ % HDžP:K$ؔ9Pa8O\M4QG0-@PM[Zi{B$3tsR\`٪B4hP V!i[8ˬ. PiS~P:GC5lm Xt=SBDyҋ#C·\P:Ǘȥt:2 e=z}e[?Z$[v_̖צ0q2f?/eCd|W@bFHde@_lU| iz,b̢ŵ{|&NEmRϊҮ`;cLUX36bapnyrZ@"]7]$U;YRRFE@A?@74*1[3ۙ{4?$CŬאr><(&b#V'#|OTz="'B54(¨0{0=,>p3E'-L"w07"^(zAP9DSEm|"[* pZ*ɏtg#3߷C$E95Bl5\DnRdAQ^U[}^n*`sؑqR=UMmI%\ǽJQ K 'Ql'ƿP@ԓ[ckDi"L8D*dM \+PҌ)MH VbAN>'[f4Qm\MgowQ.qI=T`l#6#'CPS?Oy?%v͠7aǔR+/7&B1 cLrF:zlOf܌% +y^Allr{"t[¤0[1?֐Q>F) ] #KEMd g\P rg +=F*zbY̟1șcJ ktPlr] w1Ei#Ӗp1y/N꣜zZFfbť4F2vmʗ+3.2])ul] 1}NRmUT=C#!.&NSrs93EF\<A%NS;:LÐe!|TE4Si&EH9N&g@ZGw}ʚ]«cQ>k,/hU"|yd߫rg[.8]|Ԉ:Di b~}H8z!|cKOq4 /ԧJ=AvPh!-fz᪅ lB`ev΁+: W~V39l6qS~A'~:J {CzFE('}+CqI|z8bpzjCchm`Ca'H~u]0{>`2R :^DkjO~VYjޙG366P9-s>zE{EP [1uT&]DS(qeNI*|bЎ5=zVƼq~w]ց Hl B)؂ץ̄lA0= -񗄘 \}drzu?x\*#Jf2X|砮!MD~VeI?BMC'Mg%D,jH&Zu%"-~VjN$&{?hf^a$@چ*\G'5=~@hv3YPukR[Hh?э× FOfBd^a8zu%P|/Xm R[Y~3x?IyDA %Z\?RKN"dDžovrYSn5o6Q+`NgNXX P" kA2$(Xt]ݠ3h y爒]]GqCkf[[sg#X6O-޴`ݮ; ~2bhIؠUX]2l-ZG,lW'VzA4b$féف˜jl+|C|z.\~qm1mSN2f-N])G蠒*tʁϷ2}8#kP?R2䚵ԱL.V~B~te؈F-N<;c>b˜wM/K\^cv3w3i]Lw^kl꼱Eq{yPjp]W1Ap7u+V{DoŊWNJJVUlX>}}4em8(8_h#^W!rQ]SK"!j u]2?EH1}Ho\Fmndg0=F<\x'B[~g=%őEhM[$⏈x$]-߯u;ĸSh} ec;w/X=q''㵇dr(᷿b}1nI ' c9TXF*-6YwP}^܉n''p4m'b-p1O~SQ h 䫣C`m-83Oyc8Im d9xAh D0g7VMiͽ._$=ڡ&bclHT`/>s6 |jwQ]"qۡvQa! dx Wy :kƔ5Gl={h7q g4MPf 8PJ¨LCb촇ʸ iqoUNJc%bmbPmP0bJ#8& xY޼@dʟI6!Ce9UPN~ֻD4XM(`FOl˴,徱He|rS'FuK=L^zkιS"~7 1tMY^ksC`B<^4[Č 3hlY\oEqJHyS,K?T/s H}[=6v-YnH;A䱙I#\Rκ0r).[' |'dT6KIdp\oE#t^2p{mNc[[УJ`iAopܕ'd͌rImObl?*ubr|!*TnIACȀZ (.ݽhLVZ{(g >0 YZnlme/data/Oxboys.rda0000644000176200001440000000374313615562454014113 0ustar liggesusers{\lfuch|PfQs`H|UB!ĕݙ07VJT(ZG "( E(h(J|ݙ=[Զ=w~s~w~s+aTZjTkYwS1oY:;g (kWgLVU%dM 9Kp 9 J 9-!'Kh )!GJI%d[B/!GJHT]VtG:=UѪ^+=J;JwR S,bT*hG,y(jJ*PS2==Sb*g_t&y0tKF{dA>4w5wdgIe5}юVӈGq^3oßC oD"}\Z>/>39o [~Tn'c>/ٟ^륰ub^t+qGiD#zbt_nGc]O >Saoݎ9 ^4R گ7@y_X3:^ǽh}-lnİoG| wq} wm^ 57kqbuy 8&ο O~!KǓWw%ƾOG8Jr{qMpɟ~^sBx=~-o1]Yq6x /yE]DZ>g/ľsq7že]:>_3a~Z/Fqbŷ@?A܃<Nxs_p.pi3 w`:_dht{CM+:oFЏh]ązſ:n*G+K0ľ%J➅"޵XG} qC/+JJ|>#/W2rXaZW~ibՌ8]"tR9e*^+ep&!=4Ïp[ ]NmF?8bKSvHsr*,1~KPʓ*zJSj,vxR(P, % K0,aX°a % [0la°a - [0a8p# G0a8p + W0\ap ' O0 _+;ugkSsZ)ZLVhvZ.Z+nm3ߍӂ\?nab|&\Xpx;ΌoΙ>/o .?Zf$1_v6Mqcu&7;k|hx%nlme/data/RatPupWeight.rda0000644000176200001440000000461713615562454015214 0ustar liggesusersx[Wߕl'v4i%;jY6c#f)4&Pm5ؒ+KM&lh٤@YaCвi6 -٘}:~D;νgc ۞mbYV 6@Ն(jFd W:~I~deWZ#X.؉[џk7~v}N޲[T7vCm&;44eRp 1Y'=|2`~gb#GT7mmAMKmтmүU}$^ʎ?CDfQ98)"\_%r%e)Y?ueshգZ):;$GMI__o)Z서Rg=$ȸdb\#e|D3Ӿ"Ҏp}($crQYrDag^؎!ĥ_BH?8J9F#{\Y?J;}cDʾ"ˤ\=n~yWJާ݄Ezҏئ0<_[vNcKڽωq\ N?>)?۞^=zɺy#N_\8<ǎ²ϰK8'Y/$eHgm"_؇y.4&(1q/'I|0~1F>%e{J0~p|y.Rp~/tiL`{~;n6}9czǺ>91чuu5O\yV?s]i43?:rnjE<{lȏq 3rR#h4d4e\]knp<|r$ ̓>8'y%yrO̒.Α'YzΤDL~VVJV*L/eXf>fL̐1զvtDu5M/cfgfe1~Sz)X KJ4񴳞viz}jO)ָidu7ݍws7(KҮuջ]WUssW^rZ+)k;Ry(_{|NZyOP.<\:2sV.=u';NurPBSֹ:B8ɎyznשC4?#u;މabk(H3/~> jU&򓼱yRɗM`bd7s[\e,_xR5ҮNkAnjIyI}e=|ɱ3EV-:L$NDꤥN28K48n@?b;~Я> d@t jր<`> :l&@ `\ .[x KvH(<<<<` <(a3F(EPr-H `'&`7\  3ss ^B"bR2r Jp  ׁ77[;;~.n^>~A!p|||| |||| |n____7WW77wA]=}C#cSp  nm_?vg;(+++++qC'j9+++++++4+++++++.K'u]u]u6]guz^-WWWekqpZnX(l,uJN.-pc. Y(#zs楪Vɳ0;,*cќ7ԝ;Gʥb-]Ҏ=-|̰,X4utS]mrKu\ԏ u6gpy6i4wJfn)W~T.\%=^yn,צl[!'~g:5)1GALR44u쿂0U{_KWN]&k/UK0nlme/data/Gasoline.rda0000644000176200001440000000150513615562454014363 0ustar liggesusersVKOQ} *hIԀNChb)v1r?D &n=Jb'9=;}ڌ6CJ)#>kfٖR҃DDc1f?gcjg/ _)t/}8#8zSeKNUP9+/gײӥbή0 ͗|.YuDgrCVS܋J={ &r$ܻ(Ow]<&F7FTg-+EGB o9kG - 1$@THYAf#C@f!sa?7ʭG hSS<!KUja`MaPTnxϳ|S,6SoJq6Z &D* hZh4thh0`@  4h0`჆>h჆m9Vq~" l'16Z*< G , !/Y|"^Xu /{o}P+g_(lS2ݽ(*n#@C''"ITq VhT@]+AkcݮsūԬBRg!i">@ֿX/T:\p xDL] oi ~@W[,ea_?oŜy,qc_<WRnlme/data/BodyWeight.rda0000644000176200001440000000246113615562454014671 0ustar liggesusersWE'YZx'Zc@[6VhTEwdCn @ ޯ~W;> 7$3;;#--1/S|^UPlX3bSӌ)]6ka&]4I R?骤%K4>~ʩ evz^xUqx)䚤?Ieg$h.MNw$?rd?N봈?,%$ <ԊSߠUcn"oxȒ,@or'G9/_@>;L~~sdgO@-R%ϕ|dOJ(](dLEN]!{E3A)Evw%c싔G8utߔ'#p uS,K~%I㲴TK~R'$\lP~ ~҃CEK}G~غokY{q |.hr4.hvA ].>7?_\3]+ EOzDa(€(졂ǶgWR]mR]n3"f/U6"":6R(ncY,|x7WfdŬ5MajR8&41u$d]5ծii[sʘ sO94^p; F.p݀o:`Ma~80xG(>O,*8&Ah  A?|3@,)~p`w,X9?A"E_ x^/W5:x ox #(> % 7[~L'3 ~?uN#0LkD&JڂCl,e McxSѾVـfv?bvQp$ȠV]VWNUUDPFSRgfMgٱ)e!Wp^N\eujc n1sF[8kg~w 2[ ϼ(d1ҵzuGL@U/"g=cdRrfhFL {>OL%#cCӒ7G+Ǯ3kO96sK4w3ն̿ڀnlme/data/Nitrendipene.rda0000644000176200001440000000204413615562454015245 0ustar liggesusersݗ[hUg/MԄJTYZtI^Q)j$Շ2֑Lݍ+ xA(H*Z6i>A77V'9Ȟb]8Μ?3gvftx޷OӴVkBWN+jRb$l$A䇻(дiHscCB>%tvV N?C_uB Bz*{ 1QS5%E }oǽ$ WkNl.H{ }m5M 9й=Xg'8^>q-XPǯߋzNwu܍q>>? ti_p=k>yn-oFg>8mWzo#g~y<Ϩ_7?*?R/uR}wSZ?Ejŋ/{jxPъ^2!SaIy${WiIp:%nZFv;Ztn~U*E/uR}wԣ 4]wȝ5כ6xgy}eIPy3S>E`#W 1LF#eDNNNNNNNNNNAAAAAAAAAAIIIIIIIIIIEEEEEEEEEEMMMMMMMMMMCCCCCCCCCCKKKKKKKKKA?ѝI^C?fwfR}~I[fK= :;)8 sӕG5TޜDg;W{J|»"-ꑰ*_K8Ƒ2p燱tZJK/YMC-qKJ#[Ki7V(K>A64!]u57(SE>Qnlme/data/Glucose2.rda0000644000176200001440000000223413615562454014305 0ustar liggesusersBZh91AY&SY.c deW@?0@ 9(#rOT1U LѠ4=S&&AcMLLсƆM4ɠd2h2̩Jh 4P I=Q16@FB Ohi56SOP򁧔6=@z<j5>.0@ ;'a97;l3ֶ IH,wE/x+=yAnPs:H;$d#$H~F+P=aћ"oeH6V7q`Ƕ#uBE6MdhDqT\q aş4֨o~'y>]-Ka+D$ K'@0@P ISs]yp"!bH w}^S*llc1-]j͘cnXI 뀡X҃*XI$I;pD|ƂU-HR %b5!!(*E%D Pj* X0" XFA4VUEaJ ;(\ =ezUKMڷYV+*pѣF0j֘K1XYbe.T2*NJ|ϟ>i$I$I1I{ڴ)tI+JR:;0&lig՟8e˗.]MOtI$I$qL{I$I$LLkZֲ$I$I%^$I$I&)Z+Zֵc4I$I$/p I$+]J׹Ji4c Ab XR,"Z(wr`J`&a+ڈɓ90 +Ac3G08Js+W (qZbGP_|-qS6>O>Zҕ'HugN hx@Bs$ V=-+i@VsQN gDrRY7Lp`޾vIvnZh}02]Z"dӦgz Wg&^֥ J'!MИ:.GB"Mv)Mx} h7`h͖iwn )JD'hjCptc`|%~~7cͱ^Jj?zx Z\u Rtmn(,]չ.]O2QG(<r tM69)Bd R(Gс#cB*q J FHZAj,Pl$&^5oN,4ܙ25$\(j3BMDxLiR23;'XT+$g7j`RԈztd9"u#YC߄ ʢsiɔ".̒ʶ 1 ?˪wQލMn-OXD9nqn_C5jV%m/UO/Q(ub,sa8Q%Wvu$J[)蕀M=vA%XX :lA5ؔ m5ԃhl 6 ۊ@3h 1)!lvn^.- @?`plil;(QϜm̤Td7UrZ٤mffMG"W|rt/+:0Wkr'ߗ^)-{P ֤LvghU.5,FVIN"!9/ J-4\e!#>dWܧ*c&(: F@Ѧw nlme/data/Ovary.rda0000644000176200001440000000422113615562454013720 0ustar liggesusers{|Tw6K(4XM뚂 Tɧ|9wΜ;gf7sg:{d2&s.-f&i )|P0 ucp=x0#C 1 K?r >^Y,Urtc^l{tM,/rx}a2+G_nDZXL@3,t9Nj]ͫï4^w1kzI{S kl S4Q=}zDͶ#ʃW4̗ߏEh-9ޔڵ7]ͣ^G [w,U&+;g:n)#OykZ+.])OR'k>[PC~#' o[>bȓʒ%]Tnȿۛ[)P;Fq]w)ȋ=Շm~EpmdYcp(Rsc`%K#ͺV64LFmUM5yblC76Q꓇)nZGۇݚny&eBZ<6uޜ3RqEK7ZRVգ>'/X^_[&6yL,n2)orLɎ ArVcebY9e3g0z~/dJ6:t[u|:O&x|v),8ҙsG?\Ɏ%Oku?3>7+֘.Xy{]rƬ?'|X_~,F3uZw9̯qyѬk'/k[/7Q1W`|,˼>t?g$Mc}m[|W>\>|Oc͎ZGɟ#7+3YzN,O>}8Xmtohf?}L6x;=RZ~sx4.!..}zn=(nxjMt * ήQ(!c!|郁wm2Ԣ!i{})1iYTs@+o!l h!h# g DOC mjj"F8q0`#F88qp'ҚqIzޞ:7.XGSŽszq6VoѧIp.";lOT棬7tەH?ZEx^-=QD=yx%ku;]u~i֡o4KoV9_'wV(:=urM5n"1W3 nlme/data/Oats.rda0000644000176200001440000000144513615562454013533 0ustar liggesusersYSA@V#('AUR f[.fReYGՏ೟C]4J~陞IfFClB$ERchF|RDj:­H! XD[DmH(-"F 1S_MdQ[φU2ijj4tjKG5STدBʸtG/q\Ak|6˲AU)Yҭ)aXJJk g?cx^}CޮR7U|Agw|ws]KRV}>O/K}4oIj$'Hf_^,QH'9OE'79^G*W7&9_ ͭ N:h%Or%h=/j}p}R}z2\$(:P.]ZUJXh.hQ`>-J_H*BFhQ.B[!n j[@p8y,`aGP ۖ7j!] `b}Cw},)ly7~RكSzm뼊xF[]۷k}m܏|ߟwj>9+΂O&V=O8m"3ǡNIvσ/OH t免h,Ӄ|o3U?*$Qsok#7n~[4:V23ršY&wRv~Q?.־v imODWޢ~;SbG2G^Jwv]4p`F(T4x1ˈ{4$\Dh\!.u~J +$\IДp5µn HhF&̈́[n#NhNkw!K"( &!N6!p᷄!Вp?5 m :R :&t&!ЅGBW£n?LxBB'7/qB:?_ @B&IBaa0aa(aa8)ӄg cc #d&'L$L"L&L!L%@FN! $"&/^ ywZ63OImFcm;q7z܈X7㖖3ռew8hDFhTaShL|3Oތx3kV`܊-֎qG?81CѰmR_1fĢޱo0mCk, Ê5lCϱmmb8N46º6b˷'x3k91#jj kcگX,u~cf$^Sg,5s Ѷ#ca͛^ʴ#Z}4൮@^LGxXx#1=|h6čx\6c1CX׺b'g|>zmⶮ_VXъ͊eZ=eH~YqCvZ͎Η=R|Լ.Js;m mCט綩k؎Aom3|[כk G};NDS z;zoit4☺S1mEv:_+#m7ǐ'Or?O):o{(:2Sܮ.*PtJSEoucUtaE )옢S@YN;Qtl#RE?}5u ¿L ?_Eӟ2o>gc}[EsKopEChȝ8vǺlطyS][Q[N:Ʒ(:NDܲg4f"_yOyو%qx:(<< ;2Af1?ïa?3/G~C}yП?ŽW֘}Wѱ7~Y>z&@NuлJQ㢕> =3<1M}dNr1Ee.yoNFfcݴE+ vb}]u cfC~╍g9=.~x~guPt"{TtD|s0_Y嚑իe}R95im$95flmݹtEg]Xm1?gl~fG]u-=KRwҿCNӐz[Vi߽yYwQ}ňbӈ2<|` J[#<3O(5gn'؊y wg"yWx=ws-^:we?6®}'x~=e˔~*2cb v> a7ry8`x9=}?O}# yne{/_|+.~ۛ(r׋?aVհ b|^xNe9\Wg;{|q='K|WmWOC~q|jq>}t+@vGu}wE>}m^岉VU[+O^'CW+P/}Vy;Z-7(-Y&]\D<7k7ˣWƲG| >oYk,B<Ÿ^pU~ uPY}~BM DWױbT)y!#y}|5#((b쟝[W*od uf{g[ݴ-/w} =O:P@֏sֽa_H>TIQo['P밿N- T eMQmק)(Z=y'Uȧr?yI3e9P}PCCzjI[><8U:{Nm^p>s\u\۽l>[bUu<| Rݩj?Iԡ߮ϲ\͓{QjJw {*Vk[;Vok ݐ@{Tπ'|.涉/EF*GS疭ZƷ[Kmա] m.]G)mZvLmZKn;mp=}Ț^5p=A+ٮ a¯F<¯FW#~5uߓ,nlme/data/Meat.rda0000644000176200001440000000116113615562454013506 0ustar liggesusersUn@]_$> ވD BE}5ɺh^ǢBD:3;3aәaL7:idd{Kƌ쀼'k@Qos7Qoz &ޮ(b`:{9 %{$!1@lM/&:*qgH;t7rP>Eyr3g((c{߃ceJ# VV HY(ȴ I ̸B4!*Bl#ڈ"(sqn>t |XD:9#wa,&f/p*^t3MZN64rpDS;o.M}׿=o&6ͤpgɳypp pppp p<wPv߈hCm'ܠlTT/ A%* Vn^gs ǁ%X>ܑQO{ѯ ʺh)4v.R bާCbG yRzDmJn+9yGd|nlme/data/Milk.rda0000644000176200001440000001023713615562454013520 0ustar liggesusersBZh91AY&SY#nrRnD?0 @ C?=7PV# ;xDDC>T4((JҞ)h#CF 42h4z'DICM4"Hjy!0@J*zDQD !ML!=FM $di:vlc~>1 `̙ss #!n+ٙ-X3(\Y 3 4 &CH (t@I["+: qP H*p(B9OLT4qU| s~.O !xjl"NqN"kGAthDt tvvttPTմ6q!u0!ֺP<^$wqOO$y8687wyBݱ^b'}"=gs<8CD=؆8^xQ޴qdCW:G(/ sD8 zB=HCXCA箎w@\C qpWG D7 s xy&}x?Wotc  "^"-(  fu{_ӸDh"9 X"*:[y{8}B!{6l3SlSk8_5ZVӕmr<oH ٷ:̰ŶӚz@瓣q@V XU S,Et*?KeRIHI k,%m! S)"H($IIP&KHK(I,!%4 $$( RA$]XKil@EM: vb"(HX V bH"`T!"zTgYdO[OsC81PM*t6jB EH*l "AvUBE(E H,M8?ʨp~#? %W8pbݘGiT"DPE8)MukWG`    11c($Ih-[DmA 11ckW     1⵫pI"I$pcc185Ui`/y$fUUIUV"I&eUZXI$Ui`/y$fUUVkZֵRe~dEc1cm}mzU[}IUV"I&eUZXN$Iv{$2,E$L*lE$g;nle{9sYݻu`+9s ZUUUb7릚MtᤒHV+DR c ZUUUb)kUUUV1UUUI(*x1N]h`yy$byKCx3(+Nf>:/&b\ClR{Smg *n_YQ9~hqNvޓENCH MbmqCIvca}'sMrx0޼_hƘڕxպ@76),y%U_HSJӭnԡTa$};w{s1s{P<J5: %%XҔ)FрoS`UК;ڕe)G|)gn%mt~kPfQ31'<ޘ}HamgºGa5'm7#39׊T\=٭[O SzbjM+\avק?qݙ,Xlnsmw]ZdaVsq^n4/ʏCCĭvm-iCeyhk'x}MC:f2%-q9p&mD>)[Jz}cUPlJvOň_8dȁ U\5OTpogۘLZ:G8":K a+NM<=KM!N ח p=C4w_fkʱ4+IއokwD(ʀrh"kv"OmT;=?,z]%֜]]4uFMu^+ $I$I$J"\Bt+-a.:gH(Gl{H:# I Ȅn^# D$BBȸEM-IK}8zH-wNñ0DpəN`b!$!`t0X"Yf$QQMv`Ҽ|_TJ&5wR9+1%$Qb1PJ$i(HN]'a>8LyF͸14D)(V*^'Z}Gk y|w vp^h=5Pz֖G0Jd.diE:<X:73X hMP> ؜ lB%RCH"j@C PYdR$. 38C'e49 w^ $&!I LU ovGr;Г&pc{]15 Max%0Ks+gA@:pf$ @@T[@pEpޓv&.f1H4LF6YsN#Ta5WTȠP';zvboJ`N0; E8.k$ Iqg9~Pu$l"C $=@8}$t#Լ?]BBnlme/data/Machines.rda0000644000176200001440000000127113615562454014351 0ustar liggesusers͕͎0ǝMwB'r ݥm^XMMVBXčq-hq4Mġ,{,Fax.ɛw}D{/LŞԥPȔ2im)jek_ X-0QQQT G堪:Fu           2d8p7Sc1 |yϖ.+;Khq4 &{eEp'|˴j7Nqfk<"%}۞{?/ng.{\rC|?,Ra,\coLqnlme/data/Rail.rda0000644000176200001440000000071013615562454013506 0ustar liggesusersKO1g.H<{ԃD^$놨譲]C,ci$bw;-˂7t:v[z[ۑM!SI|)I]JRJ)q21 VUj5iiװa7si1DžOE\Hy׼D}J>A{8TFM4pu9_ḫxS12SR"A]e=]]aAp&-ӜKBI+/K5Zyb˖T@CC!]6T3T7chО}CsHf+Z{55@ uuQ_߇;x[fk8b Fgp?as2($^.3+S6 ErO{~&K^ c@fM0n6b*I TJ tnlme/data/Soybean.rda0000644000176200001440000001005713615562454014224 0ustar liggesusersT "(@@tY̽OEE,K# ( "_^XcQ&&6kh`0Q3w cy|3wn}۱y +t:+/mt6ؖ2O|QvA |+ (g!d!ePBl,B[[HE `!RB,\n38 Uffefff0CU3x ^f6Cm3 ug@3` 340C}33Cʹd?4>iNiL{ -jRAjIjRT&R23FK,1YK4sl#~{dl&|.?cmL62^;m'nU߭<v*ͯ42r)?m.6/+=o Mm*(wYz~sc1;!cv,7zK-Tyۍ/>m5P["xP6VtaUٳ̅ۇE_~w7juwOy/t&Qז z,Qgv7eN:ÎrQq]MŹ!AȑWV ݵxѩ92lY[VvQBÚq$,57q/Q%A%C^_ݑZ[k"|NdԔe ?~F vK2DmYw䂬x,f~n--n}繏]CY޿3=UE`<`xH갑Xfnogl}cYu?w?k+ъd?6dez]W;{$۷^ +!8,;ǁ~ gz/g^J˗(޿ݳquq CƃS:nJF{-*,CG-uP'#RԔ:S+;vO\z2s7xa.l9LF?;̧μ:3խ~ zA.ݒr$QzY2 uOp(LkߌkVmlڏtp소Bgv\&߯\_6}V۩3;z xa wbjG 7w5ouc+İQ;e uĉcw {honҩ=qI6s?y;rE??ľTUk3_Ϧ~s,_G<Л,J:T?:1ylLWGΊ,OͿؾT435M+JJ%ZMJ|ŎnZx!!.}Ը=Cn(` aXVEUw\'^]sk߮9Sy3BG]^fV}}Wԥka]37wc*A+]-^V5Κǖȸ5ə_ k}ͽ_:Emt.R- ϱϓVhdwjYq+~>$Fge-6{޾h;$+m=W f/nWs/+{Ϩ>9GroC(^2n)י]\LĴK7O–|۾ҿڲr<8,dNB/3p3׉il4wP< jmV=vPn/h/孑V. n+.ُ+nW[+H=(CX?(w2l̞̮o޿LJ߰ѕjhs7]V=aZv-7npZ@d9ZqE9۫iGk8G|1IPֺ{!;ZtnL2r> lkd/:>>d;I>otl?\-~y=ׯf7yk8ns,yw]kQЕZCyPr˃)hEb!Xl,$EbX+Jb!p)!@{;[vX&5#ÆG&%!Nn5mֵ)JR)J+;M84iYFWŊ | #jP:!]**UT ! B)PP@H(@B"hy0d"b"d$ jmU2!wBK.Uy r*Ј4&*GbۗĎHȇrI7z꫗/k5 ,{,FK_8m^33333333333333kZmذ\rY sRIE!$RIE!$RIE!$R8Y a9 -,QHI%QHI%QHI%QHI%Q +mmmm"#1"J) $@@ @ ]|d4R 1PDD@A%TI 0 0aÅmmmukP%HJR~R^)H.,.mmmխ@)JRaYaZV3*e ]1c1c1c=YJZ۱ja o5ܼ((x@&9wWWf/i;ŗM@Z&ZQ.*̭?uQŊܴL$̋9/^#mНW%sQ!S+:*d. Ul!b\lk 4E+z 6-h˚cJ'bRWʟR[$ۍ/xA (3:,=F+-1ʕ\m @ail] 7}`!p8MԵ14^p1vO~dNvvn欓M7f ۘKu&8,\'}9HM榕96iv1~Q|1;{ca0=:k2w;Hocknd,sc*`~71ۙ}9w2M{=s|d-;?.:S[-TR̤-3#Ǧ.INef 8/+O&d~HjtvdF>%dLxxr:L˖4I%2BT2|h_M *Ō4+皦Yٴ< *Z˭^]bP=U]Q(1cY>0Ā.5ѧ5ݺDKTZ*!jMvrW^]4uQ3d4JO$՚NZҩэZIdj>9Y1)8.'WIKJDj*aSʧNp!/;{_^1am1/C̓ \!θblC\Ĵ-OdYg^?d ~ma+8V#uM s?L"|U21J1KU1qzĪ9|'¼G~J_yHHAb=/ԣϼ8Yp.K^\\7?9ne`<WYO#Aڧ=szduQ?G'f滏z!K;!֓2.a{=Rgsׯ~7~799O{?G}߹ϒ\/!!a'wfԃHZr_Ib_K=Fԙ3|C[8mjdku﫽5y?J+ρ&XҎImc|Hks˺9mo~,8~sqvy;v/yCw\ۓ֊+oYkyR֊+ob!3QbqyW{:[Zȭkgrrز]YXYɋbݡi-r)9T')rB`ا2dEިSwdž}*yEu"T$ON<%u2N| ʾzޜ z{PA 0 ԛޣ` c)`L` - ÀVp̂gggg, ́yE3Sv ` @ Իv+`w5p< ^^^ ////WWW׀ׂu M>V6vp   OOOOπςρWW77;{G'GђJK3S}Y .^RST(Q۫wk+k,lOħkyJW{U|>?+y{}?7"Se$KbfB0#IB2z<̓/)J9s~*b8x ?Zg B&fp 02B d339f06%"%lSi JA&fDf\tURAUUU뮻E=Wb"݅v#bcmqp J-V"n j[jf*HCC78]Z5"g>|-UP*PUH uԊ4-UR*PUBBU-UR UT UTiU<gdbnNɇ+c]b׮UT/-UH3"̋32,ȳ3"* U_So s8xqDFB#v;L⫰]6m[FB&B&B&Eo{{7)OV!8^* 2yLU:qPx$)K&אK5Ɏqj͏F{ٳf˗NT!DB@xL32,ȳ37#uOU"{;@P>!wZֱGX9fXfU BժJYffEfdYH4-UM >T-uLNVōZ׮/h-\ NI΁Jrr>|}oĄQlDYiΚ@ŋosË3f͛5i*HӳvAh4"qL¨h`sx5Fi"0-AAcp4hѢS13iLVvFDaep9 aPUU +biw ]Uґ^QUV]$Y Zff1L w mW-QvUKj)m"R"{Ja,UBfffgLY2`٫Dj7b2F$53.ZR)UU3333 6qq8DSpb)H,ʦba@;yw`WjRKIݘRwƫnhh1F)eVKb-"ٲ-)6E)m)&&ffgNknF!BiҚC11.\Dřq˻s x1($G"ѣED˗.lS31.\rE8PS%nlme/man/0000755000176200001440000000000013561005472011763 5ustar liggesusersnlme/man/Muscle.Rd0000644000176200001440000000221112222456762013503 0ustar liggesusers% File nlme/man/Muscle.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Muscle} \alias{Muscle} \title{Contraction of heart muscle sections} \description{ The \code{Muscle} data frame has 60 rows and 3 columns. } \format{ This data frame contains the following columns: \describe{ \item{Strip}{ an ordered factor indicating the strip of muscle being measured. } \item{conc}{ a numeric vector giving the concentration of CaCl2 } \item{length}{ a numeric vector giving the shortening of the heart muscle strip. } } } \details{ Baumann and Waldvogel (1963) describe data on the shortening of heart muscle strips dipped in a \eqn{\mbox{CaCl}{}_2}{CaCl_2} solution. The muscle strips are taken from the left auricle of a rat's heart.} \source{ Baumann, F. and Waldvogel, F. (1963), La restitution pastsystolique de la contraction de l'oreillette gauche du rat. Effets de divers ions et de l'acetylcholine, \emph{Helvetica Physiologica Acta}, \bold{21}. } %\examples{} \keyword{datasets} nlme/man/Variogram.corExp.Rd0000644000176200001440000000377512222553014015445 0ustar liggesusers% File nlme/man/Variogram.corExp.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Variogram.corExp} \title{Calculate Semi-variogram for a corExp Object} \usage{ \method{Variogram}{corExp}(object, distance, sig2, length.out, \dots) } \alias{Variogram.corExp} \arguments{ \item{object}{an object inheriting from class \code{"\link{corExp}"}, representing an exponential spatial correlation structure.} \item{distance}{an optional numeric vector with the distances at which the semi-variogram is to be calculated. Defaults to \code{NULL}, in which case a sequence of length \code{length.out} between the minimum and maximum values of \code{getCovariate(object)} is used.} \item{sig2}{an optional numeric value representing the process variance. Defaults to \code{1}.} \item{length.out}{an optional integer specifying the length of the sequence of distances to be used for calculating the semi-variogram, when \code{distance = NULL}. Defaults to \code{50}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function calculates the semi-variogram values corresponding to the Exponential correlation model, using the estimated coefficients corresponding to \code{object}, at the distances defined by \code{distance}. } \value{ a data frame with columns \code{variog} and \code{dist} representing, respectively, the semi-variogram values and the corresponding distances. The returned value inherits from class \code{Variogram}. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corExp}}, \code{\link{plot.Variogram}}, \code{\link{Variogram}} } \examples{ stopifnot(require("stats", quietly = TRUE)) cs1 <- corExp(3, form = ~ Time | Rat) cs1 <- Initialize(cs1, BodyWeight) Variogram(cs1)[1:10,] } \keyword{models} nlme/man/Names.Rd0000644000176200001440000000245212222553014013311 0ustar liggesusers% File nlme/man/Names.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Names} \title{Names Associated with an Object} \usage{ Names(object, \dots) Names(object, \dots) <- value } \alias{Names} \alias{Names<-} \arguments{ \item{object}{any object for which names can be extracted and/or assigned.} \item{\dots}{some methods for this generic function require additional arguments.} \item{value}{names to be assigned to \code{object}.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include: \code{formula}, \code{modelStruct}, \code{pdBlocked}, \code{pdMat}, and \code{reStruct}. } \value{ will depend on the method function used; see the appropriate documentation. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \section{SIDE EFFECTS}{ On the left side of an assignment, sets the names associated with \code{object} to \code{value}, which must have an appropriate length. } \note{ If \code{names} were generic, there would be no need for this generic function. } \seealso{\code{\link{Names.formula}}, \code{\link{Names.pdMat}}} \examples{ ## see the method function documentation } \keyword{models} nlme/man/plot.nmGroupedData.Rd0000644000176200001440000001353712222553014015763 0ustar liggesusers% File nlme/man/plot.nmGroupedData.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.nmGroupedData} \title{Plot an nmGroupedData Object} \usage{ \method{plot}{nmGroupedData}(x, collapseLevel, displayLevel, outer, inner, preserve, FUN, subset, key, grid, \dots) } \alias{plot.nmGroupedData} \arguments{ \item{x}{an object inheriting from class \code{nmGroupedData}, representing a \code{groupedData} object with multiple grouping factors. } \item{collapseLevel}{an optional positive integer or character string indicating the grouping level to use when collapsing the data. Level values increase from outermost to innermost grouping. Default is the highest or innermost level of grouping. } \item{displayLevel}{an optional positive integer or character string indicating the grouping level to use for determining the panels in the Trellis display, when \code{outer} is missing. Default is \code{collapseLevel}. } \item{outer}{an optional logical value or one-sided formula, indicating covariates that are outer to the \code{displayLevel} grouping factor, which are used to determine the panels of the Trellis plot. If equal to \code{TRUE}, the \code{displayLevel} element \code{attr(object, "outer")} is used to indicate the outer covariates. An outer covariate is invariant within the sets of rows defined by the grouping factor. Ordering of the groups is done in such a way as to preserve adjacency of groups with the same value of the outer variables. Defaults to \code{NULL}, meaning that no outer covariates are to be used. } \item{inner}{an optional logical value or one-sided formula, indicating a covariate that is inner to the \code{displayLevel} grouping factor, which is used to associate points within each panel of the Trellis plot. If equal to \code{TRUE}, \code{attr(object, "outer")} is used to indicate the inner covariate. An inner covariate can change within the sets of rows defined by the grouping factor. Defaults to \code{NULL}, meaning that no inner covariate is present. } \item{preserve}{an optional one-sided formula indicating a covariate whose levels should be preserved when collapsing the data according to the \code{collapseLevel} grouping factor. The collapsing factor is obtained by pasting together the levels of the \code{collapseLevel} grouping factor and the values of the covariate to be preserved. Default is \code{NULL}, meaning that no covariates need to be preserved. } \item{FUN}{an optional summary function or a list of summary functions to be used for collapsing the data. The function or functions are applied only to variables in \code{object} that vary within the groups defined by \code{collapseLevel}. Invariant variables are always summarized by group using the unique value that they assume within that group. If \code{FUN} is a single function it will be applied to each non-invariant variable by group to produce the summary for that variable. If \code{FUN} is a list of functions, the names in the list should designate classes of variables in the data such as \code{ordered}, \code{factor}, or \code{numeric}. The indicated function will be applied to any non-invariant variables of that class. The default functions to be used are \code{mean} for numeric factors, and \code{Mode} for both \code{factor} and \code{ordered}. The \code{Mode} function, defined internally in \code{gsummary}, returns the modal or most popular value of the variable. It is different from the \code{mode} function that returns the S-language mode of the variable.} \item{subset}{an optional named list. Names can be either positive integers representing grouping levels, or names of grouping factors. Each element in the list is a vector indicating the levels of the corresponding grouping factor to be used for plotting the data. Default is \code{NULL}, meaning that all levels are used.} \item{key}{an optional logical value, or list. If \code{TRUE}, a legend is included at the top of the plot indicating which symbols (colors) correspond to which prediction levels. If \code{FALSE}, no legend is included. If given as a list, \code{key} is passed down as an argument to the \code{trellis} function generating the plots (\code{xyplot}). Defaults to \code{TRUE}.} \item{grid}{an optional logical value indicating whether a grid should be added to plot. Default is \code{TRUE}.} \item{\dots}{optional arguments passed to the Trellis plot function.} } \description{ The \code{groupedData} object is summarized by the values of the \code{displayLevel} grouping factor (or the combination of its values and the values of the covariate indicated in \code{preserve}, if any is present). The collapsed data is used to produce a new \code{groupedData} object, with grouping factor given by the \code{displayLevel} factor, which is plotted using the appropriate \code{plot} method for \code{groupedData} objects with single level of grouping. } \value{ a Trellis display of the data collapsed over the values of the \code{collapseLevel} grouping factor and grouped according to the \code{displayLevel} grouping factor. } \references{ Bates, D.M. and Pinheiro, J.C. (1997), "Software Design for Longitudinal Data", in "Modelling Longitudinal and Spatially Correlated Data: Methods, Applications and Future Directions", T.G. Gregoire (ed.), Springer-Verlag, New York. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{groupedData}}, \code{\link{collapse.groupedData}}, \code{\link{plot.nfnGroupedData}}, \code{\link{plot.nffGroupedData}} } \examples{ # no collapsing, panels by Dog plot(Pixel, display = "Dog", inner = ~Side) # collapsing by Dog, preserving day plot(Pixel, collapse = "Dog", preserve = ~day) } \keyword{models} nlme/man/summary.nlsList.Rd0000644000176200001440000000676012222553014015400 0ustar liggesusers% File nlme/man/summary.nlsList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{summary.nlsList} \title{Summarize an nlsList Object} \usage{ \method{summary}{nlsList}(object, \dots) } \alias{summary.nlsList} \arguments{ \item{object}{an object inheriting from class \code{"\link{nlsList}"}, representing a list of \code{nls} fitted objects. } \item{\dots}{optional arguments to the \code{summary.lmList} method. One such optional argument is \code{pool}, a logical value indicating whether a pooled estimate of the residual standard error should be used. Default is \code{attr(object, "pool")}. } } \description{ The \code{summary} function is applied to each \code{nls} component of \code{object} to produce summary information on the individual fits, which is organized into a list of summary statistics. The returned object is suitable for printing with the \code{print.summary.nlsList} method. } \value{ a list with summary statistics obtained by applying \code{summary} to the elements of \code{object}, inheriting from class \code{summary.nlsList}. The components of \code{value} are: \item{call}{a list containing an image of the \code{nlsList} call that produced \code{object}. } \item{parameters}{a three dimensional array with summary information on the \code{nls} coefficients. The first dimension corresponds to the names of the \code{object} components, the second dimension is given by \code{"Value"}, \code{"Std. Error"}, \code{"t value"}, and \code{"Pr(>|t|)"}, corresponding, respectively, to the coefficient estimates and their associated standard errors, t-values, and p-values. The third dimension is given by the coefficients names. } \item{correlation}{a three dimensional array with the correlations between the individual \code{nls} coefficient estimates. The first dimension corresponds to the names of the \code{object} components. The third dimension is given by the coefficients names. For each coefficient, the rows of the associated array give the correlations between that coefficient and the remaining coefficients, by \code{nls} component. } \item{cov.unscaled}{a three dimensional array with the unscaled variances/covariances for the individual \code{lm} coefficient estimates (giving the estimated variance/covariance for the coefficients, when multiplied by the estimated residual errors). The first dimension corresponds to the names of the \code{object} components. The third dimension is given by the coefficients names. For each coefficient, the rows of the associated array give the unscaled covariances between that coefficient and the remaining coefficients, by \code{nls} component. } \item{df}{an array with the number of degrees of freedom for the model and for residuals, for each \code{nls} component. } \item{df.residual}{the total number of degrees of freedom for residuals, corresponding to the sum of residuals df of all \code{nls} components. } \item{pool}{the value of the \code{pool} argument to the function. } \item{RSE}{the pooled estimate of the residual standard error.} \item{sigma}{a vector with the residual standard error estimates for the individual \code{lm} fits. } } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{nlsList}}, \code{\link{summary}}} \examples{ fm1 <- nlsList(SSasymp, Loblolly) summary(fm1) } \keyword{models} nlme/man/Milk.Rd0000644000176200001440000000242312222456762013154 0ustar liggesusers% File nlme/man/Milk.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Milk} \alias{Milk} \title{Protein content of cows' milk} \description{ The \code{Milk} data frame has 1337 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{protein}{ a numeric vector giving the protein content of the milk. } \item{Time}{ a numeric vector giving the time since calving (weeks). } \item{Cow}{ an ordered factor giving a unique identifier for each cow. } \item{Diet}{ a factor with levels \code{barley}, \code{barley+lupins}, and \code{lupins} identifying the diet for each cow. } } } \details{ Diggle, Liang, and Zeger (1994) describe data on the protein content of cows' milk in the weeks following calving. The cattle are grouped according to whether they are fed a diet with barley alone, with barley and lupins, or with lupins alone. } \source{ Diggle, Peter J., Liang, Kung-Yee and Zeger, Scott L. (1994), \emph{Analysis of longitudinal data}, Oxford University Press, Oxford. } %\examples{} \keyword{datasets} nlme/man/corRatio.Rd0000644000176200001440000001057712222553014014037 0ustar liggesusers% File nlme/man/corRatio.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corRatio} \title{Rational Quadratic Correlation Structure} \usage{ corRatio(value, form, nugget, metric, fixed) } \alias{corRatio} \arguments{ \item{value}{an optional vector with the parameter values in constrained form. If \code{nugget} is \code{FALSE}, \code{value} can have only one element, corresponding to the "range" of the rational quadratic correlation structure, which must be greater than zero. If \code{nugget} is \code{TRUE}, meaning that a nugget effect is present, \code{value} can contain one or two elements, the first being the "range" and the second the "nugget effect" (one minus the correlation between two observations taken arbitrarily close together); the first must be greater than zero and the second must be between zero and one. Defaults to \code{numeric(0)}, which results in a range of 90\% of the minimum distance and a nugget effect of 0.1 being assigned to the parameters when \code{object} is initialized.} \item{form}{a one sided formula of the form \code{~ S1+...+Sp}, or \code{~ S1+...+Sp | g}, specifying spatial covariates \code{S1} through \code{Sp} and, optionally, a grouping factor \code{g}. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{nugget}{an optional logical value indicating whether a nugget effect is present. Defaults to \code{FALSE}.} \item{metric}{an optional character string specifying the distance metric to be used. The currently available options are \code{"euclidean"} for the root sum-of-squares of distances; \code{"maximum"} for the maximum difference; and \code{"manhattan"} for the sum of the absolute differences. Partial matching of arguments is used, so only the first three characters need to be provided. Defaults to \code{"euclidean"}.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{corRatio} class, representing a rational quadratic spatial correlation structure. Letting \eqn{d} denote the range and \eqn{n} denote the nugget effect, the correlation between two observations a distance \eqn{r} apart is \eqn{1/(1+(r/d)^2)} when no nugget effect is present and \eqn{(1-n)/(1+(r/d)^2)} when a nugget effect is assumed. Objects created using this constructor need to be later initialized using the appropriate \code{Initialize} method. } \value{ an object of class \code{corRatio}, also inheriting from class \code{corSpatial}, representing a rational quadratic spatial correlation structure. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. Littel, Milliken, Stroup, and Wolfinger (1996) "SAS Systems for Mixed Models", SAS Institute. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{Initialize.corStruct}}, \code{\link{summary.corStruct}}, \code{\link{dist}} } \examples{ sp1 <- corRatio(form = ~ x + y + z) # example lme(..., corRatio ...) # Pinheiro and Bates, pp. 222-249 fm1BW.lme <- lme(weight ~ Time * Diet, BodyWeight, random = ~ Time) # p. 223 fm2BW.lme <- update(fm1BW.lme, weights = varPower()) # p 246 fm3BW.lme <- update(fm2BW.lme, correlation = corExp(form = ~ Time)) # p. 249 fm5BW.lme <- update(fm3BW.lme, correlation = corRatio(form = ~ Time)) # example gls(..., corRatio ...) # Pinheiro and Bates, pp. 261, 263 fm1Wheat2 <- gls(yield ~ variety - 1, Wheat2) # p. 263 fm3Wheat2 <- update(fm1Wheat2, corr = corRatio(c(12.5, 0.2), form = ~ latitude + longitude, nugget = TRUE)) } \keyword{models} nlme/man/varClasses.Rd0000644000176200001440000000332312222553014014352 0ustar liggesusers% File nlme/man/varClasses.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{varClasses} \title{Variance Function Classes} \alias{varClasses} \description{ Standard classes of variance function structures (\code{varFunc}) available in the \code{nlme} package. Covariates included in the variance function, denoted by variance covariates, may involve functions of the fitted model object, such as the fitted values and the residuals. Different coefficients may be assigned to the levels of a classification factor. } \value{ Available standard classes: \item{varExp}{exponential of a variance covariate.} \item{varPower}{power of a variance covariate.} \item{varConstPower}{constant plus power of a variance covariate.} \item{varIdent}{constant variance(s), generally used to allow different variances according to the levels of a classification factor.} \item{varFixed}{fixed weights, determined by a variance covariate.} \item{varComb}{combination of variance functions.} } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ Users may define their own \code{varFunc} classes by specifying a \code{constructor} function and, at a minimum, methods for the functions \code{coef}, \code{coef<-}, and \code{initialize}. For examples of these functions, see the methods for class \code{varPower}. } \seealso{ \code{\link{varComb}}, \code{\link{varConstPower}}, \code{\link{varExp}}, \code{\link{varFixed}}, \code{\link{varIdent}}, \code{\link{varPower}}, \code{\link{summary.varFunc}} } \keyword{models} nlme/man/summary.gls.Rd0000644000176200001440000000437312710331473014540 0ustar liggesusers% File nlme/man/summary.gls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{summary.gls} \title{Summarize a Generalized Least Squares \code{gls} Object} \alias{summary.gls} %\alias{coef.summary.gls} \usage{ \method{summary}{gls}(object, verbose, \dots) } \arguments{ \item{object}{an object inheriting from class \code{"\link{gls}"}, representing a generalized least squares fitted linear model.} \item{verbose}{an optional logical value used to control the amount of output when the object is printed. Defaults to \code{FALSE}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ Additional information about the linear model fit represented by \code{object} is extracted and included as components of \code{object}. } \value{ an object inheriting from class \code{summary.gls} with all components included in \code{object} (see \code{\link{glsObject}} for a full description of the components) plus the following components: \item{corBeta}{approximate correlation matrix for the coefficients estimates} \item{tTable}{a matrix with columns \code{Value}, \code{Std. Error}, \code{t-value}, and \code{p-value} representing respectively the coefficients estimates, their approximate standard errors, the ratios between the estimates and their standard errors, and the associated p-value under a \eqn{t} approximation. Rows correspond to the different coefficients.} \item{residuals}{if more than five observations are used in the \code{gls} fit, a vector with the minimum, first quartile, median, third quartile, and maximum of the residuals distribution; else the residuals.} \item{AIC}{the Akaike Information Criterion corresponding to \code{object}.} \item{BIC}{the Bayesian Information Criterion corresponding to \code{object}.} } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{AIC}}, \code{\link{BIC}}, \code{\link{gls}}, \code{\link{summary}} } \examples{ fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) summary(fm1) coef(summary(fm1)) # "the matrix" } \keyword{models} nlme/man/pdClasses.Rd0000644000176200001440000000353712222553014014174 0ustar liggesusers% File nlme/man/pdClasses.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdClasses} \title{Positive-Definite Matrix Classes} \alias{pdClasses} \description{ Standard classes of positive-definite matrices (\code{pdMat}) structures available in the \code{nlme} package. } \value{ Available standard classes: \item{pdSymm}{general positive-definite matrix, with no additional structure} \item{pdLogChol}{general positive-definite matrix, with no additional structure, using a log-Cholesky parameterization} \item{pdDiag}{diagonal} \item{pdIdent}{multiple of an identity} \item{pdCompSymm}{compound symmetry structure (constant diagonal and constant off-diagonal elements)} \item{pdBlocked}{block-diagonal matrix, with diagonal blocks of any "atomic" \code{pdMat} class} \item{pdNatural}{general positive-definite matrix in natural parametrization (i.e. parametrized in terms of standard deviations and correlations). The underlying coefficients are not unrestricted, so this class should NOT be used for optimization.} } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ Users may define their own \code{pdMat} classes by specifying a \code{constructor} function and, at a minimum, methods for the functions \code{pdConstruct}, \code{pdMatrix} and \code{coef}. For examples of these functions, see the methods for classes \code{pdSymm} and \code{pdDiag}. } \seealso{\code{\link{pdBlocked}}, \code{\link{pdCompSymm}}, \code{\link{pdDiag}}, \code{\link{pdFactor}}, \code{\link{pdIdent}}, \code{\link{pdMat}}, \code{\link{pdMatrix}}, \code{\link{pdNatural}}, \code{\link{pdSymm}}, \code{\link{pdLogChol}} } \keyword{models} nlme/man/logLik.lmeStruct.Rd0000644000176200001440000000330512222553014015446 0ustar liggesusers% File nlme/man/logLik.lmeStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{logLik.lmeStruct} \title{Log-Likelihood of an lmeStruct Object} \usage{ \method{logLik}{lmeStruct}(object, Pars, conLin, \dots) } \alias{logLik.lmeStruct} \alias{logLik.lmeStructInt} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmeStruct}"}, representing a list of linear mixed-effects model components, such as \code{reStruct}, \code{corStruct}, and \code{varFunc} objects.} \item{Pars}{the parameter values at which the (restricted) log-likelihood is to be evaluated.} \item{conLin}{an optional condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying lme model. Defaults to \code{attr(object, "conLin")}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ \code{Pars} is used to update the coefficients of the model components of \code{object} and the individual (restricted) log-likelihood contributions of each component are added together. The type of log-likelihood (restricted or not) is determined by the \code{settings} attribute of \code{object}. } \value{ the (restricted) log-likelihood for the linear mixed-effects model described by \code{object}, evaluated at \code{Pars}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{lmeStruct}}, \code{\link{logLik.lme}} } \keyword{models} nlme/man/nlme.Rd0000644000176200001440000002304212222553014013177 0ustar liggesusers% File nlme/man/nlme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{nlme} \title{Nonlinear Mixed-Effects Models} \usage{ nlme(model, data, fixed, random, groups, start, correlation, weights, subset, method, na.action, naPattern, control, verbose) } \alias{nlme} \alias{nlme.formula} \arguments{ \item{model}{a nonlinear model formula, with the response on the left of a \code{~} operator and an expression involving parameters and covariates on the right, or an \code{nlsList} object. If \code{data} is given, all names used in the formula should be defined as parameters or variables in the data frame. The method function \code{nlme.nlsList} is documented separately.} \item{data}{an optional data frame containing the variables named in \code{model}, \code{fixed}, \code{random}, \code{correlation}, \code{weights}, \code{subset}, and \code{naPattern}. By default the variables are taken from the environment from which \code{nlme} is called.} \item{fixed}{a two-sided linear formula of the form \code{f1+...+fn~x1+...+xm}, or a list of two-sided formulas of the form \code{f1~x1+...+xm}, with possibly different models for different parameters. The \code{f1,...,fn} are the names of parameters included on the right hand side of \code{model} and the \code{x1+...+xm} expressions define linear models for these parameters (when the left hand side of the formula contains several parameters, they all are assumed to follow the same linear model, described by the right hand side expression). A \code{1} on the right hand side of the formula(s) indicates a single fixed effects for the corresponding parameter(s).} \item{random}{optionally, any of the following: (i) a two-sided formula of the form \code{r1+...+rn~x1+...+xm | g1/.../gQ}, with \code{r1,...,rn} naming parameters included on the right hand side of \code{model}, \code{x1+...+xm} specifying the random-effects model for these parameters and \code{g1/.../gQ} the grouping structure (\code{Q} may be equal to 1, in which case no \code{/} is required). The random effects formula will be repeated for all levels of grouping, in the case of multiple levels of grouping; (ii) a two-sided formula of the form \code{r1+...+rn~x1+..+xm}, a list of two-sided formulas of the form \code{r1~x1+...+xm}, with possibly different random-effects models for different parameters, a \code{pdMat} object with a two-sided formula, or list of two-sided formulas (i.e. a non-\code{NULL} value for \code{formula(random)}), or a list of pdMat objects with two-sided formulas, or lists of two-sided formulas. In this case, the grouping structure formula will be given in \code{groups}, or derived from the data used to fit the nonlinear mixed-effects model, which should inherit from class \code{groupedData},; (iii) a named list of formulas, lists of formulas, or \code{pdMat} objects as in (ii), with the grouping factors as names. The order of nesting will be assumed the same as the order of the order of the elements in the list; (iv) an \code{reStruct} object. See the documentation on \code{pdClasses} for a description of the available \code{pdMat} classes. Defaults to \code{fixed}, resulting in all fixed effects having also random effects.} \item{groups}{an optional one-sided formula of the form \code{~g1} (single level of nesting) or \code{~g1/.../gQ} (multiple levels of nesting), specifying the partitions of the data over which the random effects vary. \code{g1,...,gQ} must evaluate to factors in \code{data}. The order of nesting, when multiple levels are present, is taken from left to right (i.e. \code{g1} is the first level, \code{g2} the second, etc.).} \item{start}{an optional numeric vector, or list of initial estimates for the fixed effects and random effects. If declared as a numeric vector, it is converted internally to a list with a single component \code{fixed}, given by the vector. The \code{fixed} component is required, unless the model function inherits from class \code{selfStart}, in which case initial values will be derived from a call to \code{nlsList}. An optional \code{random} component is used to specify initial values for the random effects and should consist of a matrix, or a list of matrices with length equal to the number of grouping levels. Each matrix should have as many rows as the number of groups at the corresponding level and as many columns as the number of random effects in that level.} \item{correlation}{an optional \code{corStruct} object describing the within-group correlation structure. See the documentation of \code{corClasses} for a description of the available \code{corStruct} classes. Defaults to \code{NULL}, corresponding to no within-group correlations.} \item{weights}{an optional \code{varFunc} object or one-sided formula describing the within-group heteroscedasticity structure. If given as a formula, it is used as the argument to \code{varFixed}, corresponding to fixed variance weights. See the documentation on \code{varClasses} for a description of the available \code{varFunc} classes. Defaults to \code{NULL}, corresponding to homoscedastic within-group errors.} \item{subset}{an optional expression indicating the subset of the rows of \code{data} that should be used in the fit. This can be a logical vector, or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.} \item{method}{a character string. If \code{"REML"} the model is fit by maximizing the restricted log-likelihood. If \code{"ML"} the log-likelihood is maximized. Defaults to \code{"ML"}.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{na.fail}) causes \code{nlme} to print an error message and terminate if there are any incomplete observations.} \item{naPattern}{an expression or formula object, specifying which returned values are to be regarded as missing.} \item{control}{a list of control values for the estimation algorithm to replace the default values returned by the function \code{nlmeControl}. Defaults to an empty list.} \item{verbose}{an optional logical value. If \code{TRUE} information on the evolution of the iterative algorithm is printed. Default is \code{FALSE}.} } \description{ This generic function fits a nonlinear mixed-effects model in the formulation described in Lindstrom and Bates (1990) but allowing for nested random effects. The within-group errors are allowed to be correlated and/or have unequal variances. } \value{ an object of class \code{nlme} representing the nonlinear mixed-effects model fit. Generic functions such as \code{print}, \code{plot} and \code{summary} have methods to show the results of the fit. See \code{nlmeObject} for the components of the fit. The functions \code{resid}, \code{coef}, \code{fitted}, \code{fixed.effects}, and \code{random.effects} can be used to extract some of its components. } \note{ The function does not do any scaling internally: the optimization will work best when the response is scaled so its variance is of the order of one. } \references{ The model formulation and computational methods are described in Lindstrom, M.J. and Bates, D.M. (1990). The variance-covariance parametrizations are described in Pinheiro, J.C. and Bates., D.M. (1996). The different correlation structures available for the \code{correlation} argument are described in Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994), Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996), and Venables, W.N. and Ripley, B.D. (2002). The use of variance functions for linear and nonlinear mixed effects models is presented in detail in Davidian, M. and Giltinan, D.M. (1995). Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden-Day. Davidian, M. and Giltinan, D.M. (1995) "Nonlinear Mixed Effects Models for Repeated Measurement Data", Chapman and Hall. Laird, N.M. and Ware, J.H. (1982) "Random-Effects Models for Longitudinal Data", Biometrics, 38, 963-974. Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996) "SAS Systems for Mixed Models", SAS Institute. Lindstrom, M.J. and Bates, D.M. (1990) "Nonlinear Mixed Effects Models for Repeated Measures Data", Biometrics, 46, 673-687. Pinheiro, J.C. and Bates., D.M. (1996) "Unconstrained Parametrizations for Variance-Covariance Matrices", Statistics and Computing, 6, 289-296. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{nlmeControl}}, \code{\link{nlme.nlsList}}, \code{\link{nlmeObject}}, \code{\link{nlsList}}, \code{\link{nlmeStruct}}, \code{\link{pdClasses}}, \code{\link{reStruct}}, \code{\link{varFunc}}, \code{\link{corClasses}}, \code{\link{varClasses}} } \examples{ fm1 <- nlme(height ~ SSasymp(age, Asym, R0, lrc), data = Loblolly, fixed = Asym + R0 + lrc ~ 1, random = Asym ~ 1, start = c(Asym = 103, R0 = -8.5, lrc = -3.3)) summary(fm1) fm2 <- update(fm1, random = pdDiag(Asym + lrc ~ 1)) summary(fm2) } \keyword{models} nlme/man/corMatrix.corStruct.Rd0000644000176200001440000000664712222553014016217 0ustar liggesusers% File nlme/man/corMatrix.corStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corMatrix.corStruct} \title{Matrix of a corStruct Object} \usage{ \method{corMatrix}{corStruct}(object, covariate, corr, \dots) } \alias{corMatrix.corStruct} \alias{corMatrix.compSymm} \alias{corMatrix.corAR1} \alias{corMatrix.corARMA} \alias{corMatrix.corCAR1} \alias{corMatrix.corCompSymm} \alias{corMatrix.corIdent} \alias{corMatrix.corNatural} \alias{corMatrix.corSpatial} \alias{corMatrix.corSymm} \arguments{ \item{object}{an object inheriting from class \code{"\link{corStruct}"} representing a correlation structure.} \item{covariate}{an optional covariate vector (matrix), or list of covariate vectors (matrices), at which values the correlation matrix, or list of correlation matrices, are to be evaluated. Defaults to \code{getCovariate(object)}.} \item{corr}{a logical value. If \code{TRUE} the function returns the correlation matrix, or list of correlation matrices, represented by \code{object}. If \code{FALSE} the function returns a transpose inverse square-root of the correlation matrix, or a list of transpose inverse square-root factors of the correlation matrices.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the correlation matrix (or its transpose inverse square-root factor), or list of correlation matrices (or their transpose inverse square-root factors) corresponding to \code{covariate} and \code{object}. Letting \eqn{\Sigma}{S} denote a correlation matrix, a square-root factor of \eqn{\Sigma}{S} is any square matrix \eqn{L} such that \eqn{\Sigma = L'L}{S=L'L}. When \code{corr = FALSE}, this method extracts \eqn{L^{-t}}{L^(-t)}. } \value{ If \code{covariate} is a vector (matrix), the returned value will be an array with the corresponding correlation matrix (or its transpose inverse square-root factor). If the \code{covariate} is a list of vectors (matrices), the returned value will be a list with the correlation matrices (or their transpose inverse square-root factors) corresponding to each component of \code{covariate}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{corFactor.corStruct}}, \code{\link{Initialize.corStruct}}} \examples{ cs1 <- corAR1(0.3) corMatrix(cs1, covariate = 1:4) corMatrix(cs1, covariate = 1:4, corr = FALSE) # Pinheiro and Bates, p. 225 cs1CompSymm <- corCompSymm(value = 0.3, form = ~ 1 | Subject) cs1CompSymm <- Initialize(cs1CompSymm, data = Orthodont) corMatrix(cs1CompSymm) # Pinheiro and Bates, p. 226 cs1Symm <- corSymm(value = c(0.2, 0.1, -0.1, 0, 0.2, 0), form = ~ 1 | Subject) cs1Symm <- Initialize(cs1Symm, data = Orthodont) corMatrix(cs1Symm) # Pinheiro and Bates, p. 236 cs1AR1 <- corAR1(0.8, form = ~ 1 | Subject) cs1AR1 <- Initialize(cs1AR1, data = Orthodont) corMatrix(cs1AR1) # Pinheiro and Bates, p. 237 cs1ARMA <- corARMA(0.4, form = ~ 1 | Subject, q = 1) cs1ARMA <- Initialize(cs1ARMA, data = Orthodont) corMatrix(cs1ARMA) # Pinheiro and Bates, p. 238 spatDat <- data.frame(x = (0:4)/4, y = (0:4)/4) cs1Exp <- corExp(1, form = ~ x + y) cs1Exp <- Initialize(cs1Exp, spatDat) corMatrix(cs1Exp) } \keyword{models} nlme/man/summary.varFunc.Rd0000644000176200001440000000341512222553014015346 0ustar liggesusers% File nlme/man/summary.varFunc.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{summary.varFunc} \title{Summarize varFunc Object} \usage{ \method{summary}{varFunc}(object, structName, \dots) } \alias{summary.varFunc} \alias{summary.varComb} \alias{summary.varConstPower} \alias{summary.varExp} \alias{summary.varFixed} \alias{summary.varIdent} \alias{summary.varPower} \arguments{ \item{object}{an object inheriting from class \code{"\link{varFunc}"}, representing a variance function structure.} \item{structName}{an optional character string with a description of the \code{varFunc} class. Default depends on the method function: \code{"Combination of variance functions"} for \code{varComb}, \code{"Constant plus power of covariate"} for \code{varConstPower}, \code{"Exponential of variance covariate"} for \code{varExp}, \code{"Different standard deviations per stratum"} for \code{varIdent}, \code{"Power of variance covariate"} for \code{varPower}, and \code{data.class(object)} for \code{varFunc}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ A \code{structName} attribute, with the value of corresponding argument, is appended to \code{object} and its class is changed to \code{summary.varFunc}. } \value{ an object similar to \code{object}, with an additional attribute \code{structName}, inheriting from class \code{summary.varFunc}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{varClasses}}, \code{\link{varFunc}} } %\seealso{\code{\link{print.summary.varFunc}}} \examples{ vf1 <- varPower(0.3, form = ~age) vf1 <- Initialize(vf1, Orthodont) summary(vf1) } \keyword{models} nlme/man/fitted.nlmeStruct.Rd0000644000176200001440000000465212222553014015670 0ustar liggesusers% File nlme/man/fitted.nlmeStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{fitted.nlmeStruct} \title{Calculate nlmeStruct Fitted Values} \usage{ \method{fitted}{nlmeStruct}(object, level, conLin, \dots) } \alias{fitted.nlmeStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{nlmeStruct}"}, representing a list of mixed-effects model components, such as \code{reStruct}, \code{corStruct}, and \code{varFunc} objects, plus attributes specifying the underlying nonlinear model and the response variable.} \item{level}{an optional integer vector giving the level(s) of grouping to be used in extracting the fitted values from \code{object}. Level values increase from outermost to innermost grouping, with level zero corresponding to the population fitted values. Defaults to the highest or innermost level of grouping.} \item{conLin}{an optional condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying nlme model. Defaults to \code{attr(object, "conLin")}.} \item{\dots}{additional arguments that could be given to this method. None are used.} } \description{ The fitted values at level \eqn{i} are obtained by adding together the contributions from the estimated fixed effects and the estimated random effects at levels less or equal to \eqn{i} and evaluating the model function at the resulting estimated parameters. The resulting values estimate the predictions at level \eqn{i}. } \value{ if a single level of grouping is specified in \code{level}, the returned value is a vector with the fitted values at the desired level; else, when multiple grouping levels are specified in \code{level}, the returned object is a matrix with columns given by the fitted values at different levels. } \references{ Bates, D.M. and Pinheiro, J.C. (1998) "Computational methods for multilevel models" available in PostScript or PDF formats at http://nlme.stat.wisc.edu/pub/NLME/ } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ This method function is generally only used inside \code{nlme} and \code{fitted.nlme}. } \seealso{\code{\link{nlme}}, \code{\link{residuals.nlmeStruct}}} \keyword{models} nlme/man/Gasoline.Rd0000644000176200001440000000424112222456762014021 0ustar liggesusers% File nlme/man/Gasoline.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Gasoline} \alias{Gasoline} \title{Refinery yield of gasoline} \description{ The \code{Gasoline} data frame has 32 rows and 6 columns. } \format{ This data frame contains the following columns: \describe{ \item{yield}{ a numeric vector giving the percentage of crude oil converted to gasoline after distillation and fractionation } \item{endpoint}{ a numeric vector giving the temperature (degrees F) at which all the gasoline is vaporized } \item{Sample}{ an ordered factor giving the inferred crude oil sample number } \item{API}{ a numeric vector giving the crude oil gravity (degrees API) } \item{vapor}{ a numeric vector giving the vapor pressure of the crude oil \eqn{(\mathrm{lbf}/\mathrm{in}^2)}{(lbf/in^2)} } \item{ASTM}{ a numeric vector giving the crude oil 10\% point ASTM---the temperature at which 10\% of the crude oil has become vapor. } } } \details{ Prater (1955) provides data on crude oil properties and gasoline yields. Atkinson (1985) uses these data to illustrate the use of diagnostics in multiple regression analysis. Three of the covariates---\code{API}, \code{vapor}, and \code{ASTM}---measure characteristics of the crude oil used to produce the gasoline. The other covariate --- \code{endpoint}---is a characteristic of the refining process. Daniel and Wood (1980) notice that the covariates characterizing the crude oil occur in only ten distinct groups and conclude that the data represent responses measured on ten different crude oil samples. } \source{ Prater, N. H. (1955), Estimate gasoline yields from crudes, \emph{Petroleum Refiner}, \bold{35} (5). Atkinson, A. C. (1985), \emph{Plots, Transformations, and Regression}, Oxford Press, New York. Daniel, C. and Wood, F. S. (1980), \emph{Fitting Equations to Data}, Wiley, New York Venables, W. N. and Ripley, B. D. (2002) \emph{Modern Applied Statistics with S (4th ed)}, Springer, New York. } %\examples{} \keyword{datasets} nlme/man/Fatigue.Rd0000644000176200001440000000335012222456762013644 0ustar liggesusers% File nlme/man/Fatigue.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Fatigue} \alias{Fatigue} \title{Cracks caused by metal fatigue} \description{ The \code{Fatigue} data frame has 262 rows and 3 columns. } \format{ This data frame contains the following columns: \describe{ \item{Path}{ an ordered factor with levels \code{1} < \code{2} < \code{3} < \code{4} < \code{5} < \code{6} < \code{7} < \code{8} < \code{9} < \code{10} < \code{11} < \code{12} < \code{13} < \code{14} < \code{15} < \code{16} < \code{17} < \code{18} < \code{19} < \code{20} < \code{21} giving the test path (or test unit) number. The order is in terms of increasing failure time or decreasing terminal crack length. } \item{cycles}{ number of test cycles at which the measurement is made (millions of cycles). } \item{relLength}{ relative crack length (dimensionless). } } } \details{ These data are given in Lu and Meeker (1993) where they state ``We obtained the data in Table 1 visually from figure 4.5.2 on page 242 of Bogdanoff and Kozin (1985).'' The data represent the growth of cracks in metal for 21 test units. An initial notch of length 0.90 inches was made on each unit which then was subjected to several thousand test cycles. After every 10,000 test cycles the crack length was measured. Testing was stopped if the crack length exceeded 1.60 inches, defined as a failure, or at 120,000 cycles. } \source{ Lu, C. Joséph , and Meeker, William Q. (1993), Using degradation measures to estimate a time-to-failure distribution, \emph{Technometrics}, \bold{35}, 161-174 } %\examples{} \keyword{datasets} nlme/man/RatPupWeight.Rd0000644000176200001440000000241612222456762014645 0ustar liggesusers% File nlme/man/RatPupWeight.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{RatPupWeight} \alias{RatPupWeight} \title{The weight of rat pups} \description{ The \code{RatPupWeight} data frame has 322 rows and 5 columns. } \format{ This data frame contains the following columns: \describe{ \item{weight}{ a numeric vector } \item{sex}{ a factor with levels \code{Male} \code{Female} } \item{Litter}{ an ordered factor with levels \code{9} < \code{8} < \code{7} < \code{4} < \code{2} < \code{10} < \code{1} < \code{3} < \code{5} < \code{6} < \code{21} < \code{22} < \code{24} < \code{27} < \code{26} < \code{25} < \code{23} < \code{17} < \code{11} < \code{14} < \code{13} < \code{15} < \code{16} < \code{20} < \code{19} < \code{18} < \code{12} } \item{Lsize}{ a numeric vector } \item{Treatment}{ an ordered factor with levels \code{Control} < \code{Low} < \code{High} } } } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } %\examples{} \keyword{datasets} nlme/man/gsummary.Rd0000644000176200001440000001017312222553014014111 0ustar liggesusers% File nlme/man/gsummary.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{gsummary} \title{Summarize by Groups} \usage{ gsummary(object, FUN, omitGroupingFactor, form, level, groups, invariantsOnly, \dots) } \alias{gsummary} \arguments{ \item{object}{an object to be summarized - usually a \code{groupedData} object or a \code{data.frame}. } \item{FUN}{an optional summary function or a list of summary functions to be applied to each variable in the frame. The function or functions are applied only to variables in \code{object} that vary within the groups defined by \code{groups}. Invariant variables are always summarized by group using the unique value that they assume within that group. If \code{FUN} is a single function it will be applied to each non-invariant variable by group to produce the summary for that variable. If \code{FUN} is a list of functions, the names in the list should designate classes of variables in the frame such as \code{ordered}, \code{factor}, or \code{numeric}. The indicated function will be applied to any non-invariant variables of that class. The default functions to be used are \code{mean} for numeric factors, and \code{Mode} for both \code{factor} and \code{ordered}. The \code{Mode} function, defined internally in \code{gsummary}, returns the modal or most popular value of the variable. It is different from the \code{mode} function that returns the S-language mode of the variable. } \item{omitGroupingFactor}{an optional logical value. When \code{TRUE} the grouping factor itself will be omitted from the group-wise summary but the levels of the grouping factor will continue to be used as the row names for the data frame that is produced by the summary. Defaults to \code{FALSE}. } \item{form}{an optional one-sided formula that defines the groups. When this formula is given, the right-hand side is evaluated in \code{object}, converted to a factor if necessary, and the unique levels are used to define the groups. Defaults to \code{formula(object)}. } \item{level}{an optional positive integer giving the level of grouping to be used in an object with multiple nested grouping levels. Defaults to the highest or innermost level of grouping.} \item{groups}{an optional factor that will be used to split the rows into groups. Defaults to \code{getGroups(object, form, level)}. } \item{invariantsOnly}{an optional logical value. When \code{TRUE} only those covariates that are invariant within each group will be summarized. The summary value for the group is always the unique value taken on by that covariate within the group. The columns in the summary are of the same class as the corresponding columns in \code{object}. By definition, the grouping factor itself must be an invariant. When combined with \code{omitGroupingFactor = TRUE}, this option can be used to discover is there are invariant covariates in the data frame. Defaults to \code{FALSE}. } \item{\dots}{optional additional arguments to the summary functions that are invoked on the variables by group. Often it is helpful to specify \code{na.rm = TRUE}. } } \description{ Provide a summary of the variables in a data frame by groups of rows. This is most useful with a \code{groupedData} object to examine the variables by group. } \value{ A \code{data.frame} with one row for each level of the grouping factor. The number of columns is at most the number of columns in \code{object}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{summary}}, \code{\link{groupedData}}, \code{\link{getGroups}}} \examples{ gsummary(Orthodont) # default summary by Subject ## gsummary with invariantsOnly = TRUE and omitGroupingFactor = TRUE ## determines whether there are covariates like Sex that are invariant ## within the repeated observations on the same Subject. gsummary(Orthodont, inv = TRUE, omit = TRUE) } \keyword{manip} nlme/man/logDet.Rd0000644000176200001440000000201012222553014013452 0ustar liggesusers% File nlme/man/logDet.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{logDet} \title{Extract the Logarithm of the Determinant} \usage{ logDet(object, \dots) } \alias{logDet} \arguments{ \item{object}{any object from which a matrix, or list of matrices, can be extracted} \item{\dots}{some methods for this generic function require additional arguments.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include: \code{corStruct}, several \code{pdMat} classes, and \code{reStruct}. } \value{ will depend on the method function used; see the appropriate documentation. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{logLik}}, \code{\link{logDet.corStruct}}, \code{\link{logDet.pdMat}}, \code{\link{logDet.reStruct}} } \examples{ ## see the method function documentation } \keyword{models} nlme/man/ACF.lme.Rd0000644000176200001440000000513612222553014013415 0ustar liggesusers% File nlme/man/ACF.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{ACF.lme} \title{Autocorrelation Function for lme Residuals} \usage{ \method{ACF}{lme}(object, maxLag, resType, \dots) } \alias{ACF.lme} \arguments{ \item{object}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model.} \item{maxLag}{an optional integer giving the maximum lag for which the autocorrelation should be calculated. Defaults to maximum lag in the within-group residuals.} \item{resType}{an optional character string specifying the type of residuals to be used. If \code{"response"}, the "raw" residuals (observed - fitted) are used; else, if \code{"pearson"}, the standardized residuals (raw residuals divided by the corresponding standard errors) are used; else, if \code{"normalized"}, the normalized residuals (standardized residuals pre-multiplied by the inverse square-root factor of the estimated error correlation matrix) are used. Partial matching of arguments is used, so only the first character needs to be provided. Defaults to \code{"pearson"}.} \item{\dots}{some methods for this generic require additional arguments -- not used.} } \description{ This method function calculates the empirical autocorrelation function for the within-group residuals from an \code{lme} fit. The autocorrelation values are calculated using pairs of residuals within the innermost group level. The autocorrelation function is useful for investigating serial correlation models for equally spaced data. } \value{ a data frame with columns \code{lag} and \code{ACF} representing, respectively, the lag between residuals within a pair and the corresponding empirical autocorrelation. The returned value inherits from class \code{ACF}. } \references{ Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden-Day. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{ACF.gls}}, \code{\link{plot.ACF}}} \examples{ fm1 <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, random = ~ sin(2*pi*Time) | Mare) ACF(fm1, maxLag = 11) # Pinheiro and Bates, p240-241 fm1Over.lme <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data=Ovary, random=pdDiag(~sin(2*pi*Time)) ) (ACF.fm1Over <- ACF(fm1Over.lme, maxLag=10)) plot(ACF.fm1Over, alpha=0.01) } \keyword{models} nlme/man/getData.lme.Rd0000644000176200001440000000252712222456762014412 0ustar liggesusers% File nlme/man/getData.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getData.lme} \title{Extract lme Object Data} \usage{ \method{getData}{lme}(object) } \alias{getData.lme} \alias{getData.nlme} \alias{getData.nls} \arguments{ \item{object}{an object inheriting from class \code{lme}, representing a linear mixed-effects fitted model.} } \description{ If present in the calling sequence used to produce \code{object}, the data frame used to fit the model is obtained. } \value{ if a \code{data} argument is present in the calling sequence that produced \code{object}, the corresponding data frame (with \code{na.action} and \code{subset} applied to it, if also present in the call that produced \code{object}) is returned; else, \code{NULL} is returned. Note that as from version 3.1-102, this only omits rows omitted in the fit if \code{na.action = na.omit}, and does not omit at all if \code{na.action = na.exclude}. That is generally what is wanted for plotting, the main use of this function. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{getData}} } \examples{ fm1 <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data = Ovary, random = ~ sin(2*pi*Time)) getData(fm1) } \keyword{models} nlme/man/bdf.Rd0000644000176200001440000000436112634171737013021 0ustar liggesusers% File nlme/man/bdf.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{bdf} \alias{bdf} \title{Language scores} \usage{data(bdf)} \description{ The \code{bdf} data frame has 2287 rows and 25 columns of language scores from grade 8 pupils in elementary schools in The Netherlands. } \format{ \describe{ \item{schoolNR}{a factor denoting the school.} \item{pupilNR}{a factor denoting the pupil.} \item{IQ.verb}{a numeric vector of verbal IQ scores} \item{IQ.perf}{a numeric vector of IQ scores.} \item{sex}{Sex of the student.} \item{Minority}{a factor indicating if the student is a member of a minority group.} \item{repeatgr}{an ordered factor indicating if one or more grades have been repeated.} \item{aritPRET}{a numeric vector} \item{classNR}{a numeric vector} \item{aritPOST}{a numeric vector} \item{langPRET}{a numeric vector} \item{langPOST}{a numeric vector} \item{ses}{a numeric vector of socioeconomic status indicators.} \item{denomina}{a factor indicating of the school is a public school, a Protestant private school, a Catholic private school, or a non-denominational private school.} \item{schoolSES}{a numeric vector} \item{satiprin}{a numeric vector} \item{natitest}{a factor with levels \code{0} and \code{1}} \item{meetings}{a numeric vector} \item{currmeet}{a numeric vector} \item{mixedgra}{a factor indicating if the class is a mixed-grade class.} \item{percmino}{a numeric vector} \item{aritdiff}{a numeric vector} \item{homework}{a numeric vector} \item{classsiz}{a numeric vector} \item{groupsiz}{a numeric vector} } } \source{ \samp{http://stat.gamma.rug.nl/snijders/multilevel.htm}, the first edition of \url{http://www.stats.ox.ac.uk/~snijders/mlbook.htm}. } \references{ Snijders, Tom and Bosker, Roel (1999), \emph{Multilevel Analysis: An Introduction to Basic and Advanced Multilevel Modeling}, Sage. } \examples{ summary(bdf) ## More examples, including lme() fits reproducing parts in the above ## book, are available in the R script files system.file("mlbook", "ch04.R", package ="nlme") # and system.file("mlbook", "ch05.R", package ="nlme") } \keyword{datasets} nlme/man/update.varFunc.Rd0000644000176200001440000000326012222553014015131 0ustar liggesusers% File nlme/man/update.varFunc.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{update.varFunc} \title{Update varFunc Object} \usage{ \method{update}{varFunc}(object, data, \dots) } \alias{update.varExp} \alias{update.varFunc} \alias{update.varComb} \alias{update.varConstPower} \alias{update.varExpon} \alias{update.varPower} \arguments{ \item{object}{an object inheriting from class \code{"\link{varFunc}"}, representing a variance function structure.} \item{data}{a list with a component named \code{"."} with the current version of the fitted object (from which fitted values, coefficients, and residuals can be extracted) and, if necessary, other variables used to evaluate the variance covariate(s).} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ If the \code{formula(object)} includes a \code{"."} term, representing a fitted object, the variance covariate needs to be updated upon completion of an optimization cycle (in which the variance function weights are kept fixed). This method function allows a reevaluation of the variance covariate using the current fitted object and, optionally, other variables in the original data. } \value{ if \code{formula(object)} includes a \code{"."} term, an \code{varFunc} object similar to \code{object}, but with the variance covariate reevaluated at the current fitted object value; else \code{object} is returned unchanged. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{needUpdate}}, \code{\link{covariate<-.varFunc}} } \keyword{models} nlme/man/coef.varFunc.Rd0000644000176200001440000000414112222553014014562 0ustar liggesusers% File nlme/man/coef.varFunc.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{coef.varFunc} \title{varFunc Object Coefficients} \usage{ \method{coef}{varFunc}(object, unconstrained, allCoef, \dots) \method{coef}{varIdent}(object, \dots) <- value } \alias{coef.varFunc} \alias{coef.varComb} \alias{coef.varConstPower} \alias{coef.varExp} \alias{coef.varFixed} \alias{coef.varIdent} \alias{coef.varPower} \alias{coef<-.varComb} \alias{coef<-.varConstPower} \alias{coef<-.varExp} \alias{coef<-.varFixed} \alias{coef<-.varIdent} \alias{coef<-.varPower} \arguments{ \item{object}{an object inheriting from class \code{"\link{varFunc}"} representing a variance function structure.} \item{unconstrained}{a logical value. If \code{TRUE} the coefficients are returned in unconstrained form (the same used in the optimization algorithm). If \code{FALSE} the coefficients are returned in "natural", generally constrained form. Defaults to \code{TRUE}.} \item{allCoef}{a logical value. If \code{FALSE} only the coefficients which may vary during the optimization are returned. If \code{TRUE} all coefficients are returned. Defaults to \code{FALSE}.} \item{value}{a vector with the replacement values for the coefficients associated with \code{object}. It must be have the same length of \code{coef{object}} and must be given in unconstrained form. \code{Object} must be initialized before new values can be assigned to its coefficients.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the coefficients associated with the variance function structure represented by \code{object}. } \value{ a vector with the coefficients corresponding to \code{object}. } \author{José Pinheiro and Douglas Bates } \section{SIDE EFFECTS}{ On the left side of an assignment, sets the values of the coefficients of \code{object} to \code{value}. } \seealso{\code{\link{varFunc}}} \examples{ vf1 <- varPower(1) coef(vf1) %\dontrun{ coef(vf1) <- 2 %} } \keyword{models} nlme/man/plot.ranef.lmList.Rd0000644000176200001440000000773613331020316015567 0ustar liggesusers% File nlme/man/plot.ranef.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.ranef.lmList} \title{Plot a ranef.lmList Object} \alias{plot.ranef.lmList} \usage{ \method{plot}{ranef.lmList}(x, form, grid, control, \dots) } \arguments{ \item{x}{an object inheriting from class \code{"\link{ranef.lmList}"}, representing the estimated coefficients or estimated random effects for the \code{lmList} object from which it was produced. } \item{form}{an optional formula specifying the desired type of plot. If given as a one-sided formula, a \code{dotplot} of the estimated random effects (coefficients) grouped according to all combinations of the levels of the factors named in \code{form} is returned. Single factors (\code{~g}) or crossed factors (\code{~g1*g2}) are allowed. If given as a two-sided formula, the left hand side must be a single random effects (coefficient) and the right hand side is formed by covariates in \code{x} separated by \code{+}. A Trellis display of the random effect (coefficient) versus the named covariates is returned in this case. Default is \code{NULL}, in which case the row names of the random effects (coefficients) are used.} \item{grid}{an optional logical value indicating whether a grid should be added to plot. Only applies to plots associated with two-sided formulas in \code{form}. Default is \code{FALSE}.} \item{control}{an optional list with control values for the plot, when \code{form} is given as a two-sided formula. The control values are referenced by name in the \code{control} list and only the ones to be modified from the default need to be specified. Available values include: \code{drawLine}, a logical value indicating whether a \code{loess} smoother should be added to the scatter plots and a line connecting the medians should be added to the boxplots (default is \code{TRUE}); \code{span.loess}, used as the \code{span} argument in the call to \code{panel.loess} (default is \code{2/3}); \code{degree.loess}, used as the \code{degree} argument in the call to \code{panel.loess} (default is \code{1}); \code{cex.axis}, the character expansion factor for the x-axis (default is \code{0.8}); \code{srt.axis}, the rotation factor for the x-axis (default is \code{0}); and \code{mgp.axis}, the margin parameters for the x-axis (default is \code{c(2, 0.5, 0)}).} \item{\dots}{optional arguments passed to the Trellis \code{dotplot} function. } } \description{ If \code{form} is missing, or is given as a one-sided formula, a Trellis dot-plot of the random effects is generated, with a different panel for each random effect (coefficient). Rows in the dot-plot are determined by the \code{form} argument (if not missing) or by the row names of the random effects (coefficients). If a single factor is specified in \code{form}, its levels determine the dot-plot rows (with possibly multiple dots per row); otherwise, if \code{form} specifies a crossing of factors, the dot-plot rows are determined by all combinations of the levels of the individual factors in the formula. The Trellis function \code{dotplot} is used in this method function. If \code{form} is a two-sided formula, a Trellis display is generated, with a different panel for each variable listed in the right hand side of \code{form}. Scatter plots are generated for numeric variables and boxplots are generated for categorical (\code{factor} or \code{ordered}) variables. } \value{ a Trellis plot of the estimated random-effects (coefficients) versus covariates, or groups. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{lmList}}, \code{\link{dotplot}} } \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) plot(ranef(fm1)) fm1RE <- ranef(fm1, aug = TRUE) plot(fm1RE, form = ~ Sex) plot(fm1RE, form = age ~ Sex) } \keyword{models} nlme/man/isBalanced.Rd0000644000176200001440000000436112222553014014274 0ustar liggesusers% File nlme/man/isBalanced.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{isBalanced} \alias{isBalanced} \alias{isBalanced.groupedData} %- Also NEED an `\alias' for EACH other topic documented here. \title{Check a Design for Balance} \usage{ isBalanced(object, countOnly, level) } \arguments{ \item{object}{A \code{groupedData} object containing a data frame and a formula that describes the roles of variables in the data frame. The object will have one or more nested grouping factors and a primary covariate.} \item{countOnly}{A logical value indicating if the check for balance should only consider the number of observations at each level of the grouping factor(s). Defaults to \code{FALSE}.} \item{level}{an optional integer vector specifying the desired prediction levels. Levels increase from outermost to innermost grouping, with level 0 representing the population (fixed effects) predictions. Defaults to the innermost level.} } \description{ Check the design of the experiment or study for balance. } \details{ A design is balanced with respect to the grouping factor(s) if there are the same number of observations at each distinct value of the grouping factor or each combination of distinct levels of the nested grouping factors. If \code{countOnly} is \code{FALSE} the design is also checked for balance with respect to the primary covariate, which is often the time of the observation. A design is balanced with respect to the grouping factor and the covariate if the number of observations at each distinct level (or combination of levels for nested factors) is constant and the times at which the observations are taken (in general, the values of the primary covariates) also are constant. } \value{ \code{TRUE} or \code{FALSE} according to whether the data are balanced or not } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{table}}, \code{\link{groupedData}}} \examples{ isBalanced(Orthodont) # should return TRUE isBalanced(Orthodont, countOnly = TRUE) # should return TRUE isBalanced(Pixel) # should return FALSE isBalanced(Pixel, level = 1) # should return FALSE } \keyword{data} nlme/man/fixef.lmList.Rd0000644000176200001440000000176112222553014014614 0ustar liggesusers% File nlme/man/fixef.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{fixef.lmList} \title{Extract lmList Fixed Effects} \usage{ \method{fixef}{lmList}(object, \dots) } \alias{fixed.effects.lmList} \alias{fixef.lmList} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmList}"}, representing a list of \code{lm} objects with a common model. } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The average of the coefficients corresponding to the \code{lm} components of \code{object} is calculated. } \value{ a vector with the average of the individual \code{lm} coefficients in \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}}, \code{\link{random.effects.lmList}}} \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) fixed.effects(fm1) } \keyword{models} nlme/man/pdMatrix.reStruct.Rd0000644000176200001440000000312712222553014015650 0ustar liggesusers% File nlme/man/pdMatrix.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdMatrix.reStruct} \title{Extract Matrix or Square-Root Factor from Components of an reStruct Object} \usage{ \method{pdMatrix}{reStruct}(object, factor) } \alias{pdMatrix.reStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} \item{factor}{an optional logical value. If \code{TRUE}, square-root factors of the positive-definite matrices represented by the elements of \code{object} are returned; else, if \code{FALSE}, the positive-definite matrices are returned. Defaults to \code{FALSE}.} } \description{ This method function extracts the positive-definite matrices corresponding to the \code{pdMat} elements of \code{object}, or square-root factors of the positive-definite matrices. } \value{ a list with components given by the positive-definite matrices corresponding to the elements of \code{object}, or square-root factors of the positive-definite matrices. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. p. 162. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.reStruct}}, \code{\link{reStruct}}, \code{\link{pdMat}}, \code{\link{pdMatrix}}, \code{\link{pdMatrix.pdMat}} } \examples{ rs1 <- reStruct(pdSymm(diag(3), ~age+Sex, data = Orthodont)) pdMatrix(rs1) } \keyword{models} nlme/man/Glucose.Rd0000644000176200001440000000167512222456762013671 0ustar liggesusers% File nlme/man/Glucose.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Glucose} \alias{Glucose} \title{Glucose levels over time} \description{ The \code{Glucose} data frame has 378 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{Subject}{ an ordered factor with levels \code{6} < \code{2} < \code{3} < \code{5} < \code{1} < \code{4} } \item{Time}{ a numeric vector } \item{conc}{ a numeric vector of glucose levels } \item{Meal}{ an ordered factor with levels \code{2am} < \code{6am} < \code{10am} < \code{2pm} < \code{6pm} < \code{10pm} } } } \source{ Hand, D. and Crowder, M. (1996), \emph{Practical Longitudinal Data Analysis}, Chapman and Hall, London. } %\examples{} \keyword{datasets} nlme/man/Matrix.reStruct.Rd0000644000176200001440000000246112222553014015324 0ustar liggesusers% File nlme/man/Matrix.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Matrix.reStruct} \title{Assign reStruct Matrices} \usage{ \method{matrix}{reStruct}(object) <- value } \alias{matrix<-.reStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} \item{value}{a matrix, or list of matrices, with the new values to be assigned to the matrices associated with the \code{pdMat} components of \code{object}.} } \description{ The individual matrices in \code{value} are assigned to each \code{pdMat} component of \code{object}, in the order they are listed. The new matrices must have the same dimensions as the matrices they are meant to replace. } \value{ an \code{reStruct} object similar to \code{object}, but with the coefficients of the individual \code{pdMat} components modified to produce the matrices listed in \code{value}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{reStruct}}, \code{\link{pdMat}}, \code{"\link{matrix<-}"} } \examples{ rs1 <- reStruct(list(Dog = ~day, Side = ~1), data = Pixel) matrix(rs1) <- list(diag(2), 3) } \keyword{models} nlme/man/Quinidine.Rd0000644000176200001440000000667712222456762014224 0ustar liggesusers% File nlme/man/Quinidine.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Quinidine} \alias{Quinidine} \title{Quinidine Kinetics} \description{ The \code{Quinidine} data frame has 1471 rows and 14 columns. } \format{ This data frame contains the following columns: \describe{ \item{Subject}{ a factor identifying the patient on whom the data were collected. } \item{time}{ a numeric vector giving the time (hr) at which the drug was administered or the blood sample drawn. This is measured from the time the patient entered the study. } \item{conc}{ a numeric vector giving the serum quinidine concentration (mg/L). } \item{dose}{ a numeric vector giving the dose of drug administered (mg). Although there were two different forms of quinidine administered, the doses were adjusted for differences in salt content by conversion to milligrams of quinidine base. } \item{interval}{ a numeric vector giving the when the drug has been given at regular intervals for a sufficiently long period of time to assume steady state behavior, the interval is recorded. } \item{Age}{ a numeric vector giving the age of the subject on entry to the study (yr). } \item{Height}{ a numeric vector giving the height of the subject on entry to the study (in.). } \item{Weight}{ a numeric vector giving the body weight of the subject (kg). } \item{Race}{ a factor with levels \code{Caucasian}, \code{Latin}, and \code{Black} identifying the race of the subject. } \item{Smoke}{ a factor with levels \code{no} and \code{yes} giving smoking status at the time of the measurement. } \item{Ethanol}{ a factor with levels \code{none}, \code{current}, \code{former} giving ethanol (alcohol) abuse status at the time of the measurement. } \item{Heart}{ a factor with levels \code{No/Mild}, \code{Moderate}, and \code{Severe} indicating congestive heart failure for the subject. } \item{Creatinine}{ an ordered factor with levels \code{< 50} < \code{>= 50} indicating the creatine clearance (mg/min). } \item{glyco}{ a numeric vector giving the alpha-1 acid glycoprotein concentration (mg/dL). Often measured at the same time as the quinidine concentration. } } } \details{ Verme et al. (1992) analyze routine clinical data on patients receiving the drug quinidine as a treatment for cardiac arrythmia (atrial fibrillation of ventricular arrythmias). All patients were receiving oral quinidine doses. At irregular intervals blood samples were drawn and serum concentrations of quinidine were determined. These data are analyzed in several publications, including Davidian and Giltinan (1995, section 9.3). } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.25) Davidian, M. and Giltinan, D. M. (1995), \emph{Nonlinear Models for Repeated Measurement Data}, Chapman and Hall, London. Verme, C. N., Ludden, T. M., Clementi, W. A. and Harris, S. C. (1992), Pharmacokinetics of quinidine in male patients: A population analysis, \emph{Clinical Pharmacokinetics}, \bold{22}, 468-480. } %\examples{} \keyword{datasets} nlme/man/augPred.Rd0000644000176200001440000000663312222553014013642 0ustar liggesusers% File nlme/man/augPred.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{augPred} \title{Augmented Predictions} \usage{ augPred(object, primary, minimum, maximum, length.out, \dots) %% extra argument 'level': \S3method{augPred}{lme}(object, primary = NULL, minimum = min(primary), maximum = max(primary), length.out = 51, level = Q, \dots) } \alias{augPred} \alias{augPred.gls} \alias{augPred.lme} \alias{augPred.lmList} \arguments{ \item{object}{a fitted model object from which predictions can be extracted, using a \code{predict} method.} \item{primary}{an optional one-sided formula specifying the primary covariate to be used to generate the augmented predictions. By default, if a covariate can be extracted from the data used to generate \code{object} (using \code{getCovariate}), it will be used as \code{primary}.} \item{minimum}{an optional lower limit for the primary covariate. Defaults to \code{min(primary)}.} \item{maximum}{an optional upper limit for the primary covariate. Defaults to \code{max(primary)}.} \item{length.out}{an optional integer with the number of primary covariate values at which to evaluate the predictions. Defaults to 51.} \item{level}{an optional integer vector specifying the desired prediction levels. Levels increase from outermost to innermost grouping, with level 0 representing the population (fixed effects) predictions. Defaults to the innermost level.} \item{\dots}{some methods for the generic may require additional arguments.} } \description{ Predicted values are obtained at the specified values of \code{primary}. If \code{object} has a grouping structure (i.e. \code{getGroups(object)} is not \code{NULL}), predicted values are obtained for each group. If \code{level} has more than one element, predictions are obtained for each level of the \code{max(level)} grouping factor. If other covariates besides \code{primary} are used in the prediction model, their average (numeric covariates) or most frequent value (categorical covariates) are used to obtain the predicted values. The original observations are also included in the returned object. } \value{ a data frame with four columns representing, respectively, the values of the primary covariate, the groups (if \code{object} does not have a grouping structure, all elements will be \code{1}), the predicted or observed values, and the type of value in the third column: \code{original} for the observed values and \code{predicted} (single or no grouping factor) or \code{predict.groupVar} (multiple levels of grouping), with \code{groupVar} replaced by the actual grouping variable name (\code{fixed} is used for population predictions). The returned object inherits from class \code{"augPred"}. } \references{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include: \code{gls}, \code{lme}, and \code{lmList}. } \seealso{\code{\link{plot.augPred}}, \code{\link{getGroups}}, \code{\link{predict}}} \examples{ fm1 <- lme(Orthodont, random = ~1) augPred(fm1, length.out = 2, level = c(0,1)) } \keyword{models} nlme/man/Variogram.corRatio.Rd0000644000176200001440000000375612222553014015766 0ustar liggesusers% File nlme/man/Variogram.corRatio.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Variogram.corRatio} \title{Calculate Semi-variogram for a corRatio Object} \usage{ \method{Variogram}{corRatio}(object, distance, sig2, length.out, \dots) } \alias{Variogram.corRatio} \arguments{ \item{object}{an object inheriting from class \code{"\link{corRatio}"}, representing an Rational Quadratic spatial correlation structure.} \item{distance}{an optional numeric vector with the distances at which the semi-variogram is to be calculated. Defaults to \code{NULL}, in which case a sequence of length \code{length.out} between the minimum and maximum values of \code{getCovariate(object)} is used.} \item{sig2}{an optional numeric value representing the process variance. Defaults to \code{1}.} \item{length.out}{an optional integer specifying the length of the sequence of distances to be used for calculating the semi-variogram, when \code{distance = NULL}. Defaults to \code{50}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function calculates the semi-variogram values corresponding to the Rational Quadratic correlation model, using the estimated coefficients corresponding to \code{object}, at the distances defined by \code{distance}. } \value{ a data frame with columns \code{variog} and \code{dist} representing, respectively, the semi-variogram values and the corresponding distances. The returned value inherits from class \code{Variogram}. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corRatio}}, \code{\link{plot.Variogram}} \code{\link{Variogram}} } \examples{ cs1 <- corRatio(7, form = ~ Time | Rat) cs1 <- Initialize(cs1, BodyWeight) Variogram(cs1)[1:10,] } \keyword{models} nlme/man/phenoModel.Rd0000644000176200001440000000267512222456762014363 0ustar liggesusers% File nlme/man/phenoModel.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{phenoModel} \alias{phenoModel} \title{Model function for the Phenobarb data} \description{ A model function for a model used with the \code{Phenobarb} data. This function uses compiled C code to improve execution speed. } \usage{ phenoModel(Subject, time, dose, lCl, lV) } \arguments{ \item{Subject}{an integer vector of subject identifiers. These should be sorted in increasing order.} \item{time}{numeric. A vector of the times at which the sample was drawn or the drug administered (hr). } \item{dose}{numeric. A vector of doses of drug administered (\eqn{u}{\mu}g/kg). } \item{lCl}{numeric. A vector of values of the natural log of the clearance parameter according to \code{Subject} and \code{time}.} \item{lV}{numeric. A vector of values of the natural log of the effective volume of distribution according to \code{Subject} and \code{time}.} } \details{ See the details section of \code{\link{Phenobarb}} for a description of the model function that \code{phenoModel} evaluates. } \value{ a numeric vector of predicted phenobarbital concentrations. } \references{ Pinheiro, J. C. and Bates, D. M. (2000) \emph{Mixed-effects Models in S and S-PLUS}, Springer. (section 6.4) } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu} } \keyword{models} nlme/man/Variogram.Rd0000644000176200001440000000355312222553014014200 0ustar liggesusers% File nlme/man/Variogram.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Variogram} \title{Calculate Semi-variogram} \usage{ Variogram(object, distance, \dots) } \alias{Variogram} \arguments{ \item{object}{a numeric vector with the values to be used for calculating the semi-variogram, usually a residual vector from a fitted model.} \item{distance}{a numeric vector with the pairwise distances corresponding to the elements of \code{object}. The order of the elements in \code{distance} must correspond to the pairs \code{(1,2), (1,3), \dots, (n-1,n)}, with \code{n} representing the length of \code{object}, and must have length \code{n(n-1)/2}.} \item{\dots}{some methods for this generic function require additional arguments.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include \code{default}, \code{gls} and \code{lme}. See the appropriate method documentation for a description of the arguments. } \value{ will depend on the method function used; see the appropriate documentation. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{Variogram.corExp}}, \code{\link{Variogram.corGaus}}, \code{\link{Variogram.corLin}}, \code{\link{Variogram.corRatio}}, \code{\link{Variogram.corSpatial}}, \code{\link{Variogram.corSpher}}, \code{\link{Variogram.default}}, \code{\link{Variogram.gls}}, \code{\link{Variogram.lme}}, \code{\link{plot.Variogram}}} \examples{ ## see the method function documentation } \keyword{models} nlme/man/intervals.gls.Rd0000644000176200001440000000551312222553014015042 0ustar liggesusers% File nlme/man/intervals.gls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{intervals.gls} \title{Confidence Intervals on gls Parameters} \usage{ \method{intervals}{gls}(object, level, which, \dots) } \alias{intervals.gls} \alias{print.intervals.gls} \arguments{ \item{object}{an object inheriting from class \code{"\link{gls}"}, representing a generalized least squares fitted linear model.} \item{level}{an optional numeric value for the interval confidence level. Defaults to 0.95.} \item{which}{an optional character string specifying the subset of parameters for which to construct the confidence intervals. Possible values are \code{"all"} for all parameters, \code{"var-cov"} for the variance-covariance parameters only, and \code{"coef"} for the linear model coefficients only. Defaults to \code{"all"}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ Approximate confidence intervals for the parameters in the linear model represented by \code{object} are obtained, using a normal approximation to the distribution of the (restricted) maximum likelihood estimators (the estimators are assumed to have a normal distribution centered at the true parameter values and with covariance matrix equal to the negative inverse Hessian matrix of the (restricted) log-likelihood evaluated at the estimated parameters). Confidence intervals are obtained in an unconstrained scale first, using the normal approximation, and, if necessary, transformed to the constrained scale. } \value{ a list with components given by data frames with rows corresponding to parameters and columns \code{lower}, \code{est.}, and \code{upper} representing respectively lower confidence limits, the estimated values, and upper confidence limits for the parameters. Possible components are: \item{coef}{linear model coefficients, only present when \code{which} is not equal to \code{"var-cov"}.} \item{corStruct}{correlation parameters, only present when \code{which} is not equal to \code{"coef"} and a correlation structure is used in \code{object}.} \item{varFunc}{variance function parameters, only present when \code{which} is not equal to \code{"coef"} and a variance function structure is used in \code{object}.} \item{sigma}{residual standard error.} } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gls}}, \code{\link{intervals}}, \code{\link{print.intervals.gls}} } \examples{ fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) intervals(fm1) } \keyword{models} nlme/man/Remifentanil.Rd0000644000176200001440000000243112222456762014674 0ustar liggesusers% File nlme/man/Remifentanil.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Remifentanil} \alias{Remifentanil} \title{Pharmacokinetics of remifentanil} \description{ The \code{Remifentanil} data frame has 2107 rows and 12 columns. } \format{ This data frame contains the following columns: \describe{ \item{ID}{ a numeric vector } \item{Subject}{ an ordered factor } \item{Time}{ a numeric vector } \item{conc}{ a numeric vector } \item{Rate}{ a numeric vector } \item{Amt}{ a numeric vector } \item{Age}{ a numeric vector } \item{Sex}{ a factor with levels \code{Female} \code{Male} } \item{Ht}{ a numeric vector } \item{Wt}{ a numeric vector } \item{BSA}{ a numeric vector } \item{LBM}{ a numeric vector } } } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } %\examples{} \keyword{datasets} nlme/man/residuals.lmeStruct.Rd0000644000176200001440000000471412675271210016234 0ustar liggesusers% File nlme/man/residuals.lmeStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{residuals.lmeStruct} \title{Calculate lmeStruct Residuals} \usage{ \method{residuals}{lmeStruct}(object, level, conLin, lmeFit, \dots) } \alias{residuals.lmeStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmeStruct}"}, representing a list of linear mixed-effects model components, such as \code{reStruct}, \code{corStruct}, and \code{varFunc} objects.} \item{level}{an optional integer vector giving the level(s) of grouping to be used in extracting the residuals from \code{object}. Level values increase from outermost to innermost grouping, with level zero corresponding to the population fitted values. Defaults to the highest or innermost level of grouping.} \item{conLin}{an optional condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying lme model. Defaults to \code{attr(object, "conLin")}.} \item{lmeFit}{an optional list with components \code{beta} and \code{b} containing respectively the fixed effects estimates and the random effects estimates to be used to calculate the residuals. Defaults to \code{attr(object, "lmeFit")}.} \item{\dots}{some methods for this generic accept optional arguments.} } \description{ The residuals at level \eqn{i} are obtained by subtracting the fitted values at that level from the response vector. The fitted values at level \eqn{i} are obtained by adding together the population fitted values (based only on the fixed effects estimates) and the estimated contributions of the random effects to the fitted values at grouping levels less or equal to \eqn{i}. } \value{ if a single level of grouping is specified in \code{level}, the returned value is a vector with the residuals at the desired level; else, when multiple grouping levels are specified in \code{level}, the returned object is a matrix with columns given by the residuals at different levels. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ This method function is primarily used within the \code{\link{lme}} function. } \seealso{\code{\link{lme}}, \code{\link{residuals.lme}}, \code{\link{fitted.lmeStruct}} } \keyword{models} nlme/man/asTable.Rd0000644000176200001440000000253712222553014013625 0ustar liggesusers% File nlme/man/asTable.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{asTable} \alias{asTable} \alias{asTable.groupedData} \title{Convert groupedData to a matrix} \usage{ asTable(object) } \arguments{ \item{object}{A balanced \code{groupedData} object} } \description{ Create a tabular representation of the response in a balanced groupedData object. } \details{ A balanced groupedData object can be represented as a matrix or table of response values corresponding to the values of a primary covariate for each level of a grouping factor. This function creates such a matrix representation of the data in \code{object}. } \value{ A matrix. The data in the matrix are the values of the response. The columns correspond to the distinct values of the primary covariate and are labelled as such. The rows correspond to the distinct levels of the grouping factor and are labelled as such. } \references{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{groupedData}}, \code{\link{isBalanced}}, \code{\link{balancedGrouped}}} \examples{ asTable(Orthodont) # Pinheiro and Bates, p. 109 ergoStool.mat <- asTable(ergoStool) } \keyword{manip} nlme/man/varIdent.Rd0000644000176200001440000000705512222553014014026 0ustar liggesusers% File nlme/man/varIdent.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{varIdent} \title{Constant Variance Function} \usage{ varIdent(value, form, fixed) } \alias{varIdent} \arguments{ \item{value}{an optional numeric vector, or list of numeric values, with the variance function coefficients. If no grouping factor is present in \code{form}, this argument is ignored, as the resulting variance function contains no coefficients. If \code{value} has length one, its value is repeated for all coefficients in the variance function. If \code{value} has length greater than one, it must have length equal to the number of grouping levels minus one and names which identify its elements to the levels of the grouping factor. Only positive values are allowed for this argument. Default is \code{numeric(0)}, which results in a vector of zeros of appropriate length being assigned to the coefficients when \code{object} is initialized (corresponding to constant variance equal to one).} \item{form}{an optional one-sided formula of the form \code{~ v}, or \code{~ v | g}, specifying a variance covariate \code{v} and, optionally, a grouping factor \code{g} for the coefficients. The variance covariate is ignored in this variance function. When a grouping factor is present in \code{form}, a different coefficient value is used for each of its levels less one reference level (see description section below). Several grouping variables may be simultaneously specified, separated by the \code{*} operator, like in \code{~ v | g1 * g2 * g3}. In this case, the levels of each grouping variable are pasted together and the resulting factor is used to group the observations. Defaults to \code{~ 1}. } \item{fixed}{an optional numeric vector, or list of numeric values, specifying the values at which some or all of the coefficients in the variance function should be fixed. It must have names identifying which coefficients are to be fixed. Coefficients included in \code{fixed} are not allowed to vary during the optimization of an objective function. Defaults to \code{NULL}, corresponding to no fixed coefficients.} } \description{ This function is a constructor for the \code{varIdent} class, representing a constant variance function structure. If no grouping factor is present in \code{form}, the variance function is constant and equal to one, and no coefficients required to represent it. When \code{form} includes a grouping factor with \eqn{M > 1} levels, the variance function allows M different variances, one for each level of the factor. For identifiability reasons, the coefficients of the variance function represent the ratios between the variances and a reference variance (corresponding to a reference group level). Therefore, only \eqn{M-1} coefficients are needed to represent the variance function. By default, if the elements in \code{value} are unnamed, the first group level is taken as the reference level. } \value{ a \code{varIdent} object representing a constant variance function structure, also inheriting from class \code{varFunc}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{varClasses}}, \code{\link{varWeights.varFunc}}, \code{\link{coef.varIdent}}} \examples{ vf1 <- varIdent(c(Female = 0.5), form = ~ 1 | Sex) } \keyword{models} nlme/man/recalc.reStruct.Rd0000644000176200001440000000330612222553014015310 0ustar liggesusers% File nlme/man/recalc.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{recalc.reStruct} \title{Recalculate for an reStruct Object} \usage{ \method{recalc}{reStruct}(object, conLin, \dots) } \alias{recalc.reStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} \item{conLin}{a condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying model.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The log-likelihood, or restricted log-likelihood, of the Gaussian linear mixed-effects model represented by \code{object} and \code{conLin} (assuming spherical within-group covariance structure), evaluated at \code{coef(object)} is calculated and added to the \code{logLik} component of \code{conLin}. The \code{settings} attribute of \code{object} determines whether the log-likelihood, or the restricted log-likelihood, is to be calculated. The computational methods for the (restricted) log-likelihood calculations are described in Bates and Pinheiro (1998). } \value{ the condensed linear model with its \code{logLik} component updated. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{logLik}}, \code{\link{lme}}, \code{\link{recalc}}, \code{\link{reStruct}} } \keyword{models} nlme/man/quinModel.Rd0000644000176200001440000000412012222456762014211 0ustar liggesusers% File nlme/man/quinModel.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{quinModel} \alias{quinModel} \title{Model function for the Quinidine data} \description{ A model function for a model used with the \code{Quinidine} data. This function calls compiled C code. } \usage{ quinModel(Subject, time, conc, dose, interval, lV, lKa, lCl) } \arguments{ \item{Subject}{ a factor identifying the patient on whom the data were collected. } \item{time}{ a numeric vector giving the time (hr) at which the drug was administered or the blood sample drawn. This is measured from the time the patient entered the study. } \item{conc}{ a numeric vector giving the serum quinidine concentration (mg/L). } \item{dose}{ a numeric vector giving the dose of drug administered (mg). Although there were two different forms of quinidine administered, the doses were adjusted for differences in salt content by conversion to milligrams of quinidine base. } \item{interval}{ a numeric vector giving the when the drug has been given at regular intervals for a sufficiently long period of time to assume steady state behavior, the interval is recorded. } \item{lV}{numeric. A vector of values of the natural log of the effective volume of distribution according to \code{Subject} and \code{time}.} \item{lKa}{numeric. A vector of values of the natural log of the absorption rate constant according to \code{Subject} and \code{time}.} \item{lCl}{numeric. A vector of values of the natural log of the clearance parameter according to \code{Subject} and \code{time}.} } \details{ See the details section of \code{\link{Quinidine}} for a description of the model function that \code{quinModel} evaluates. } \value{ a numeric vector of predicted quinidine concentrations. } \references{ Pinheiro, J. C. and Bates, D. M. (2000) \emph{Mixed-effects Models in S and S-PLUS}, Springer. (section 8.2) } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu} } \keyword{models} nlme/man/logDet.pdMat.Rd0000644000176200001440000000216212222553014014526 0ustar liggesusers% File nlme/man/logDet.pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{logDet.pdMat} \title{Extract Log-Determinant from a pdMat Object} \usage{ \method{logDet}{pdMat}(object, \dots) } \alias{logDet.pdMat} \alias{logDet.pdBlocked} \alias{logDet.pdCompSymm} \alias{logDet.pdDiag} \alias{logDet.pdIdent} \alias{logDet.pdNatural} \alias{logDet.pdSymm} \arguments{ \item{object}{an object inheriting from class \code{"\link{pdMat}"}, representing a positive definite matrix.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the logarithm of the determinant of a square-root factor of the positive-definite matrix represented by \code{object}. } \value{ the log-determinant of a square-root factor of the positive-definite matrix represented by \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{pdMat}}, \code{\link{logDet}} } \examples{ pd1 <- pdSymm(diag(1:3)) logDet(pd1) } \keyword{models} nlme/man/pdNatural.Rd0000644000176200001440000001006212222553014014174 0ustar liggesusers% File nlme/man/pdNatural.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdNatural} \title{General Positive-Definite Matrix in Natural Parametrization} \usage{ pdNatural(value, form, nam, data) } \alias{pdNatural} \arguments{ \item{value}{an optional initialization value, which can be any of the following: a \code{pdMat} object, a positive-definite matrix, a one-sided linear formula (with variables separated by \code{+}), a vector of character strings, or a numeric vector. Defaults to \code{numeric(0)}, corresponding to an uninitialized object.} \item{form}{an optional one-sided linear formula specifying the row/column names for the matrix represented by \code{object}. Because factors may be present in \code{form}, the formula needs to be evaluated on a data.frame to resolve the names it defines. This argument is ignored when \code{value} is a one-sided formula. Defaults to \code{NULL}.} \item{nam}{an optional vector of character strings specifying the row/column names for the matrix represented by object. It must have length equal to the dimension of the underlying positive-definite matrix and unreplicated elements. This argument is ignored when \code{value} is a vector of character strings. Defaults to \code{NULL}.} \item{data}{an optional data frame in which to evaluate the variables named in \code{value} and \code{form}. It is used to obtain the levels for \code{factors}, which affect the dimensions and the row/column names of the underlying matrix. If \code{NULL}, no attempt is made to obtain information on \code{factors} appearing in the formulas. Defaults to the parent frame from which the function was called.} } \description{ This function is a constructor for the \code{pdNatural} class, representing a general positive-definite matrix, using a natural parametrization . If the matrix associated with \code{object} is of dimension \eqn{n}, it is represented by \eqn{n(n+1)/2}{n*(n+1)/2} parameters. Letting \eqn{\sigma_{ij}}{S(i,j)} denote the \eqn{ij}-th element of the underlying positive definite matrix and \eqn{\rho_{ij}=\sigma_{i}/\sqrt{\sigma_{ii}\sigma_{jj}},\;i\neq j}{r(i,j) = S(i,j)/sqrt(S(i,i)S(j,j)), i not equal to j} denote the associated "correlations", the "natural" parameters are given by \eqn{\sqrt{\sigma_{ii}}, \;i=1,\ldots,n}{sqrt(Sii), i=1,..,n} and \eqn{\log((1+\rho_{ij})/(1-\rho_{ij})),\; i \neq j}{log((1+r(i,j))/(1-r(i,j))), i not equal to j}. Note that all natural parameters are individually unrestricted, but not jointly unrestricted (meaning that not all unrestricted vectors would give positive-definite matrices). Therefore, this parametrization should NOT be used for optimization. It is mostly used for deriving approximate confidence intervals on parameters following the optimization of an objective function. When \code{value} is \code{numeric(0)}, an uninitialized \code{pdMat} object, a one-sided formula, or a vector of character strings, \code{object} is returned as an uninitialized \code{pdSymm} object (with just some of its attributes and its class defined) and needs to have its coefficients assigned later, generally using the \code{coef} or \code{matrix} replacement functions. If \code{value} is an initialized \code{pdMat} object, \code{object} will be constructed from \code{as.matrix(value)}. Finally, if \code{value} is a numeric vector, it is assumed to represent the natural parameters of the underlying positive-definite matrix. } \value{ a \code{pdNatural} object representing a general positive-definite matrix in natural parametrization, also inheriting from class \code{pdMat}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. p. 162. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.pdMat}}, \code{\link{coef.pdMat}}, \code{\link{pdClasses}}, \code{\link{matrix<-.pdMat}}} \examples{ pdNatural(diag(1:3)) } \keyword{models} nlme/man/varComb.Rd0000644000176200001440000000212612222553014013635 0ustar liggesusers% File nlme/man/varComb.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{varComb} \title{Combination of Variance Functions} \usage{ varComb(\dots) } \alias{varComb} \arguments{ \item{\dots}{objects inheriting from class \code{varFunc} representing variance function structures.} } \description{ This function is a constructor for the \code{varComb} class, representing a combination of variance functions. The corresponding variance function is equal to the product of the variance functions of the \code{varFunc} objects listed in \code{\dots}. } \value{ a \code{varComb} object representing a combination of variance functions, also inheriting from class \code{varFunc}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{varClasses}}, \code{\link{varWeights.varComb}}, \code{\link{coef.varComb}}} \examples{ vf1 <- varComb(varIdent(form = ~1|Sex), varPower()) } \keyword{models} nlme/man/nlme.nlsList.Rd0000644000176200001440000001616512222553014014636 0ustar liggesusers% File nlme/man/nlme.nlsList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{nlme.nlsList} \title{NLME fit from nlsList Object} \usage{ \method{nlme}{nlsList}(model, data, fixed, random, groups, start, correlation, weights, subset, method, na.action, naPattern, control, verbose) } \alias{nlme.nlsList} \arguments{ \item{model}{an object inheriting from class \code{"\link{nlsList}"}, representing a list of \code{nls} fits with a common model.} \item{data}{this argument is included for consistency with the generic function. It is ignored in this method function.} \item{fixed}{this argument is included for consistency with the generic function. It is ignored in this method function.} \item{random}{an optional one-sided linear formula with no conditioning expression, or a \code{pdMat} object with a \code{formula} attribute. Multiple levels of grouping are not allowed with this method function. Defaults to a formula consisting of the right hand side of \code{formula(fixed)}.} \item{groups}{an optional one-sided formula of the form \code{~g1} (single level of nesting) or \code{~g1/.../gQ} (multiple levels of nesting), specifying the partitions of the data over which the random effects vary. \code{g1,...,gQ} must evaluate to factors in \code{data}. The order of nesting, when multiple levels are present, is taken from left to right (i.e. \code{g1} is the first level, \code{g2} the second, etc.).} \item{start}{an optional numeric vector, or list of initial estimates for the fixed effects and random effects. If declared as a numeric vector, it is converted internally to a list with a single component \code{fixed}, given by the vector. The \code{fixed} component is required, unless the model function inherits from class \code{selfStart}, in which case initial values will be derived from a call to \code{nlsList}. An optional \code{random} component is used to specify initial values for the random effects and should consist of a matrix, or a list of matrices with length equal to the number of grouping levels. Each matrix should have as many rows as the number of groups at the corresponding level and as many columns as the number of random effects in that level.} \item{correlation}{an optional \code{corStruct} object describing the within-group correlation structure. See the documentation of \code{corClasses} for a description of the available \code{corStruct} classes. Defaults to \code{NULL}, corresponding to no within-group correlations.} \item{weights}{an optional \code{varFunc} object or one-sided formula describing the within-group heteroscedasticity structure. If given as a formula, it is used as the argument to \code{varFixed}, corresponding to fixed variance weights. See the documentation on \code{varClasses} for a description of the available \code{varFunc} classes. Defaults to \code{NULL}, corresponding to homoscedastic within-group errors.} \item{subset}{an optional expression indicating the subset of the rows of \code{data} that should be used in the fit. This can be a logical vector, or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.} \item{method}{a character string. If \code{"REML"} the model is fit by maximizing the restricted log-likelihood. If \code{"ML"} the log-likelihood is maximized. Defaults to \code{"ML"}.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{na.fail}) causes \code{nlme} to print an error message and terminate if there are any incomplete observations.} \item{naPattern}{an expression or formula object, specifying which returned values are to be regarded as missing.} \item{control}{a list of control values for the estimation algorithm to replace the default values returned by the function \code{nlmeControl}. Defaults to an empty list.} \item{verbose}{an optional logical value. If \code{TRUE} information on the evolution of the iterative algorithm is printed. Default is \code{FALSE}.} } \description{ If the random effects names defined in \code{random} are a subset of the \code{lmList} object coefficient names, initial estimates for the covariance matrix of the random effects are obtained (overwriting any values given in \code{random}). \code{formula(fixed)} and the \code{data} argument in the calling sequence used to obtain \code{fixed} are passed as the \code{fixed} and \code{data} arguments to \code{nlme.formula}, together with any other additional arguments in the function call. See the documentation on \code{nlme.formula} for a description of that function. } \value{ an object of class \code{nlme} representing the linear mixed-effects model fit. Generic functions such as \code{print}, \code{plot} and \code{summary} have methods to show the results of the fit. See \code{nlmeObject} for the components of the fit. The functions \code{resid}, \code{coef}, \code{fitted}, \code{fixed.effects}, and \code{random.effects} can be used to extract some of its components. } \references{ The computational methods follow on the general framework of Lindstrom, M.J. and Bates, D.M. (1988). The model formulation is described in Laird, N.M. and Ware, J.H. (1982). The variance-covariance parametrizations are described in 0}, curves representing the critical limits for a two-sided test of level \code{alpha} for the autocorrelations are added to the plot. } \value{ an \code{xyplot} Trellis plot. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{ACF}}, \code{\link{xyplot}}} \examples{ fm1 <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary) plot(ACF(fm1, maxLag = 10), alpha = 0.01) } \keyword{models} nlme/man/predict.lmList.Rd0000644000176200001440000000531612222553014015145 0ustar liggesusers% File nlme/man/predict.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{predict.lmList} \title{Predictions from an lmList Object} \usage{ \method{predict}{lmList}(object, newdata, subset, pool, asList, se.fit, \dots) } \alias{predict.lmList} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmList}"}, representing a list of \code{lm} objects with a common model. } \item{newdata}{an optional data frame to be used for obtaining the predictions. All variables used in the \code{object} model formula must be present in the data frame. If missing, the same data frame used to produce \code{object} is used. } \item{subset}{an optional character or integer vector naming the \code{lm} components of \code{object} from which the predictions are to be extracted. Default is \code{NULL}, in which case all components are used. } \item{asList}{an optional logical value. If \code{TRUE}, the returned object is a list with the predictions split by groups; else the returned value is a vector. Defaults to \code{FALSE}. } \item{pool}{an optional logical value indicating whether a pooled estimate of the residual standard error should be used. Default is \code{attr(object, "pool")}. } \item{se.fit}{an optional logical value indicating whether pointwise standard errors should be computed along with the predictions. Default is \code{FALSE}. } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ If the grouping factor corresponding to \code{object} is included in \code{newdata}, the data frame is partitioned according to the grouping factor levels; else, \code{newdata} is repeated for all \code{lm} components. The predictions and, optionally, the standard errors for the predictions, are obtained for each \code{lm} component of \code{object}, using the corresponding element of the partitioned \code{newdata}, and arranged into a list with as many components as \code{object}, or combined into a single vector or data frame (if \code{se.fit=TRUE}). } \value{ a list with components given by the predictions (and, optionally, the standard errors for the predictions) from each \code{lm} component of \code{object}, a vector with the predictions from all \code{lm} components of \code{object}, or a data frame with columns given by the predictions and their corresponding standard errors. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}}, \code{\link{predict.lm}}} \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) predict(fm1, se.fit = TRUE) } \keyword{models} nlme/man/qqnorm.gls.Rd0000644000176200001440000000665112222553014014354 0ustar liggesusers% File nlme/man/qqnorm.gls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{qqnorm.gls} \title{Normal Plot of Residuals from a gls Object} \usage{ \method{qqnorm}{gls}(y, form, abline, id, idLabels, grid, \dots) } \alias{qqnorm.gls} \arguments{ \item{y}{an object inheriting from class \code{"\link{gls}"}, representing a generalized least squares fitted model.} \item{form}{an optional one-sided formula specifying the desired type of plot. Any variable present in the original data frame used to obtain \code{y} can be referenced. In addition, \code{y} itself can be referenced in the formula using the symbol \code{"."}. Conditional expressions on the right of a \code{|} operator can be used to define separate panels in a Trellis display. The expression on the right hand side of \code{form} and to the left of a \code{|} operator must evaluate to a residuals vector. Default is \code{~ resid(., type = "p")}, corresponding to a normal plot of the standardized residuals.} \item{abline}{an optional numeric value, or numeric vector of length two. If given as a single value, a horizontal line will be added to the plot at that coordinate; else, if given as a vector, its values are used as the intercept and slope for a line added to the plot. If missing, no lines are added to the plot.} \item{id}{an optional numeric value, or one-sided formula. If given as a value, it is used as a significance level for a two-sided outlier test for the standardized residuals (random effects). Observations with absolute standardized residuals (random effects) greater than the \eqn{1 - value/2} quantile of the standard normal distribution are identified in the plot using \code{idLabels}. If given as a one-sided formula, its right hand side must evaluate to a logical, integer, or character vector which is used to identify observations in the plot. If missing, no observations are identified.} \item{idLabels}{an optional vector, or one-sided formula. If given as a vector, it is converted to character and used to label the observations identified according to \code{id}. If given as a one-sided formula, its right hand side must evaluate to a vector which is converted to character and used to label the identified observations. Default is the innermost grouping factor.} \item{grid}{an optional logical value indicating whether a grid should be added to plot. Default depends on the type of Trellis plot used: if \code{xyplot} defaults to \code{TRUE}, else defaults to \code{FALSE}.} \item{\dots}{optional arguments passed to the Trellis plot function.} } \description{ Diagnostic plots for assessing the normality of residuals the generalized least squares fit are obtained. The \code{form} argument gives considerable flexibility in the type of plot specification. A conditioning expression (on the right side of a \code{|} operator) always implies that different panels are used for each level of the conditioning factor, according to a Trellis display. } \value{ a diagnostic Trellis plot for assessing normality of residuals. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gls}}, \code{\link{plot.gls}}} \examples{ fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) qqnorm(fm1, abline = c(0,1)) } \keyword{models} nlme/man/Names.formula.Rd0000644000176200001440000000266312222553014014761 0ustar liggesusers% File nlme/man/Names.formula.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Names.formula} \title{Extract Names from a formula} \usage{ \method{Names}{formula}(object, data, exclude, \dots) } \alias{Names.formula} \alias{Names.listForm} \arguments{ \item{object}{an object inheriting from class \code{"\link{formula}"}.} \item{data}{an optional data frame containing the variables specified in \code{object}. By default the variables are taken from the environment from which \code{Names.formula} is called.} \item{exclude}{an optional character vector with names to be excluded from the returned value. Default is \code{c("pi",".")}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function returns the names of the terms corresponding to the right hand side of \code{object} (treated as a linear formula), obtained as the column names of the corresponding \code{model.matrix}. } \value{ a character vector with the column names of the \code{model.matrix} corresponding to the right hand side of \code{object} which are not listed in \code{excluded}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{model.matrix}}, \code{\link{terms}}, \code{\link{Names}} } \examples{ Names(distance ~ Sex * age, data = Orthodont) } \keyword{models} nlme/man/recalc.varFunc.Rd0000644000176200001440000000310612222553014015077 0ustar liggesusers% File nlme/man/recalc.varFunc.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{recalc.varFunc} \title{Recalculate for varFunc Object} \usage{ \method{recalc}{varFunc}(object, conLin, \dots) } \alias{recalc.varFunc} \alias{recalc.varIdent} \arguments{ \item{object}{an object inheriting from class \code{"\link{varFunc}"}, representing a variance function structure.} \item{conLin}{a condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying model.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function pre-multiples the \code{"Xy"} component of \code{conLin} by a diagonal matrix with diagonal elements given by the weights corresponding to the variance structure represented by \code{object}e and adds the log-likelihood contribution of \code{object}, given by \code{logLik(object)}, to the \code{"logLik"} component of \code{conLin}. } \value{ the recalculated condensed linear model object. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{This method function is only used inside model fitting functions, such as \code{lme} and \code{gls}, that allow heteroscedastic error terms.} \seealso{ \code{\link{recalc}}, \code{\link{varWeights}}, \code{\link{logLik.varFunc}}} \keyword{models} nlme/man/residuals.lme.Rd0000644000176200001440000000615012222553014015014 0ustar liggesusers% File nlme/man/residuals.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{residuals.lme} \title{Extract lme Residuals} \usage{ \method{residuals}{lme}(object, level = Q, type = c("response", "pearson", "normalized"), asList = FALSE, \dots) } \alias{residuals.lme} \arguments{ \item{object}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model.} \item{level}{an optional integer vector giving the level(s) of grouping to be used in extracting the residuals from \code{object}. Level values increase from outermost to innermost grouping, with level zero corresponding to the population residuals. Defaults to the highest or innermost level of grouping.} \item{type}{an optional character string specifying the type of residuals to be used. If \code{"response"}, as by default, the \dQuote{raw} residuals (observed - fitted) are used; else, if \code{"pearson"}, the standardized residuals (raw residuals divided by the corresponding standard errors) are used; else, if \code{"normalized"}, the normalized residuals (standardized residuals pre-multiplied by the inverse square-root factor of the estimated error correlation matrix) are used. Partial matching of arguments is used, so only the first character needs to be provided.} \item{asList}{an optional logical value. If \code{TRUE} and a single value is given in \code{level}, the returned object is a list with the residuals split by groups; else the returned value is either a vector or a data frame, according to the length of \code{level}. Defaults to \code{FALSE}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The residuals at level \eqn{i} are obtained by subtracting the fitted levels at that level from the response vector (and dividing by the estimated within-group standard error, if \code{type="pearson"}). The fitted values at level \eqn{i} are obtained by adding together the population fitted values (based only on the fixed effects estimates) and the estimated contributions of the random effects to the fitted values at grouping levels less or equal to \eqn{i}. } \value{ if a single level of grouping is specified in \code{level}, the returned value is either a list with the residuals split by groups (\code{asList = TRUE}) or a vector with the residuals (\code{asList = FALSE}); else, when multiple grouping levels are specified in \code{level}, the returned object is a data frame with columns given by the residuals at different levels and the grouping factors. For a vector or data frame result the \code{\link{naresid}} method is applied. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{fitted.lme}} } \examples{ fm1 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) head(residuals(fm1, level = 0:1)) summary(residuals(fm1) / residuals(fm1, type = "p")) # constant scaling factor 1.432 } \keyword{models} nlme/man/pdConstruct.pdBlocked.Rd0000644000176200001440000001057212222553014016446 0ustar liggesusers% File nlme/man/pdConstruct.pdBlocked.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdConstruct.pdBlocked} \title{Construct pdBlocked Objects} \usage{ \method{pdConstruct}{pdBlocked}(object, value, form, nam, data, pdClass, \dots) } \alias{pdConstruct.pdBlocked} \arguments{ \item{object}{an object inheriting from class \code{"pdBlocked"}, representing a positive definite block-diagonal matrix.} \item{value}{an optional list with elements to be used as the \code{value} argument to other \code{pdMat} constructors. These include: \code{pdMat} objects, positive-definite matrices, one-sided linear formulas, vectors of character strings, or numeric vectors. All elements in the list must be similar (e.g. all one-sided formulas, or all numeric vectors). Defaults to \code{numeric(0)}, corresponding to an uninitialized object.} \item{form}{an optional list of one-sided linear formula specifying the row/column names for the block-diagonal elements of the matrix represented by \code{object}. Because factors may be present in \code{form}, the formulas needs to be evaluated on a data.frame to resolve the names they defines. This argument is ignored when \code{value} is a list of one-sided formulas. Defaults to \code{NULL}.} \item{nam}{an optional list of vector of character strings specifying the row/column names for the block-diagonal elements of the matrix represented by object. Each of its components must have length equal to the dimension of the corresponding block-diagonal element and unreplicated elements. This argument is ignored when \code{value} is a list of vector of character strings. Defaults to \code{NULL}.} \item{data}{an optional data frame in which to evaluate the variables named in \code{value} and \code{form}. It is used to obtain the levels for \code{factors}, which affect the dimensions and the row/column names of the underlying matrix. If \code{NULL}, no attempt is made to obtain information on \code{factors} appearing in the formulas. Defaults to the parent frame from which the function was called.} \item{pdClass}{an optional vector of character strings naming the \code{pdMat} classes to be assigned to the individual blocks in the underlying matrix. If a single class is specified, it is used for all block-diagonal elements. This argument will only be used when \code{value} is missing, or its elements are not \code{pdMat} objects. Defaults to \code{"pdSymm"}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This function give an alternative constructor for the \code{pdBlocked} class, representing a positive-definite block-diagonal matrix. Each block-diagonal element of the underlying matrix is itself a positive-definite matrix and is represented internally as an individual \code{pdMat} object. When \code{value} is \code{numeric(0)}, a list of uninitialized \code{pdMat} objects, a list of one-sided formulas, or a list of vectors of character strings, \code{object} is returned as an uninitialized \code{pdBlocked} object (with just some of its attributes and its class defined) and needs to have its coefficients assigned later, generally using the \code{coef} or \code{matrix} replacement functions. If \code{value} is a list of initialized \code{pdMat} objects, \code{object} will be constructed from the list obtained by applying \code{as.matrix} to each of the \code{pdMat} elements of \code{value}. Finally, if \code{value} is a list of numeric vectors, they are assumed to represent the unrestricted coefficients of the block-diagonal elements of the underlying positive-definite matrix. } \value{ a \code{pdBlocked} object representing a positive-definite block-diagonal matrix, also inheriting from class \code{pdMat}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.pdMat}}, \code{\link{coef.pdMat}}, \code{\link{pdBlocked}}, \code{\link{pdClasses}}, \code{\link{pdConstruct}}, \code{\link{matrix<-.pdMat}}} \examples{ pd1 <- pdBlocked(list(c("A","B"), c("a1", "a2", "a3"))) pdConstruct(pd1, list(diag(1:2), diag(c(0.1, 0.2, 0.3)))) } \keyword{models} nlme/man/residuals.glsStruct.Rd0000644000176200001440000000263312222553014016233 0ustar liggesusers% File nlme/man/residuals.glsStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{residuals.glsStruct} \title{Calculate glsStruct Residuals} \usage{ \method{residuals}{glsStruct}(object, glsFit, \dots) } \alias{residuals.glsStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{glsStruct}"}, representing a list of linear model components, such as \code{corStruct} and \code{"\link{varFunc}"} objects.} \item{glsFit}{an optional list with components \code{logLik} (log-likelihood), \code{beta} (coefficients), \code{sigma} (standard deviation for error term), \code{varBeta} (coefficients' covariance matrix), \code{fitted} (fitted values), and \code{residuals} (residuals). Defaults to \code{attr(object, "glsFit")}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The residuals for the linear model represented by \code{object} are extracted. } \value{ a vector with the residuals for the linear model represented by \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ This method function is primarily used inside \code{gls} and \code{residuals.gls}. } \seealso{\code{\link{gls}}, \code{\link{glsStruct}}, \code{\link{residuals.gls}}, \code{\link{fitted.glsStruct}} } \keyword{models} nlme/man/plot.ranef.lme.Rd0000644000176200001440000001201213331020316015057 0ustar liggesusers% File nlme/man/plot.ranef.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.ranef.lme} \title{Plot a ranef.lme Object} \description{ Plots (class \code{"Trellis"} from package \CRANpkg{lattice}) of the random effects from linear mixed effects model, i.e., the result of \code{\link{ranef}(\link{lme}(*))} (of class \code{"\link{ranef.lme}"}). } \usage{ \method{plot}{ranef.lme}(x, form = NULL, omitFixed = TRUE, level = Q, grid = TRUE, control, xlab, ylab, strip, \dots) } \alias{plot.ranef.lme} \arguments{ \item{x}{an object inheriting from class \code{"\link{ranef.lme}"}, representing the estimated coefficients or estimated random effects for the \code{lme} object from which it was produced.} \item{form}{an optional formula specifying the desired type of plot. \itemize{ \item If given as a one-sided formula, a \code{\link[lattice]{dotplot}()} of the estimated random effects (coefficients) grouped according to all combinations of the levels of the factors named in \code{form} is returned. \item If given as a two-sided formula (or by default, \code{NULL}), an \code{\link[lattice]{xyplot}()} Trellis display of the random effect (coefficient) versus the named covariates is returned. In \code{NULL} case the row names of the random effects (coefficients) are used (as covariates). } See also \sQuote{Details:}. } \item{omitFixed}{an optional logical value indicating whether columns with values that are constant across groups should be omitted. Default is \code{TRUE}.} \item{level}{an optional integer value giving the level of grouping to be used for \code{x}. Only used when \code{x} is a list with different components for each grouping level. Defaults to the highest or innermost level of grouping.} \item{grid}{an optional logical value indicating whether a grid should be added to plot. Only applies to plots associated with two-sided formulas in \code{form}. Default is \code{TRUE}.} \item{control}{an optional list with control values for the plot, when \code{form} is given as a two-sided formula. The control values are referenced by name in the \code{control} list and only the ones to be modified from the default need to be specified. Available values include: \code{drawLine}, a logical value indicating whether a \code{loess} smoother should be added to the scatter plots and a line connecting the medians should be added to the boxplots (default is \code{TRUE}); \code{span.loess}, used as the \code{span} argument in the call to \code{panel.loess} (default is \code{2/3}); \code{degree.loess}, used as the \code{degree} argument in the call to \code{panel.loess} (default is \code{1}); \code{cex.axis}, the character expansion factor for the x-axis (default is \code{0.8}); \code{srt.axis}, the rotation factor for the x-axis (default is \code{0}); and \code{mgp.axis}, the margin parameters for the x-axis (default is \code{c(2, 0.5, 0)}).} \item{xlab, ylab}{axis labels, each with a sensible default.} \item{strip}{a \code{\link{function}} or \code{FALSE}, see \code{\link[lattice]{dotplot}()} from package \CRANpkg{lattice}.} \item{\dots}{optional arguments passed to the Trellis \code{dotplot} function.} } \details{ If \code{form} is missing, or is given as a one-sided formula, a Trellis dot-plot (via \code{\link[lattice]{dotplot}()} from pkg \CRANpkg{lattice}) of the random effects is generated, with a different panel for each random effect (coefficient). Rows in the dot-plot are determined by the \code{form} argument (if not missing) or by the row names of the random effects (coefficients). Single factors (\code{~g}) or crossed factors (\code{~g1*g2}) are allowed. For a single factor, its levels determine the dot-plot rows (with possibly multiple dots per row); otherwise, if \code{form} specifies a crossing of factors, the dot-plot rows are determined by all combinations of the levels of the individual factors in the formula. If \code{form} is a two-sided formula, the left hand side must be a single random effect (coefficient) and the right hand side is formed by covariates in \code{x} separated by \code{+}. An \code{\link[lattice]{xyplot}()} Trellis display is generated, with a different panel for each variable listed in the right hand side of \code{form}. Scatter plots are generated for numeric variables and boxplots are generated for categorical (\code{factor} or \code{ordered}) variables. } \value{ a Trellis plot of the estimated random-effects (coefficients) versus covariates, or groups. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{ranef.lme}}, \code{\link{lme}}, \code{\link{dotplot}}. } \examples{ fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject) plot(ranef(fm1)) fm1RE <- ranef(fm1, aug = TRUE) plot(fm1RE, form = ~ Sex) plot(fm1RE, form = age ~ Sex) # "connected" boxplots } \keyword{models} nlme/man/Alfalfa.Rd0000644000176200001440000000336112222456762013610 0ustar liggesusers% File nlme/man/Alfalfa.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Alfalfa} \alias{Alfalfa} \title{Split-Plot Experiment on Varieties of Alfalfa} \description{ The \code{Alfalfa} data frame has 72 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{Variety}{ a factor with levels \code{Cossack}, \code{Ladak}, and \code{Ranger} } \item{Date}{ a factor with levels \code{None} \code{S1} \code{S20} \code{O7} } \item{Block}{ a factor with levels \code{1} \code{2} \code{3} \code{4} \code{5} \code{6} } \item{Yield}{ a numeric vector } } } \details{ These data are described in Snedecor and Cochran (1980) as an example of a split-plot design. The treatment structure used in the experiment was a 3\eqn{ x }{\times}4 full factorial, with three varieties of alfalfa and four dates of third cutting in 1943. The experimental units were arranged into six blocks, each subdivided into four plots. The varieties of alfalfa (\emph{Cossac}, \emph{Ladak}, and \emph{Ranger}) were assigned randomly to the blocks and the dates of third cutting (\emph{None}, \emph{S1}---September 1, \emph{S20}---September 20, and \emph{O7}---October 7) were randomly assigned to the plots. All four dates were used on each block. } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.1) Snedecor, G. W. and Cochran, W. G. (1980), \emph{Statistical Methods (7th ed)}, Iowa State University Press, Ames, IA } %\examples{} \keyword{datasets} nlme/man/pdIdent.Rd0000644000176200001440000000630212222553014013633 0ustar liggesusers% File nlme/man/pdIdent.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdIdent} \title{Multiple of the Identity Positive-Definite Matrix} \usage{ pdIdent(value, form, nam, data) } \alias{pdIdent} \arguments{ \item{value}{an optional initialization value, which can be any of the following: a \code{pdMat} object, a positive-definite matrix, a one-sided linear formula (with variables separated by \code{+}), a vector of character strings, or a numeric value. Defaults to \code{numeric(0)}, corresponding to an uninitialized object.} \item{form}{an optional one-sided linear formula specifying the row/column names for the matrix represented by \code{object}. Because factors may be present in \code{form}, the formula needs to be evaluated on a data.frame to resolve the names it defines. This argument is ignored when \code{value} is a one-sided formula. Defaults to \code{NULL}.} \item{nam}{an optional vector of character strings specifying the row/column names for the matrix represented by object. It must have length equal to the dimension of the underlying positive-definite matrix and unreplicated elements. This argument is ignored when \code{value} is a vector of character strings. Defaults to \code{NULL}.} \item{data}{an optional data frame in which to evaluate the variables named in \code{value} and \code{form}. It is used to obtain the levels for \code{factors}, which affect the dimensions and the row/column names of the underlying matrix. If \code{NULL}, no attempt is made to obtain information on \code{factors} appearing in the formulas. Defaults to the parent frame from which the function was called.} } \description{ This function is a constructor for the \code{pdIdent} class, representing a multiple of the identity positive-definite matrix. The matrix associated with \code{object} is represented by 1 unrestricted parameter, given by the logarithm of the square-root of the diagonal value. When \code{value} is \code{numeric(0)}, an uninitialized \code{pdMat} object, a one-sided formula, or a vector of character strings, \code{object} is returned as an uninitialized \code{pdIdent} object (with just some of its attributes and its class defined) and needs to have its coefficients assigned later, generally using the \code{coef} or \code{matrix} replacement functions. If \code{value} is an initialized \code{pdMat} object, \code{object} will be constructed from \code{as.matrix(value)}. Finally, if \code{value} is a numeric value, it is assumed to represent the unrestricted coefficient of the underlying positive-definite matrix. } \value{ a \code{pdIdent} object representing a multiple of the identity positive-definite matrix, also inheriting from class \code{pdMat}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.pdMat}}, \code{\link{coef.pdMat}}, \code{\link{pdClasses}}, \code{\link{matrix<-.pdMat}}} \examples{ pd1 <- pdIdent(4 * diag(3), nam = c("A","B","C")) pd1 } \keyword{models} nlme/man/Assay.Rd0000644000176200001440000000402312222456762013336 0ustar liggesusers% File nlme/man/Assay.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Assay} \alias{Assay} \title{Bioassay on Cell Culture Plate} \description{ The \code{Assay} data frame has 60 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{Block}{ an ordered factor with levels \code{2} < \code{1} identifying the block where the wells are measured. } \item{sample}{ a factor with levels \code{a} to \code{f} identifying the sample corresponding to the well. } \item{dilut}{ a factor with levels \code{1} to \code{5} indicating the dilution applied to the well } \item{logDens}{ a numeric vector of the log-optical density } } } \details{ These data, courtesy of Rich Wolfe and David Lansky from Searle, Inc., come from a bioassay run on a 96-well cell culture plate. The assay is performed using a split-block design. The 8 rows on the plate are labeled A--H from top to bottom and the 12 columns on the plate are labeled 1--12 from left to right. Only the central 60 wells of the plate are used for the bioassay (the intersection of rows B--G and columns 2--11). There are two blocks in the design: Block 1 contains columns 2--6 and Block 2 contains columns 7--11. Within each block, six samples are assigned randomly to rows and five (serial) dilutions are assigned randomly to columns. The response variable is the logarithm of the optical density. The cells are treated with a compound that they metabolize to produce the stain. Only live cells can make the stain, so the optical density is a measure of the number of cells that are alive and healthy.} \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.2) } %\examples{} \keyword{datasets} nlme/man/residuals.gnlsStruct.Rd0000644000176200001440000000220312222553014016402 0ustar liggesusers% File nlme/man/residuals.gnlsStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{residuals.gnlsStruct} \title{Calculate gnlsStruct Residuals} \usage{ \method{residuals}{gnlsStruct}(object, \dots) } \alias{residuals.gnlsStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{gnlsStruct}"}, representing a list of model components, such as \code{corStruct} and \code{varFunc} objects, and attributes specifying the underlying nonlinear model and the response variable.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The residuals for the nonlinear model represented by \code{object} are extracted. } \value{ a vector with the residuals for the nonlinear model represented by \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ This method function is primarily used inside \code{gnls} and \code{residuals.gnls}. } \seealso{\code{\link{gnls}}, \code{\link{residuals.gnls}}, \code{\link{fitted.gnlsStruct}} } \keyword{models} nlme/man/lmeControl.Rd0000644000176200001440000001207213422625274014376 0ustar liggesusers% File nlme/man/lmeControl.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see ../LICENCE.note \name{lmeControl} \title{Specifying Control Values for lme Fit} \alias{lmeControl} \description{ The values supplied in the \code{lmeControl()} call replace the defaults, and a \code{\link{list}} with all settings (i.e., values for all possible arguments) is returned. The returned list is used as the \code{control} argument to the \code{lme} function. } \usage{ lmeControl(maxIter = 50, msMaxIter = 50, tolerance = 1e-6, niterEM = 25, msMaxEval = 200, msTol = 1e-7, msVerbose = FALSE, returnObject = FALSE, gradHess = TRUE, apVar = TRUE, .relStep = .Machine$double.eps^(1/3), minAbsParApVar = 0.05, opt = c("nlminb", "optim"), optimMethod = "BFGS", natural = TRUE, sigma = NULL, allow.n.lt.q = FALSE, \dots) } \arguments{ \item{maxIter}{maximum number of iterations for the \code{lme} optimization algorithm. Default is \code{50}.} \item{msMaxIter}{maximum number of iterations for the optimization step inside the \code{lme} optimization. Default is \code{50}.} \item{tolerance}{tolerance for the convergence criterion in the \code{lme} algorithm. Default is \code{1e-6}.} \item{niterEM}{number of iterations for the EM algorithm used to refine the initial estimates of the random effects variance-covariance coefficients. Default is \code{25}.} \item{msMaxEval}{maximum number of evaluations of the objective function permitted for nlminb. Default is \code{200}.} \item{msTol}{tolerance for the convergence criterion on the first iteration when \code{optim} is used. Default is \code{1e-7}.} \item{msVerbose}{a logical value passed as the \code{trace} argument to \code{\link{nlminb}} or \code{\link{optim}}. Default is \code{FALSE}.} \item{returnObject}{a logical value indicating whether the fitted object should be returned with a \code{\link{warning}} (instead of an error via \code{\link{stop}()}) when the maximum number of iterations is reached without convergence of the algorithm. Default is \code{FALSE}.} \item{gradHess}{a logical value indicating whether numerical gradient vectors and Hessian matrices of the log-likelihood function should be used in the internal optimization. This option is only available when the correlation structure (\code{corStruct}) and the variance function structure (\code{varFunc}) have no "varying" parameters and the \code{pdMat} classes used in the random effects structure are \code{pdSymm} (general positive-definite), \code{pdDiag} (diagonal), \code{pdIdent} (multiple of the identity), or \code{pdCompSymm} (compound symmetry). Default is \code{TRUE}.} \item{apVar}{a logical value indicating whether the approximate covariance matrix of the variance-covariance parameters should be calculated. Default is \code{TRUE}.} \item{.relStep}{relative step for numerical derivatives calculations. Default is \code{.Machine$double.eps^(1/3)}.} \item{opt}{the optimizer to be used, either \code{"\link{nlminb}"} (the default) or \code{"\link{optim}"}.} \item{optimMethod}{character - the optimization method to be used with the \code{\link{optim}} optimizer. The default is \code{"BFGS"}. An alternative is \code{"L-BFGS-B"}.} \item{minAbsParApVar}{numeric value - minimum absolute parameter value in the approximate variance calculation. The default is \code{0.05}.} \item{natural}{a logical value indicating whether the \code{pdNatural} parametrization should be used for general positive-definite matrices (\code{pdSymm}) in \code{reStruct}, when the approximate covariance matrix of the estimators is calculated. Default is \code{TRUE}.} \item{sigma}{optionally a positive number to fix the residual error at. If \code{NULL}, as by default, or \code{0}, sigma is estimated.} \item{allow.n.lt.q}{\code{\link{logical}} indicating if it is ok to have less observations than random effects for each group. The default, \code{FALSE} signals an error; if \code{NA}, such a situation only gives a warning, as in \pkg{nlme} versions prior to 2019; if true, no message is given at all.} %% msg: "fewer observations than random effects in all level groups" \item{\dots}{further named control arguments to be passed, depending on \code{opt}, to \code{\link{nlminb}} (those from \code{abs.tol} down) or \code{\link{optim}} (those except \code{trace} and \code{maxit}; \code{reltol} is used only from the second iteration).} } \value{ a list with components for each of the possible arguments. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}; the \code{sigma} option: Siem Heisterkamp and Bert van Willigen.} \seealso{\code{\link{lme}}, \code{\link{nlminb}}, \code{\link{optim}}} \examples{ # decrease the maximum number iterations in the ms call and # request that information on the evolution of the ms iterations be printed str(lCtr <- lmeControl(msMaxIter = 20, msVerbose = TRUE)) ## This should always work: do.call(lmeControl, lCtr) } \keyword{models} nlme/man/getGroups.gls.Rd0000644000176200001440000000344212222553014015011 0ustar liggesusers% File nlme/man/getGroups.gls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getGroups.gls} \title{Extract gls Object Groups} \usage{ \method{getGroups}{gls}(object, form, level, data, sep) } \alias{getGroups.gls} \arguments{ \item{object}{an object inheriting from class \code{gls}, representing a generalized least squares fitted linear model.} \item{form}{an optional formula with a conditioning expression on its right hand side (i.e. an expression involving the \code{|} operator). Defaults to \code{formula(object)}. Not used.} \item{level}{a positive integer vector with the level(s) of grouping to be used when multiple nested levels of grouping are present. This argument is optional for most methods of this generic function and defaults to all levels of nesting. Not used.} \item{data}{a data frame in which to interpret the variables named in \code{form}. Optional for most methods. Not used.} \item{sep}{character, the separator to use between group levels when multiple levels are collapsed. The default is \code{'/'}. Not used.} } \description{ If present, the grouping factor associated to the correlation structure for the linear model represented by \code{object} is extracted. } \value{ if the linear model represented by \code{object} incorporates a correlation structure and the corresponding \code{corStruct} object has a grouping factor, a vector with the group values is returned; else, \code{NULL} is returned. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gls}}, \code{\link{corClasses}}} \examples{ fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) getGroups(fm1) } \keyword{models} nlme/man/qqnorm.lme.Rd0000644000176200001440000000747012707672664014371 0ustar liggesusers% File nlme/man/qqnorm.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{qqnorm.lme} \title{Normal Plot of Residuals or Random Effects from an lme Object} \usage{ \method{qqnorm}{lme}(y, form, abline, id, idLabels, grid, \dots) } \alias{qqnorm.lm} \alias{qqnorm.lme} \alias{qqnorm.lmList} \alias{qqnorm.nls} \arguments{ \item{y}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model or from class \code{"\link{lmList}"}, representing a list of \code{lm} objects, or from class \code{"lm"}, representing a fitted linear model, or from class \code{"nls"}, representing a nonlinear least squares fitted model.} \item{form}{an optional one-sided formula specifying the desired type of plot. Any variable present in the original data frame used to obtain \code{y} can be referenced. In addition, \code{y} itself can be referenced in the formula using the symbol \code{"."}. Conditional expressions on the right of a \code{|} operator can be used to define separate panels in a Trellis display. The expression on the right hand side of \code{form} and to the left of a \code{|} operator must evaluate to a residuals vector, or a random effects matrix. Default is \code{~ resid(., type = "p")}, corresponding to a normal plot of the standardized residuals evaluated at the innermost level of nesting.} \item{abline}{an optional numeric value, or numeric vector of length two. If given as a single value, a horizontal line will be added to the plot at that coordinate; else, if given as a vector, its values are used as the intercept and slope for a line added to the plot. If missing, no lines are added to the plot.} \item{id}{an optional numeric value, or one-sided formula. If given as a value, it is used as a significance level for a two-sided outlier test for the standardized residuals (random effects). Observations with absolute standardized residuals (random effects) greater than the \eqn{1 - value/2} quantile of the standard normal distribution are identified in the plot using \code{idLabels}. If given as a one-sided formula, its right hand side must evaluate to a logical, integer, or character vector which is used to identify observations in the plot. If missing, no observations are identified.} \item{idLabels}{an optional vector, or one-sided formula. If given as a vector, it is converted to character and used to label the observations identified according to \code{id}. If given as a one-sided formula, its right hand side must evaluate to a vector which is converted to character and used to label the identified observations. Default is the innermost grouping factor.} \item{grid}{an optional logical value indicating whether a grid should be added to plot. Default is \code{FALSE}.} \item{\dots}{optional arguments passed to the Trellis plot function.} } \description{ Diagnostic plots for assessing the normality of residuals and random effects in the linear mixed-effects fit are obtained. The \code{form} argument gives considerable flexibility in the type of plot specification. A conditioning expression (on the right side of a \code{|} operator) always implies that different panels are used for each level of the conditioning factor, according to a Trellis display. } \value{ a diagnostic Trellis plot for assessing normality of residuals or random effects. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{plot.lme}}} \examples{ fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject) ## normal plot of standardized residuals by gender qqnorm(fm1, ~ resid(., type = "p") | Sex, abline = c(0, 1)) ## normal plots of random effects qqnorm(fm1, ~ranef(.)) } \keyword{models} nlme/man/getCovariate.varFunc.Rd0000644000176200001440000000220112222553014016256 0ustar liggesusers% File nlme/man/getCovariate.varFunc.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getCovariate.varFunc} \title{Extract varFunc Covariate} \usage{ \method{getCovariate}{varFunc}(object, form, data) } \alias{getCovariate.varFunc} \arguments{ \item{object}{an object inheriting from class \code{varFunc}, representing a variance function structure.} \item{form}{an optional formula specifying the covariate to be evaluated in \code{object}. Defaults to \code{formula(object)}.} \item{data}{some methods for this generic require a \code{data} object. Not used in this method.} } \description{ This method function extracts the covariate(s) associated with the variance function represented by \code{object}, if any is present. } \value{ if \code{object} has a \code{covariate} attribute, its value is returned; else \code{NULL} is returned. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{covariate<-.varFunc}}} \examples{ vf1 <- varPower(1.1, form = ~age) covariate(vf1) <- Orthodont[["age"]] getCovariate(vf1) } \keyword{models} nlme/man/corARMA.Rd0000644000176200001440000000654512222553014013501 0ustar liggesusers% File nlme/man/corARMA.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corARMA} \title{ARMA(p,q) Correlation Structure} \usage{ corARMA(value, form, p, q, fixed) } \alias{corARMA} \alias{coef.corARMA} \arguments{ \item{value}{a vector with the values of the autoregressive and moving average parameters, which must have length \code{p + q} and all elements between -1 and 1. Defaults to a vector of zeros, corresponding to uncorrelated observations.} \item{form}{a one sided formula of the form \code{~ t}, or \code{~ t | g}, specifying a time covariate \code{t} and, optionally, a grouping factor \code{g}. A covariate for this correlation structure must be integer valued. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{p, q}{non-negative integers specifying respectively the autoregressive order and the moving average order of the \code{ARMA} structure. Both default to 0.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{corARMA} class, representing an autocorrelation-moving average correlation structure of order (p, q). Objects created using this constructor must later be initialized using the appropriate \code{Initialize} method. } \value{ an object of class \code{corARMA}, representing an autocorrelation-moving average correlation structure. } \references{ Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden-Day. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. pp. 236, 397. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corAR1}}, \code{\link{corClasses}} \code{\link{Initialize.corStruct}}, \code{\link{summary.corStruct}} } \examples{ ## ARMA(1,2) structure, with observation order as a covariate and ## Mare as grouping factor cs1 <- corARMA(c(0.2, 0.3, -0.1), form = ~ 1 | Mare, p = 1, q = 2) # Pinheiro and Bates, p. 237 cs1ARMA <- corARMA(0.4, form = ~ 1 | Subject, q = 1) cs1ARMA <- Initialize(cs1ARMA, data = Orthodont) corMatrix(cs1ARMA) cs2ARMA <- corARMA(c(0.8, 0.4), form = ~ 1 | Subject, p=1, q=1) cs2ARMA <- Initialize(cs2ARMA, data = Orthodont) corMatrix(cs2ARMA) # Pinheiro and Bates use in nlme: # from p. 240 needed on p. 396 fm1Ovar.lme <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data = Ovary, random = pdDiag(~sin(2*pi*Time))) fm5Ovar.lme <- update(fm1Ovar.lme, corr = corARMA(p = 1, q = 1)) # p. 396 fm1Ovar.nlme <- nlme(follicles~ A+B*sin(2*pi*w*Time)+C*cos(2*pi*w*Time), data=Ovary, fixed=A+B+C+w~1, random=pdDiag(A+B+w~1), start=c(fixef(fm5Ovar.lme), 1) ) # p. 397 fm3Ovar.nlme <- update(fm1Ovar.nlme, corr=corARMA(p=0, q=2) ) } \keyword{models} nlme/man/corSpher.Rd0000644000176200001440000001065112222553014014033 0ustar liggesusers% File nlme/man/corSpher.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corSpher} \title{Spherical Correlation Structure} \usage{ corSpher(value, form, nugget, metric, fixed) } \alias{corSpher} \arguments{ \item{value}{an optional vector with the parameter values in constrained form. If \code{nugget} is \code{FALSE}, \code{value} can have only one element, corresponding to the "range" of the spherical correlation structure, which must be greater than zero. If \code{nugget} is \code{TRUE}, meaning that a nugget effect is present, \code{value} can contain one or two elements, the first being the "range" and the second the "nugget effect" (one minus the correlation between two observations taken arbitrarily close together); the first must be greater than zero and the second must be between zero and one. Defaults to \code{numeric(0)}, which results in a range of 90\% of the minimum distance and a nugget effect of 0.1 being assigned to the parameters when \code{object} is initialized.} \item{form}{a one sided formula of the form \code{~ S1+...+Sp}, or \code{~ S1+...+Sp | g}, specifying spatial covariates \code{S1} through \code{Sp} and, optionally, a grouping factor \code{g}. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{nugget}{an optional logical value indicating whether a nugget effect is present. Defaults to \code{FALSE}.} \item{metric}{an optional character string specifying the distance metric to be used. The currently available options are \code{"euclidean"} for the root sum-of-squares of distances; \code{"maximum"} for the maximum difference; and \code{"manhattan"} for the sum of the absolute differences. Partial matching of arguments is used, so only the first three characters need to be provided. Defaults to \code{"euclidean"}.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{corSpher} class, representing a spherical spatial correlation structure. Letting \eqn{d} denote the range and \eqn{n} denote the nugget effect, the correlation between two observations a distance \eqn{r < d} apart is \eqn{1-1.5(r/d)+0.5(r/d)^3} when no nugget effect is present and \eqn{(1-n) (1-1.5(r/d)+0.5(r/d)^3)}{(1-n)*(1-1.5(r/d)+0.5(r/d)^3)} when a nugget effect is assumed. If \eqn{r \geq d}{r >= d} the correlation is zero. Objects created using this constructor must later be initialized using the appropriate \code{Initialize} method. } \value{ an object of class \code{corSpher}, also inheriting from class \code{corSpatial}, representing a spherical spatial correlation structure. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. Littel, Milliken, Stroup, and Wolfinger (1996) "SAS Systems for Mixed Models", SAS Institute. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{Initialize.corStruct}}, \code{\link{summary.corStruct}}, \code{\link{dist}} } \examples{ sp1 <- corSpher(form = ~ x + y) # example lme(..., corSpher ...) # Pinheiro and Bates, pp. 222-249 fm1BW.lme <- lme(weight ~ Time * Diet, BodyWeight, random = ~ Time) # p. 223 fm2BW.lme <- update(fm1BW.lme, weights = varPower()) # p 246 fm3BW.lme <- update(fm2BW.lme, correlation = corExp(form = ~ Time)) # p. 249 fm6BW.lme <- update(fm3BW.lme, correlation = corSpher(form = ~ Time)) # example gls(..., corSpher ...) # Pinheiro and Bates, pp. 261, 263 fm1Wheat2 <- gls(yield ~ variety - 1, Wheat2) # p. 262 fm2Wheat2 <- update(fm1Wheat2, corr = corSpher(c(28, 0.2), form = ~ latitude + longitude, nugget = TRUE)) } \keyword{models} nlme/man/Orthodont.Rd0000644000176200001440000000350112222456762014236 0ustar liggesusers% File nlme/man/Orthodont.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Orthodont} \alias{Orthodont} \title{Growth curve data on an orthdontic measurement} \description{ The \code{Orthodont} data frame has 108 rows and 4 columns of the change in an orthdontic measurement over time for several young subjects. } \format{ This data frame contains the following columns: \describe{ \item{distance}{ a numeric vector of distances from the pituitary to the pterygomaxillary fissure (mm). These distances are measured on x-ray images of the skull. } \item{age}{ a numeric vector of ages of the subject (yr). } \item{Subject}{ an ordered factor indicating the subject on which the measurement was made. The levels are labelled \code{M01} to \code{M16} for the males and \code{F01} to \code{F13} for the females. The ordering is by increasing average distance within sex. } \item{Sex}{ a factor with levels \code{Male} and \code{Female} } } } \details{ Investigators at the University of North Carolina Dental School followed the growth of 27 children (16 males, 11 females) from age 8 until age 14. Every two years they measured the distance between the pituitary and the pterygomaxillary fissure, two points that are easily identified on x-ray exposures of the side of the head. } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.17) Potthoff, R. F. and Roy, S. N. (1964), ``A generalized multivariate analysis of variance model useful especially for growth curve problems'', \emph{Biometrika}, \bold{51}, 313--326. } \examples{ formula(Orthodont) plot(Orthodont) } \keyword{datasets} nlme/man/summary.corStruct.Rd0000644000176200001440000000331412222553014015730 0ustar liggesusers% File nlme/man/summary.corStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{summary.corStruct} \title{Summarize a corStruct Object} \usage{ \method{summary}{corStruct}(object, structName, \dots) } \alias{summary.corStruct} \alias{summary.corAR1} \alias{summary.corARMA} \alias{summary.corCAR1} \alias{summary.corCompSymm} \alias{summary.corExp} \alias{summary.corGaus} \alias{summary.corIdent} \alias{summary.corLin} \alias{summary.corNatural} \alias{summary.corRatio} \alias{summary.corSpher} \alias{summary.corSymm} \arguments{ \item{object}{an object inheriting from class \code{"\link{corStruct}"}, representing a correlation structure.} \item{structName}{an optional character string defining the type of correlation structure associated with \code{object}, to be used in the \code{print.summary} method. Defaults to \code{class(object)[1]}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function prepares \code{object} to be printed using the \code{print.summary} method, by changing its class and adding a \code{structName} attribute to it. } \value{ an object identical to \code{object}, but with its class changed to \code{summary.corStruct} and an additional attribute \code{structName}. The returned value inherits from the same classes as \code{object}. } \author{José Pinheiro and Douglas Bates } \seealso{ \code{\link{corClasses}}, \code{\link{corNatural}}, \code{\link{Initialize.corStruct}}, \code{\link{summary}} } %\seealso{\code{\link{print.summary.corStruct}}} \examples{ cs1 <- corAR1(0.2) summary(cs1) } \keyword{models} nlme/man/Initialize.reStruct.Rd0000644000176200001440000000367212222553014016166 0ustar liggesusers% File nlme/man/Initialize.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Initialize.reStruct} \title{Initialize reStruct Object} \usage{ \method{Initialize}{reStruct}(object, data, conLin, control, \dots) } \alias{Initialize.reStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} \item{data}{a data frame in which to evaluate the variables defined in \code{formula(object)}.} \item{conLin}{a condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying model.} \item{control}{an optional list with a single component \code{niterEM} controlling the number of iterations for the EM algorithm used to refine initial parameter estimates. It is given as a list for compatibility with other \code{Initialize} methods. Defaults to \code{list(niterEM = 20)}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ Initial estimates for the parameters in the \code{pdMat} objects forming \code{object}, which have not yet been initialized, are obtained using the methodology described in Bates and Pinheiro (1998). These estimates may be refined using a series of EM iterations, as described in Bates and Pinheiro (1998). The number of EM iterations to be used is defined in \code{control}. } \value{ an \code{reStruct} object similar to \code{object}, but with all \code{pdMat} components initialized. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{reStruct}}, \code{\link{pdMat}}, \code{\link{Initialize}} } \keyword{models} nlme/man/glsControl.Rd0000644000176200001440000000624113054772245014411 0ustar liggesusers% File nlme/man/glsControl.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{glsControl} \title{Control Values for gls Fit} \usage{ glsControl(maxIter, msMaxIter, tolerance, msTol, msVerbose, singular.ok, returnObject = FALSE, apVar, .relStep, opt = c("nlminb", "optim"), optimMethod, minAbsParApVar, natural, sigma = NULL) } \alias{glsControl} \arguments{ \item{maxIter}{maximum number of iterations for the \code{gls} optimization algorithm. Default is 50.} \item{msMaxIter}{maximum number of iterations for the optimization step inside the \code{gls} optimization. Default is 50.} \item{tolerance}{tolerance for the convergence criterion in the \code{gls} algorithm. Default is 1e-6.} \item{msTol}{tolerance for the convergence criterion of the first outer iteration when \code{optim} is used. Default is 1e-7.} \item{msVerbose}{a logical value passed as the \code{trace} argument to \code{ms} (see documentation on that function). Default is \code{FALSE}.} \item{singular.ok}{a logical value indicating whether non-estimable coefficients (resulting from linear dependencies among the columns of the regression matrix) should be allowed. Default is \code{FALSE}.} \item{returnObject}{a logical value indicating whether the fitted object should be returned when the maximum number of iterations is reached without convergence of the algorithm. Default is \code{FALSE}.} \item{apVar}{a logical value indicating whether the approximate covariance matrix of the variance-covariance parameters should be calculated. Default is \code{TRUE}.} \item{.relStep}{relative step for numerical derivatives calculations. Default is \code{.Machine$double.eps^(1/3)}.} \item{opt}{the optimizer to be used, either \code{"\link{nlminb}"} (the current default) or \code{"\link{optim}"} (the previous default).} \item{optimMethod}{character - the optimization method to be used with the \code{\link{optim}} optimizer. The default is \code{"BFGS"}. An alternative is \code{"L-BFGS-B"}.} \item{minAbsParApVar}{numeric value - minimum absolute parameter value in the approximate variance calculation. The default is \code{0.05}.} \item{natural}{logical. Should the natural parameterization be used for the approximate variance calculations? Default is \code{TRUE}.} \item{sigma}{optionally a positive number to fix the residual error at. If \code{NULL}, as by default, or \code{0}, sigma is estimated.} } \description{ The values supplied in the function call replace the defaults and a list with all possible arguments is returned. The returned list is used as the \code{control} argument to the \code{gls} function. } \value{ a list with components for each of the possible arguments. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}; the \code{sigma} option: Siem Heisterkamp and Bert van Willigen.} \seealso{\code{\link{gls}}} \examples{ # decrease the maximum number iterations in the optimization call and # request that information on the evolution of the ms iterations be printed glsControl(msMaxIter = 20, msVerbose = TRUE) } \keyword{models} nlme/man/Initialize.corStruct.Rd0000644000176200001440000000335512222553014016341 0ustar liggesusers% File nlme/man/Initialize.corStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Initialize.corStruct} \title{Initialize corStruct Object} \usage{ \method{Initialize}{corStruct}(object, data, \dots) } \alias{Initialize.corStruct} \alias{Initialize.corAR1} \alias{Initialize.corARMA} \alias{Initialize.corCAR1} \alias{Initialize.corCompSymm} \alias{Initialize.corHF} \alias{Initialize.corIdent} \alias{Initialize.corLin} \alias{Initialize.corNatural} \alias{Initialize.corSpatial} \alias{Initialize.corSpher} \alias{Initialize.corSymm} \arguments{ \item{object}{an object inheriting from class \code{"\link{corStruct}"} representing a correlation structure.} \item{data}{a data frame in which to evaluate the variables defined in \code{formula(object)}.} \item{\dots}{this argument is included to make this method compatible with the generic.} } \description{ This method initializes \code{object} by evaluating its associated covariate(s) and grouping factor, if any is present, in \code{data}, calculating various dimensions and constants used by optimization algorithms involving \code{corStruct} objects (see the appropriate \code{Dim} method documentation), and assigning initial values for the coefficients in \code{object}, if none were present. } \value{ an initialized object with the same class as \code{object} representing a correlation structure. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{Dim.corStruct}}} \examples{ cs1 <- corAR1(form = ~ 1 | Subject) cs1 <- Initialize(cs1, data = Orthodont) } \keyword{models} nlme/man/corSpatial.Rd0000644000176200001440000001064012222553014014345 0ustar liggesusers% File nlme/man/corSpatial.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corSpatial} \title{Spatial Correlation Structure} \usage{ corSpatial(value, form, nugget, type, metric, fixed) } \alias{corSpatial} \arguments{ \item{value}{an optional vector with the parameter values in constrained form. If \code{nugget} is \code{FALSE}, \code{value} can have only one element, corresponding to the "range" of the spatial correlation structure, which must be greater than zero. If \code{nugget} is \code{TRUE}, meaning that a nugget effect is present, \code{value} can contain one or two elements, the first being the "range" and the second the "nugget effect" (one minus the correlation between two observations taken arbitrarily close together); the first must be greater than zero and the second must be between zero and one. Defaults to \code{numeric(0)}, which results in a range of 90\% of the minimum distance and a nugget effect of 0.1 being assigned to the parameters when \code{object} is initialized.} \item{form}{a one sided formula of the form \code{~ S1+...+Sp}, or \code{~ S1+...+Sp | g}, specifying spatial covariates \code{S1} through \code{Sp} and, optionally, a grouping factor \code{g}. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{nugget}{an optional logical value indicating whether a nugget effect is present. Defaults to \code{FALSE}.} \item{type}{an optional character string specifying the desired type of correlation structure. Available types include \code{"spherical"}, \code{"exponential"}, \code{"gaussian"}, \code{"linear"}, and \code{"rational"}. See the documentation on the functions \code{corSpher}, \code{corExp}, \code{corGaus}, \code{corLin}, and \code{corRatio} for a description of these correlation structures. Partial matching of arguments is used, so only the first character needs to be provided.Defaults to \code{"spherical"}.} \item{metric}{an optional character string specifying the distance metric to be used. The currently available options are \code{"euclidean"} for the root sum-of-squares of distances; \code{"maximum"} for the maximum difference; and \code{"manhattan"} for the sum of the absolute differences. Partial matching of arguments is used, so only the first three characters need to be provided. Defaults to \code{"euclidean"}.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{corSpatial} class, representing a spatial correlation structure. This class is "virtual", having four "real" classes, corresponding to specific spatial correlation structures, associated with it: \code{corExp}, \code{corGaus}, \code{corLin}, \code{corRatio}, and \code{corSpher}. The returned object will inherit from one of these "real" classes, determined by the \code{type} argument, and from the "virtual" \code{corSpatial} class. Objects created using this constructor must later be initialized using the appropriate \code{Initialize} method. } \value{ an object of class determined by the \code{type} argument and also inheriting from class \code{corSpatial}, representing a spatial correlation structure. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. Littel, Milliken, Stroup, and Wolfinger (1996) "SAS Systems for Mixed Models", SAS Institute. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corExp}}, \code{\link{corGaus}}, \code{\link{corLin}}, \code{\link{corRatio}}, \code{\link{corSpher}}, \code{\link{Initialize.corStruct}}, \code{\link{summary.corStruct}}, \code{\link{dist}} } \examples{ sp1 <- corSpatial(form = ~ x + y + z, type = "g", metric = "man") } \keyword{models} nlme/man/plot.intervals.lmList.Rd0000644000176200001440000000352313331020316016471 0ustar liggesusers% File nlme/man/plot.intervals.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.intervals.lmList} \title{Plot lmList Confidence Intervals} \usage{ \method{plot}{intervals.lmList}(x, xlab = "", ylab = attr(x, "groupsName"), strip = function(...) strip.default(..., style = 1), \dots) } \alias{plot.intervals.lmList} \arguments{ \item{x}{an object inheriting from class \code{"\link{intervals.lmList}"}, representing confidence intervals and estimates for the coefficients in the \code{lm} components of the \code{lmList} object used to produce \code{x}. } \item{xlab, ylab}{axis labels, each with a sensible default.} \item{strip}{a \code{\link{function}} or \code{FALSE}, see \code{\link[lattice]{dotplot}()} from package \CRANpkg{lattice}.} \item{\dots}{optional arguments passed to the \code{dotplot} function (see above).} } \description{ A Trellis dot-plot of the confidence intervals on the linear model coefficients is generated, with a different panel for each coefficient. Rows in the dot-plot correspond to the names of the \code{lm} components of the \code{lmList} object used to produce \code{x}. The lower and upper confidence limits are connected by a line segment and the estimated coefficients are marked with a \code{"+"}. This is based on function \code{\link[lattice]{dotplot}()} from package \CRANpkg{lattice}. } \value{ a Trellis plot with the confidence intervals on the coefficients of the individual \code{lm} components of the \code{lmList} that generated \code{x}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{intervals.lmList}}, \code{\link{lmList}}, \code{\link{dotplot}}} \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) plot(intervals(fm1)) } \keyword{models} nlme/man/Names.pdBlocked.Rd0000644000176200001440000000302512222553014015174 0ustar liggesusers% File nlme/man/Names.pdBlocked.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Names.pdBlocked} \title{Names of a pdBlocked Object} \usage{ \method{Names}{pdBlocked}(object, asList, \dots) } \alias{Names.pdBlocked} \alias{Names<-.pdBlocked} \arguments{ \item{object}{an object inheriting from class \code{"\link{pdBlocked}"} representing a positive-definite matrix with block diagonal structure} \item{asList}{a logical value. If \code{TRUE} a \code{list} with the names for each block diagonal element is returned. If \code{FALSE} a character vector with all column names is returned. Defaults to \code{FALSE}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the first element of the \code{Dimnames} attribute, which contains the column names, for each block diagonal element in the matrix represented by \code{object}. } \value{ if \code{asList} is \code{FALSE}, a character vector with column names of the matrix represented by \code{object}; otherwise, if \code{asList} is \code{TRUE}, a list with components given by the column names of the individual block diagonal elements in the matrix represented by \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{Names}}, \code{\link{Names.pdMat}}} \examples{ pd1 <- pdBlocked(list(~Sex - 1, ~age - 1), data = Orthodont) Names(pd1) } \keyword{models} nlme/man/Dialyzer.Rd0000644000176200001440000000422412222456762014044 0ustar liggesusers% File nlme/man/Dialyzer.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Dialyzer} \alias{Dialyzer} \title{High-Flux Hemodialyzer} \description{ The \code{Dialyzer} data frame has 140 rows and 5 columns. } \format{ This data frame contains the following columns: \describe{ \item{Subject}{ an ordered factor with levels \code{10} < \code{8} < \code{2} < \code{6} < \code{3} < \code{5} < \code{9} < \code{7} < \code{1} < \code{4} < \code{17} < \code{20} < \code{11} < \code{12} < \code{16} < \code{13} < \code{14} < \code{18} < \code{15} < \code{19} giving the unique identifier for each subject } \item{QB}{ a factor with levels \code{200} and \code{300} giving the bovine blood flow rate (dL/min). } \item{pressure}{ a numeric vector giving the transmembrane pressure (dmHg). } \item{rate}{ the hemodialyzer ultrafiltration rate (mL/hr). } \item{index}{ index of observation within subject---1 through 7. } } } \details{ Vonesh and Carter (1992) describe data measured on high-flux hemodialyzers to assess their \emph{in vivo} ultrafiltration characteristics. The ultrafiltration rates (in mL/hr) of 20 high-flux dialyzers were measured at seven different transmembrane pressures (in dmHg). The \emph{in vitro} evaluation of the dialyzers used bovine blood at flow rates of either 200~dl/min or 300~dl/min. The data, are also analyzed in Littell, Milliken, Stroup, and Wolfinger (1996). } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.6) Vonesh, E. F. and Carter, R. L. (1992), Mixed-effects nonlinear regression for unbalanced repeated measures, \emph{Biometrics}, \bold{48}, 1-18. Littell, R. C., Milliken, G. A., Stroup, W. W. and Wolfinger, R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute, Cary, NC. } %\examples{} \keyword{datasets} nlme/man/Extract.pdMat.Rd0000644000176200001440000000312612222553014014723 0ustar liggesusers% File nlme/man/Extract.pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{[.pdMat} \title{Subscript a pdMat Object} \usage{ \method{[}{pdMat}(x, i, j, drop = TRUE) \method{[}{pdMat}(x, i, j) <- value } \alias{[.pdMat} \alias{[.pdBlocked} \alias{[<-.pdMat} \arguments{ \item{x}{an object inheriting from class \code{"\link{pdMat}"} representing a positive-definite matrix.} \item{i, j}{optional subscripts applying respectively to the rows and columns of the positive-definite matrix represented by \code{object}. When \code{i} (\code{j}) is omitted, all rows (columns) are extracted.} \item{drop}{a logical value. If \code{TRUE}, single rows or columns are converted to vectors. If \code{FALSE} the returned value retains its matrix representation.} \item{value}{a vector, or matrix, with the replacement values for the relevant piece of the matrix represented by \code{x}.} } \description{ This method function extracts sub-matrices from the positive-definite matrix represented by \code{x}. } \value{ if \code{i} and \code{j} are identical, the returned value will be \code{pdMat} object with the same class as \code{x}. Otherwise, the returned value will be a matrix. In the case a single row (or column) is selected, the returned value may be converted to a vector, according to the rules above. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{[}}, \code{\link{pdMat}}} \examples{ pd1 <- pdSymm(diag(3)) pd1[1, , drop = FALSE] pd1[1:2, 1:2] <- 3 * diag(2) } \keyword{models} nlme/man/getGroups.varFunc.Rd0000644000176200001440000000307012222553014015625 0ustar liggesusers% File nlme/man/getGroups.varFunc.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getGroups.varFunc} \title{Extract varFunc Groups} \usage{ \method{getGroups}{varFunc}(object, form, level, data, sep) } \alias{getGroups.varFunc} \arguments{ \item{object}{an object inheriting from class \code{varFunc}, representing a variance function structure.} \item{form}{an optional formula with a conditioning expression on its right hand side (i.e. an expression involving the \code{|} operator). Defaults to \code{formula(object)}. Not used.} \item{level}{a positive integer vector with the level(s) of grouping to be used when multiple nested levels of grouping are present. This argument is optional for most methods of this generic function and defaults to all levels of nesting. Not used.} \item{data}{a data frame in which to interpret the variables named in \code{form}. Optional for most methods. Not used.} \item{sep}{character, the separator to use between group levels when multiple levels are collapsed. The default is \code{'/'}. Not used.} } \description{ This method function extracts the grouping factor associated with the variance function represented by \code{object}, if any is present. } \value{ if \code{object} has a \code{groups} attribute, its value is returned; else \code{NULL} is returned. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \examples{ vf1 <- varPower(form = ~ age | Sex) vf1 <- Initialize(vf1, Orthodont) getGroups(vf1) } \keyword{models} nlme/man/groupedData.Rd0000644000176200001440000001647513336503465014533 0ustar liggesusers% File nlme/man/groupedData.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{groupedData} \title{Construct a groupedData Object} \usage{ groupedData(formula, data, order.groups, FUN, outer, inner, labels, units) \method{update}{groupedData}(object, formula, data, order.groups, FUN, outer, inner, labels, units, \dots) } \alias{groupedData} \alias{nfGroupedData}% function UNdocumented, now (2018-08) deprecated \alias{nmGroupedData}% function UNdocumented, now (2018-08) deprecated \alias{[.groupedData} \alias{as.data.frame.groupedData} \alias{update.groupedData} \arguments{ \item{object}{an object inheriting from class \code{groupedData}.} \item{formula}{a formula of the form \code{resp ~ cov | group} where \code{resp} is the response, \code{cov} is the primary covariate, and \code{group} is the grouping factor. The expression \code{1} can be used for the primary covariate when there is no other suitable candidate. Multiple nested grouping factors can be listed separated by the \code{/} symbol as in \code{fact1/fact2}. In an expression like this the \code{fact2} factor is nested within the \code{fact1} factor.} \item{data}{a data frame in which the expressions in \code{formula} can be evaluated. The resulting \code{groupedData} object will consist of the same data values in the same order but with additional attributes.} \item{order.groups}{an optional logical value, or list of logical values, indicating if the grouping factors should be converted to ordered factors according to the function \code{FUN} applied to the response from each group. If multiple levels of grouping are present, this argument can be either a single logical value (which will be repeated for all grouping levels) or a list of logical values. If no names are assigned to the list elements, they are assumed in the same order as the group levels (outermost to innermost grouping). Ordering within a level of grouping is done within the levels of the grouping factors which are outer to it. Changing the grouping factor to an ordered factor does not affect the ordering of the rows in the data frame but it does affect the order of the panels in a trellis display of the data or models fitted to the data. Defaults to \code{TRUE}.} \item{FUN}{an optional summary function that will be applied to the values of the response for each level of the grouping factor, when \code{order.groups = TRUE}, to determine the ordering. Defaults to the \code{max} function.} \item{outer}{an optional one-sided formula, or list of one-sided formulas, indicating covariates that are outer to the grouping factor(s). If multiple levels of grouping are present, this argument can be either a single one-sided formula, or a list of one-sided formulas. If no names are assigned to the list elements, they are assumed in the same order as the group levels (outermost to innermost grouping). An outer covariate is invariant within the sets of rows defined by the grouping factor. Ordering of the groups is done in such a way as to preserve adjacency of groups with the same value of the outer variables. When plotting a groupedData object, the argument \code{outer = TRUE} causes the panels to be determined by the \code{outer} formula. The points within the panels are associated by level of the grouping factor. Defaults to \code{NULL}, meaning that no outer covariates are present.} \item{inner}{an optional one-sided formula, or list of one-sided formulas, indicating covariates that are inner to the grouping factor(s). If multiple levels of grouping are present, this argument can be either a single one-sided formula, or a list of one-sided formulas. If no names are assigned to the list elements, they are assumed in the same order as the group levels (outermost to innermost grouping). An inner covariate can change within the sets of rows defined by the grouping factor. An inner formula can be used to associate points in a plot of a groupedData object. Defaults to \code{NULL}, meaning that no inner covariates are present.} \item{labels}{an optional list of character strings giving labels for the response and the primary covariate. The label for the primary covariate is named \code{x} and that for the response is named \code{y}. Either label can be omitted.} \item{units}{an optional list of character strings giving the units for the response and the primary covariate. The units string for the primary covariate is named \code{x} and that for the response is named \code{y}. Either units string can be omitted.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ An object of the \code{groupedData} class is constructed from the \code{formula} and \code{data} by attaching the \code{formula} as an attribute of the data, along with any of \code{outer}, \code{inner}, \code{labels}, and \code{units} that are given. If \code{order.groups} is \code{TRUE} the grouping factor is converted to an ordered factor with the ordering determined by \code{FUN}. Depending on the number of grouping levels and the type of primary covariate, the returned object will be of one of three classes: \code{nfnGroupedData} - numeric covariate, single level of nesting; \code{nffGroupedData} - factor covariate, single level of nesting; and \code{nmGroupedData} - multiple levels of nesting. Several modeling and plotting functions can use the formula stored with a \code{groupedData} object to construct default plots and models. } \value{ an object of one of the classes \code{nfnGroupedData}, \code{nffGroupedData}, or \code{nmGroupedData}, and also inheriting from classes \code{groupedData} and \code{data.frame}. } \references{ Bates, D.M. and Pinheiro, J.C. (1997), "Software Design for Longitudinal Data", in "Modelling Longitudinal and Spatially Correlated Data: Methods, Applications and Future Directions", T.G. Gregoire (ed.), Springer-Verlag, New York. Pinheiro, J.C. and Bates, D.M. (1997) "Future Directions in Mixed-Effects Software: Design of NLME 3.0" available at http://nlme.stat.wisc.edu/ %% << no longer existing FIXME Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{Douglas Bates and José Pinheiro} \seealso{\code{\link{formula}}, \code{\link{gapply}}, \code{\link{gsummary}}, \code{\link{lme}}, \code{\link{plot.nffGroupedData}}, \code{\link{plot.nfnGroupedData}}, \code{\link{plot.nmGroupedData}}, \code{\link{reStruct}} } \examples{ Orth.new <- # create a new copy of the groupedData object groupedData( distance ~ age | Subject, data = as.data.frame( Orthodont ), FUN = mean, outer = ~ Sex, labels = list( x = "Age", y = "Distance from pituitary to pterygomaxillary fissure" ), units = list( x = "(yr)", y = "(mm)") ) plot( Orth.new ) # trellis plot by Subject formula( Orth.new ) # extractor for the formula gsummary( Orth.new ) # apply summary by Subject fm1 <- lme( Orth.new ) # fixed and groups formulae extracted from object Orthodont2 <- update(Orthodont, FUN = mean) } \keyword{manip} \keyword{attribute} nlme/man/lme.lmList.Rd0000644000176200001440000001307212222553014014266 0ustar liggesusers% File nlme/man/lme.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{lme.lmList} \title{LME fit from lmList Object} \usage{ \method{lme}{lmList}(fixed, data, random, correlation, weights, subset, method, na.action, control, contrasts, keep.data) } \alias{lme.lmList} \arguments{ \item{fixed}{an object inheriting from class \code{"\link{lmList}."}, representing a list of \code{lm} fits with a common model.} \item{data}{this argument is included for consistency with the generic function. It is ignored in this method function.} \item{random}{an optional one-sided linear formula with no conditioning expression, or a \code{pdMat} object with a \code{formula} attribute. Multiple levels of grouping are not allowed with this method function. Defaults to a formula consisting of the right hand side of \code{formula(fixed)}.} \item{correlation}{an optional \code{corStruct} object describing the within-group correlation structure. See the documentation of \code{corClasses} for a description of the available \code{corStruct} classes. Defaults to \code{NULL}, corresponding to no within-group correlations.} \item{weights}{an optional \code{varFunc} object or one-sided formula describing the within-group heteroscedasticity structure. If given as a formula, it is used as the argument to \code{varFixed}, corresponding to fixed variance weights. See the documentation on \code{varClasses} for a description of the available \code{varFunc} classes. Defaults to \code{NULL}, corresponding to homoscedastic within-group errors.} \item{subset}{an optional expression indicating the subset of the rows of \code{data} that should be used in the fit. This can be a logical vector, or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.} \item{method}{a character string. If \code{"REML"} the model is fit by maximizing the restricted log-likelihood. If \code{"ML"} the log-likelihood is maximized. Defaults to \code{"REML"}.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{na.fail}) causes \code{lme} to print an error message and terminate if there are any incomplete observations.} \item{control}{a list of control values for the estimation algorithm to replace the default values returned by the function \code{lmeControl}. Defaults to an empty list.} \item{contrasts}{an optional list. See the \code{contrasts.arg} of \code{model.matrix.default}.} \item{keep.data}{logical: should the \code{data} argument (if supplied and a data frame) be saved as part of the model object?} } \description{ If the random effects names defined in \code{random} are a subset of the \code{lmList} object coefficient names, initial estimates for the covariance matrix of the random effects are obtained (overwriting any values given in \code{random}). \code{formula(fixed)} and the \code{data} argument in the calling sequence used to obtain \code{fixed} are passed as the \code{fixed} and \code{data} arguments to \code{lme.formula}, together with any other additional arguments in the function call. See the documentation on \code{lme.formula} for a description of that function. } \value{ an object of class \code{lme} representing the linear mixed-effects model fit. Generic functions such as \code{print}, \code{plot} and \code{summary} have methods to show the results of the fit. See \code{lmeObject} for the components of the fit. The functions \code{resid}, \code{coef}, \code{fitted}, \code{fixed.effects}, and \code{random.effects} can be used to extract some of its components. } \references{ The computational methods follow the general framework of Lindstrom and Bates (1988). The model formulation is described in Laird and Ware (1982). The variance-covariance parametrizations are described in Pinheiro and Bates (1996). The different correlation structures available for the \code{correlation} argument are described in Box, Jenkins and Reinse (1994), Littel \emph{et al} (1996), and Venables and Ripley, (2002). The use of variance functions for linear and nonlinear mixed effects models is presented in detail in Davidian and Giltinan (1995). Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden--Day. Davidian, M. and Giltinan, D.M. (1995) "Nonlinear Mixed Effects Models for Repeated Measurement Data", Chapman and Hall. Laird, N.M. and Ware, J.H. (1982) "Random-Effects Models for Longitudinal Data", Biometrics, 38, 963--974. Lindstrom, M.J. and Bates, D.M. (1988) "Newton-Raphson and EM Algorithms for Linear Mixed-Effects Models for Repeated-Measures Data", Journal of the American Statistical Association, 83, 1014--1022. Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996) "SAS Systems for Mixed Models", SAS Institute. Pinheiro, J.C. and Bates., D.M. (1996) "Unconstrained Parametrizations for Variance-Covariance Matrices", Statistics and Computing, 6, 289--296. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. } \author{ José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu} } \seealso{\code{\link{lme}}, \code{\link{lmList}}, \code{\link{lmeObject}} } \examples{ fm1 <- lmList(Orthodont) fm2 <- lme(fm1) summary(fm1) summary(fm2) } \keyword{models} nlme/man/corFactor.Rd0000644000176200001440000000164312222553014014171 0ustar liggesusers% File nlme/man/corFactor.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corFactor} \title{Factor of a Correlation Matrix} \usage{ corFactor(object, \dots) } \alias{corFactor} \arguments{ \item{object}{an object from which a correlation matrix can be extracted.} \item{\dots}{some methods for this generic function require additional arguments.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include all \code{corStruct} classes. } \value{ will depend on the method function used; see the appropriate documentation. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{corFactor.corStruct}}, \code{\link{recalc.corStruct}} } \examples{ ## see the method function documentation } \keyword{models} nlme/man/coef.pdMat.Rd0000644000176200001440000000353612222553014014232 0ustar liggesusers% File nlme/man/coef.pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{coef.pdMat} \title{pdMat Object Coefficients} \usage{ \method{coef}{pdMat}(object, unconstrained, \dots) \method{coef}{pdMat}(object, \dots) <- value } \alias{coef.pdMat} \alias{coef.pdBlocked} \alias{coef.pdCompSymm} \alias{coef.pdDiag} \alias{coef.pdIdent} \alias{coef.pdNatural} \alias{coef.pdSymm} \alias{coef<-.pdMat} \alias{coef<-.pdBlocked} \arguments{ \item{object}{an object inheriting from class \code{"\link{pdMat}"}, representing a positive-definite matrix.} \item{unconstrained}{a logical value. If \code{TRUE} the coefficients are returned in unconstrained form (the same used in the optimization algorithm). If \code{FALSE} the upper triangular elements of the positive-definite matrix represented by \code{object} are returned. Defaults to \code{TRUE}.} \item{value}{a vector with the replacement values for the coefficients associated with \code{object}. It must be a vector with the same length of \code{coef{object}} and must be given in unconstrained form.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the coefficients associated with the positive-definite matrix represented by \code{object}. } \value{ a vector with the coefficients corresponding to \code{object}. } \references{ Pinheiro, J.C. and Bates., D.M. (1996) "Unconstrained Parametrizations for Variance-Covariance Matrices", Statistics and Computing, 6, 289-296. } \author{José Pinheiro and Douglas Bates } \section{SIDE EFFECTS}{ On the left side of an assignment, sets the values of the coefficients of \code{object} to \code{value}. } \seealso{\code{\link{pdMat}}} \examples{ coef(pdSymm(diag(3))) } \keyword{models} nlme/man/getCovariate.Rd0000644000176200001440000000246112222553014014663 0ustar liggesusers% File nlme/man/getCovariate.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getCovariate} \title{Extract Covariate from an Object} \usage{ getCovariate(object, form, data) } \alias{getCovariate} \arguments{ \item{object}{any object with a \code{covariate} component} \item{form}{an optional one-sided formula specifying the covariate(s) to be extracted. Defaults to \code{formula(object)}.} \item{data}{a data frame in which to evaluate the variables defined in \code{form}. } } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include \code{corStruct}, \code{corSpatial}, \code{data.frame}, and \code{varFunc}. } \value{ will depend on the method function used; see the appropriate documentation. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. p. 100. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{getCovariate.corStruct}}, \code{\link{getCovariate.data.frame}}, \code{\link{getCovariate.varFunc}}, \code{\link{getCovariateFormula}} } \examples{ ## see the method function documentation } \keyword{models} nlme/man/logLik.lme.Rd0000644000176200001440000000362712222456762014264 0ustar liggesusers% File nlme/man/logLik.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{logLik.lme} \title{Log-Likelihood of an lme Object} \usage{ \method{logLik}{lme}(object, REML, \dots) } \alias{logLik.lme} \alias{logLik.gls} \arguments{ \item{object}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model.} \item{REML}{an optional logical value. If \code{TRUE} the restricted log-likelihood is returned, else, if \code{FALSE}, the log-likelihood is returned. Defaults to the method of estimation used, that is \code{TRUE} if and only \code{object} was fitted with \code{method = "REML"} (the default for these fitting functions) . } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ If \code{REML=FALSE}, returns the log-likelihood value of the linear mixed-effects model represented by \code{object} evaluated at the estimated coefficients; else, the restricted log-likelihood evaluated at the estimated coefficients is returned. } \value{ the (restricted) log-likelihood of the model represented by \code{object} evaluated at the estimated coefficients. } \references{ Harville, D.A. (1974) ``Bayesian Inference for Variance Components Using Only Error Contrasts'', \emph{Biometrika}, \bold{61}, 383--385. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates} \seealso{\code{\link{lme}},\code{\link{gls}}, \code{\link{logLik.corStruct}}, \code{\link{logLik.glsStruct}}, \code{\link{logLik.lmeStruct}}, \code{\link{logLik.lmList}}, \code{\link{logLik.reStruct}}, \code{\link{logLik.varFunc}}, } \examples{ fm1 <- lme(distance ~ Sex * age, Orthodont, random = ~ age, method = "ML") logLik(fm1) logLik(fm1, REML = TRUE) } \keyword{models} nlme/man/pdBlocked.Rd0000644000176200001440000001004612222553014014133 0ustar liggesusers% File nlme/man/pdBlocked.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdBlocked} \title{Positive-Definite Block Diagonal Matrix} \usage{ pdBlocked(value, form, nam, data, pdClass) } \alias{pdBlocked} \arguments{ \item{value}{an optional list with elements to be used as the \code{value} argument to other \code{pdMat} constructors. These include: \code{pdMat} objects, positive-definite matrices, one-sided linear formulas, vectors of character strings, or numeric vectors. All elements in the list must be similar (e.g. all one-sided formulas, or all numeric vectors). Defaults to \code{numeric(0)}, corresponding to an uninitialized object.} \item{form}{an optional list of one-sided linear formulas specifying the row/column names for the block-diagonal elements of the matrix represented by \code{object}. Because factors may be present in \code{form}, the formulas needs to be evaluated on a data.frame to resolve the names they define. This argument is ignored when \code{value} is a list of one-sided formulas. Defaults to \code{NULL}.} \item{nam}{an optional list of vector of character strings specifying the row/column names for the block-diagonal elements of the matrix represented by object. Each of its components must have length equal to the dimension of the corresponding block-diagonal element and unreplicated elements. This argument is ignored when \code{value} is a list of vector of character strings. Defaults to \code{NULL}.} \item{data}{an optional data frame in which to evaluate the variables named in \code{value} and \code{form}. It is used to obtain the levels for \code{factors}, which affect the dimensions and the row/column names of the underlying matrix. If \code{NULL}, no attempt is made to obtain information on any \code{factors} appearing in the formulas. Defaults to the parent frame from which the function was called.} \item{pdClass}{an optional vector of character strings naming the \code{pdMat} classes to be assigned to the individual blocks in the underlying matrix. If a single class is specified, it is used for all block-diagonal elements. This argument will only be used when \code{value} is missing, or its elements are not \code{pdMat} objects. Defaults to \code{"pdSymm"}.} } \description{ This function is a constructor for the \code{pdBlocked} class, representing a positive-definite block-diagonal matrix. Each block-diagonal element of the underlying matrix is itself a positive-definite matrix and is represented internally as an individual \code{pdMat} object. When \code{value} is \code{numeric(0)}, a list of uninitialized \code{pdMat} objects, a list of one-sided formulas, or a list of vectors of character strings, \code{object} is returned as an uninitialized \code{pdBlocked} object (with just some of its attributes and its class defined) and needs to have its coefficients assigned later, generally using the \code{coef} or \code{matrix} replacement functions. If \code{value} is a list of initialized \code{pdMat} objects, \code{object} will be constructed from the list obtained by applying \code{as.matrix} to each of the \code{pdMat} elements of \code{value}. Finally, if \code{value} is a list of numeric vectors, they are assumed to represent the unrestricted coefficients of the block-diagonal elements of the underlying positive-definite matrix. } \value{ a \code{pdBlocked} object representing a positive-definite block-diagonal matrix, also inheriting from class \code{pdMat}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. p. 162. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.pdMat}}, \code{\link{coef.pdMat}}, \code{\link{pdClasses}}, \code{\link{matrix<-.pdMat}} } \examples{ pd1 <- pdBlocked(list(diag(1:2), diag(c(0.1, 0.2, 0.3))), nam = list(c("A","B"), c("a1", "a2", "a3"))) pd1 } \keyword{models} nlme/man/Wheat2.Rd0000644000176200001440000000461512222456762013417 0ustar liggesusers% File nlme/man/Wheat2.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Wheat2} \alias{Wheat2} \title{Wheat Yield Trials} \description{ The \code{Wheat2} data frame has 224 rows and 5 columns. } \format{ This data frame contains the following columns: \describe{ \item{Block}{ an ordered factor with levels \code{4} < \code{2} < \code{3} < \code{1} } \item{variety}{ a factor with levels \code{ARAPAHOE} \code{BRULE} \code{BUCKSKIN} \code{CENTURA} \code{CENTURK78} \code{CHEYENNE} \code{CODY} \code{COLT} \code{GAGE} \code{HOMESTEAD} \code{KS831374} \code{LANCER} \code{LANCOTA} \code{NE83404} \code{NE83406} \code{NE83407} \code{NE83432} \code{NE83498} \code{NE83T12} \code{NE84557} \code{NE85556} \code{NE85623} \code{NE86482} \code{NE86501} \code{NE86503} \code{NE86507} \code{NE86509} \code{NE86527} \code{NE86582} \code{NE86606} \code{NE86607} \code{NE86T666} \code{NE87403} \code{NE87408} \code{NE87409} \code{NE87446} \code{NE87451} \code{NE87457} \code{NE87463} \code{NE87499} \code{NE87512} \code{NE87513} \code{NE87522} \code{NE87612} \code{NE87613} \code{NE87615} \code{NE87619} \code{NE87627} \code{NORKAN} \code{REDLAND} \code{ROUGHRIDER} \code{SCOUT66} \code{SIOUXLAND} \code{TAM107} \code{TAM200} \code{VONA} } \item{yield}{ a numeric vector } \item{latitude}{ a numeric vector } \item{longitude}{ a numeric vector } } } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } %\examples{} \keyword{datasets} nlme/man/pooledSD.Rd0000644000176200001440000000164612222553014013763 0ustar liggesusers% File nlme/man/pooledSD.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pooledSD} \title{Extract Pooled Standard Deviation} \usage{ pooledSD(object) } \alias{pooledSD} \arguments{ \item{object}{an object inheriting from class \code{lmList}.} } \description{ The pooled estimated standard deviation is obtained by adding together the residual sum of squares for each non-null element of \code{object}, dividing by the sum of the corresponding residual degrees-of-freedom, and taking the square-root. } \value{ the pooled standard deviation for the non-null elements of \code{object}, with an attribute \code{df} with the number of degrees-of-freedom used in the estimation. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}}, \code{\link{lm}}} \examples{ fm1 <- lmList(Orthodont) pooledSD(fm1) } \keyword{models} nlme/man/needUpdate.Rd0000644000176200001440000000213212222553014014317 0ustar liggesusers% File nlme/man/needUpdate.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{needUpdate} \title{Check if Update is Needed} \usage{ needUpdate(object) } \alias{needUpdate} \alias{needUpdate.default} \alias{needUpdate.varComb} \alias{needUpdate.varIdent} \arguments{ \item{object}{any object} } \description{ This function is generic; method functions can be written to handle specific classes of objects. By default, it tries to extract a \code{needUpdate} attribute of \code{object}. If this is \code{NULL} or \code{FALSE} it returns \code{FALSE}; else it returns \code{TRUE}. Updating of objects usually takes place in iterative algorithms in which auxiliary quantities associated with the object, and not being optimized over, may change. } \value{ a logical value indicating whether \code{object} needs to be updated. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{needUpdate.modelStruct}} } \examples{ vf1 <- varExp() vf1 <- Initialize(vf1, data = Orthodont) needUpdate(vf1) } \keyword{models} nlme/man/plot.nfnGroupedData.Rd0000644000176200001440000001047212222553014016125 0ustar liggesusers% File nlme/man/plot.nfnGroupedData.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.nfnGroupedData} \title{Plot an nfnGroupedData Object} \usage{ \method{plot}{nfnGroupedData}(x, outer, inner, innerGroups, xlab, ylab, strip, aspect, panel, key, grid, \dots) } \alias{plot.nfnGroupedData} \arguments{ \item{x}{an object inheriting from class \code{nfnGroupedData}, representing a \code{groupedData} object with a numeric primary covariate and a single grouping level. } \item{outer}{an optional logical value or one-sided formula, indicating covariates that are outer to the grouping factor, which are used to determine the panels of the Trellis plot. If equal to \code{TRUE}, \code{attr(object, "outer")} is used to indicate the outer covariates. An outer covariate is invariant within the sets of rows defined by the grouping factor. Ordering of the groups is done in such a way as to preserve adjacency of groups with the same value of the outer variables. Defaults to \code{NULL}, meaning that no outer covariates are to be used. } \item{inner}{an optional logical value or one-sided formula, indicating a covariate that is inner to the grouping factor, which is used to associate points within each panel of the Trellis plot. If equal to \code{TRUE}, \code{attr(object, "inner")} is used to indicate the inner covariate. An inner covariate can change within the sets of rows defined by the grouping factor. Defaults to \code{NULL}, meaning that no inner covariate is present. } \item{innerGroups}{an optional one-sided formula specifying a factor to be used for grouping the levels of the \code{inner} covariate. Different colors, or line types, are used for each level of the \code{innerGroups} factor. Default is \code{NULL}, meaning that no \code{innerGroups} covariate is present. } \item{xlab, ylab}{optional character strings with the labels for the plot. Default is the corresponding elements of \code{attr(object, "labels")} and \code{attr(object, "units")} pasted together. } \item{strip}{an optional function passed as the \code{strip} argument to the \code{xyplot} function. Default is \code{strip.default(\dots, style = 1)} (see \code{trellis.args}). } \item{aspect}{an optional character string indicating the aspect ratio for the plot passed as the \code{aspect} argument to the \code{xyplot} function. Default is \code{"xy"} (see \code{trellis.args}). } \item{panel}{an optional function used to generate the individual panels in the Trellis display, passed as the \code{panel} argument to the \code{xyplot} function.} \item{key}{an optional logical function or function. If \code{TRUE} and \code{innerGroups} is non-\code{NULL}, a legend for the different \code{innerGroups} levels is included at the top of the plot. If given as a function, it is passed as the \code{key} argument to the \code{xyplot} function. Default is \code{TRUE} if \code{innerGroups} is non-\code{NULL} and \code{FALSE} otherwise. } \item{grid}{an optional logical value indicating whether a grid should be added to plot. Default is \code{TRUE}.} \item{\dots}{optional arguments passed to the \code{xyplot} function.} } \description{ A Trellis plot of the response versus the primary covariate is generated. If outer variables are specified, the combination of their levels are used to determine the panels of the Trellis display. Otherwise, the levels of the grouping variable determine the panels. A scatter plot of the response versus the primary covariate is displayed in each panel, with observations corresponding to same inner group joined by line segments. The Trellis function \code{xyplot} is used. } \value{ a Trellis plot of the response versus the primary covariate. } \references{ Bates, D.M. and Pinheiro, J.C. (1997), "Software Design for Longitudinal Data", in "Modelling Longitudinal and Spatially Correlated Data: Methods, Applications and Future Directions", T.G. Gregoire (ed.), Springer-Verlag, New York. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{groupedData}}, \code{\link{xyplot}}} \examples{ # different panels per Subject plot(Orthodont) # different panels per gender plot(Orthodont, outer = TRUE) } \keyword{models} nlme/man/formula.reStruct.Rd0000644000176200001440000000204412222553014015522 0ustar liggesusers% File nlme/man/formula.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{formula.reStruct} \title{Extract reStruct Object Formula} \usage{ \method{formula}{reStruct}(x, asList, \dots) } \alias{formula.reStruct} \arguments{ \item{x}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} \item{asList}{logical. Should the asList argument be applied to each of the components?} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts a formula from each of the components of \code{x}, returning a list of formulas. } \value{ a list with the formulas of each component of \code{x}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{formula}}} \examples{ rs1 <- reStruct(list(A = pdDiag(diag(2), ~age), B = ~1)) formula(rs1) } \keyword{models} nlme/man/pdFactor.Rd0000644000176200001440000000311512222553014014005 0ustar liggesusers% File nlme/man/pdFactor.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdFactor} \title{Square-Root Factor of a Positive-Definite Matrix} \usage{ pdFactor(object) } \alias{pdFactor} \alias{pdFactor.pdBlocked} \alias{pdFactor.pdCompSymm} \alias{pdFactor.pdDiag} \alias{pdFactor.pdIdent} \alias{pdFactor.pdMat} \alias{pdFactor.pdNatural} \alias{pdFactor.pdSymm} \alias{pdFactor.pdLogChol} \arguments{ \item{object}{an object inheriting from class \code{pdMat}, representing a positive definite matrix, which must have been initialized (i.e. \code{length(coef(object)) > 0}).} } \description{ A square-root factor of the positive-definite matrix represented by \code{object} is obtained. Letting \eqn{\Sigma}{S} denote a positive-definite matrix, a square-root factor of \eqn{\Sigma}{S} is any square matrix \eqn{L}{L} such that \eqn{\Sigma = L'L}{S = L'L}. This function extracts \eqn{L}. } \value{ a vector with a square-root factor of the positive-definite matrix associated with \code{object} stacked column-wise. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ This function is used intensively in optimization algorithms and its value is returned as a vector for efficiency reasons. The \code{pdMatrix} function can be used to obtain square-root factors in matrix form. } \seealso{\code{\link{pdMatrix}}} \examples{ pd1 <- pdCompSymm(4 * diag(3) + 1) pdFactor(pd1) } \keyword{models} nlme/man/intervals.Rd0000644000176200001440000000242012222553014014250 0ustar liggesusers% File nlme/man/intervals.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{intervals} \title{Confidence Intervals on Coefficients} \usage{ intervals(object, level, \dots) } \alias{intervals} \arguments{ \item{object}{a fitted model object from which parameter estimates can be extracted.} \item{level}{an optional numeric value for the interval confidence level. Defaults to 0.95.} \item{\dots}{some methods for the generic may require additional arguments.} } \description{ Confidence intervals on the parameters associated with the model represented by \code{object} are obtained. This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include: \code{gls}, \code{lme}, and \code{lmList}. } \value{ will depend on the method function used; see the appropriate documentation. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{intervals.lme}}, \code{\link{intervals.lmList}}, \code{\link{intervals.gls}} } \examples{ ## see the method documentation } \keyword{models} nlme/man/getData.gls.Rd0000644000176200001440000000214012222553014014375 0ustar liggesusers% File nlme/man/getData.gls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getData.gls} \title{Extract gls Object Data} \usage{ \method{getData}{gls}(object) } \alias{getData.gls} \alias{getData.gnls} \arguments{ \item{object}{an object inheriting from class \code{gls}, representing a generalized least squares fitted linear model.} } \description{ If present in the calling sequence used to produce \code{object}, the data frame used to fit the model is obtained. } \value{ if a \code{data} argument is present in the calling sequence that produced \code{object}, the corresponding data frame (with \code{na.action} and \code{subset} applied to it, if also present in the call that produced \code{object}) is returned; else, \code{NULL} is returned. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gls}}, \code{\link{getData}} } \examples{ fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data = Ovary, correlation = corAR1(form = ~ 1 | Mare)) getData(fm1) } \keyword{models} nlme/man/predict.nlme.Rd0000644000176200001440000000736612627572005014655 0ustar liggesusers% File nlme/man/predict.nlme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{predict.nlme} \title{Predictions from an nlme Object} \usage{ \method{predict}{nlme}(object, newdata, level = Q, asList = FALSE, na.action = na.fail, naPattern = NULL, \dots) } \alias{predict.nlme} \arguments{ \item{object}{an object inheriting from class \code{"\link{nlme}"}, representing a fitted nonlinear mixed-effects model.} \item{newdata}{an optional data frame to be used for obtaining the predictions. All variables used in the nonlinear model, the fixed and the random effects models, as well as the grouping factors, must be present in the data frame. If missing, the fitted values are returned.} \item{level}{an optional integer vector giving the level(s) of grouping to be used in obtaining the predictions. Level values increase from outermost to innermost grouping, with level zero corresponding to the population predictions. Defaults to the highest or innermost level of grouping (and is \code{object$dims$Q}).} \item{asList}{an optional logical value. If \code{TRUE} and a single value is given in \code{level}, the returned object is a list with the predictions split by groups; else the returned value is either a vector or a data frame, according to the length of \code{level}.} \item{na.action}{a function that indicates what should happen when \code{newdata} contains \code{NA}s. The default action (\code{na.fail}) causes the function to print an error message and terminate if there are any incomplete observations.} \item{naPattern}{an expression or formula object, specifying which returned values are to be regarded as missing.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The predictions at level \eqn{i} are obtained by adding together the contributions from the estimated fixed effects and the estimated random effects at levels less or equal to \eqn{i} and evaluating the model function at the resulting estimated parameters. If group values not included in the original grouping factors are present in \code{newdata}, the corresponding predictions will be set to \code{NA} for levels greater or equal to the level at which the unknown groups occur. } \value{ if a single level of grouping is specified in \code{level}, the returned value is either a list with the predictions split by groups (\code{asList = TRUE}) or a vector with the predictions (\code{asList = FALSE}); else, when multiple grouping levels are specified in \code{level}, the returned object is a data frame with columns given by the predictions at different levels and the grouping factors. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{nlme}}, \code{\link{fitted.lme}}} \examples{ head(Loblolly) # groupedData w/ 'Seed' is grouping variable : ## Grouped Data: height ~ age | Seed ## height age Seed ## 1 4.51 3 301 ## 15 10.89 5 301 ## .. ..... . ... fm1 <- nlme(height ~ SSasymp(age, Asym, R0, lrc), data = Loblolly, fixed = Asym + R0 + lrc ~ 1, random = Asym ~ 1, ## <---grouping---> Asym ~ 1 | Seed start = c(Asym = 103, R0 = -8.5, lrc = -3.3)) fm1 age. <- seq(from = 2, to = 30, by = 2) newLL.301 <- data.frame(age = age., Seed = 301) newLL.329 <- data.frame(age = age., Seed = 329) (p301 <- predict(fm1, newLL.301, level = 0:1)) (p329 <- predict(fm1, newLL.329, level = 0:1)) ## Prediction are the same at level 0 : all.equal(p301[,"predict.fixed"], p329[,"predict.fixed"]) ## and differ by the 'Seed' effect at level 1 : p301[,"predict.Seed"] - p329[,"predict.Seed"] } \keyword{models} nlme/man/varWeights.Rd0000644000176200001440000000204012222553014014362 0ustar liggesusers% File nlme/man/varWeights.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{varWeights} \title{Extract Variance Function Weights} \usage{ varWeights(object) } \alias{varWeights} \alias{varWeights.varComb} \alias{varWeights.varFunc} \arguments{ \item{object}{an object inheriting from class \code{varFunc}, representing a variance function structure.} } \description{ The inverse of the standard deviations corresponding to the variance function structure represented by \code{object} are returned. } \value{ if \code{object} has a \code{weights} attribute, its value is returned; else \code{NULL} is returned. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{logLik.varFunc}}, \code{\link{varWeights}} } \examples{ vf1 <- varPower(form=~age) vf1 <- Initialize(vf1, Orthodont) coef(vf1) <- 0.3 varWeights(vf1)[1:10] } \keyword{models} nlme/man/logLik.varFunc.Rd0000644000176200001440000000240012222553014015063 0ustar liggesusers% File nlme/man/logLik.varFunc.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{logLik.varFunc} \title{Extract varFunc logLik} \usage{ \method{logLik}{varFunc}(object, data, \dots) } \alias{logLik.varFunc} \alias{logLik.varComb} \arguments{ \item{object}{an object inheriting from class \code{"\link{varFunc}"}, representing a variance function structure.} \item{data}{this argument is included to make this method function compatible with other \code{logLik} methods and will be ignored.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the component of a Gaussian log-likelihood associated with the variance function structure represented by \code{object}, which is equal to the sum of the logarithms of the corresponding weights. } \value{ the sum of the logarithms of the weights corresponding to the variance function structure represented by \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{logLik.lme}} } \examples{ vf1 <- varPower(form = ~age) vf1 <- Initialize(vf1, Orthodont) coef(vf1) <- 0.1 logLik(vf1) } \keyword{models} nlme/man/Earthquake.Rd0000644000176200001440000000452112222456762014353 0ustar liggesusers% File nlme/man/Earthquake.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Earthquake} \alias{Earthquake} \title{Earthquake Intensity} \description{ The \code{Earthquake} data frame has 182 rows and 5 columns. } \format{ This data frame contains the following columns: \describe{ \item{Quake}{ an ordered factor with levels \code{20} < \code{16} < \code{14} < \code{10} < \code{3} < \code{8} < \code{23} < \code{22} < \code{6} < \code{13} < \code{7} < \code{21} < \code{18} < \code{15} < \code{4} < \code{12} < \code{19} < \code{5} < \code{9} < \code{1} < \code{2} < \code{17} < \code{11} indicating the earthquake on which the measurements were made. } \item{Richter}{ a numeric vector giving the intensity of the earthquake on the Richter scale. } \item{distance}{ the distance from the seismological measuring station to the epicenter of the earthquake (km). } \item{soil}{ a factor with levels \code{0} and \code{1} giving the soil condition at the measuring station, either soil or rock. } \item{accel}{ maximum horizontal acceleration observed (g). } } } \details{ Measurements recorded at available seismometer locations for 23 large earthquakes in western North America between 1940 and 1980. They were originally given in Joyner and Boore (1981); are mentioned in Brillinger (1987); and are analyzed in Davidian and Giltinan (1995). } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.8) Davidian, M. and Giltinan, D. M. (1995), \emph{Nonlinear Models for Repeated Measurement Data}, Chapman and Hall, London. Joyner and Boore (1981), Peak horizontal acceleration and velocity from strong-motion records including records from the 1979 Imperial Valley, California, earthquake, \emph{Bulletin of the Seismological Society of America}, \bold{71}, 2011-2038. Brillinger, D. (1987), Comment on a paper by C. R. Rao, \emph{Statistical Science}, \bold{2}, 448-450. } %\examples{} \keyword{datasets} nlme/man/pdLogChol.Rd0000644000176200001440000000753712675271210014141 0ustar liggesusers% File nlme/man/pdLogChol.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdLogChol} \title{General Positive-Definite Matrix} \usage{ pdLogChol(value, form, nam, data) } \alias{pdLogChol} \arguments{ \item{value}{an optional initialization value, which can be any of the following: a \code{pdMat} object, a positive-definite matrix, a one-sided linear formula (with variables separated by \code{+}), a vector of character strings, or a numeric vector. Defaults to \code{numeric(0)}, corresponding to an uninitialized object.} \item{form}{an optional one-sided linear formula specifying the row/column names for the matrix represented by \code{object}. Because factors may be present in \code{form}, the formula needs to be evaluated on a data frame to resolve the names it defines. This argument is ignored when \code{value} is a one-sided formula. Defaults to \code{NULL}.} \item{nam}{an optional character vector specifying the row/column names for the matrix represented by object. It must have length equal to the dimension of the underlying positive-definite matrix and unreplicated elements. This argument is ignored when \code{value} is a character vector. Defaults to \code{NULL}.} \item{data}{an optional data frame in which to evaluate the variables named in \code{value} and \code{form}. It is used to obtain the levels for \code{factors}, which affect the dimensions and the row/column names of the underlying matrix. If \code{NULL}, no attempt is made to obtain information on \code{factor}s appearing in the formulas. Defaults to the parent frame from which the function was called.} } \description{ This function is a constructor for the \code{pdLogChol} class, representing a general positive-definite matrix. If the matrix associated with \code{object} is of dimension \eqn{n}, it is represented by \eqn{n(n+1)/2}{n*(n+1)/2} unrestricted parameters, using the log-Cholesky parametrization described in Pinheiro and Bates (1996). \itemize{ \item When \code{value} is \code{numeric(0)}, an uninitialized \code{pdMat} object, a one-sided formula, or a character vector, \code{object} is returned as an \emph{uninitialized} \code{pdLogChol} object (with just some of its attributes and its class defined) and needs to have its coefficients assigned later, generally using the \code{coef} or \code{matrix} replacement functions. \item If \code{value} is an \emph{initialized} \code{pdMat} object, \code{object} will be constructed from \code{as.matrix(value)}. \item Finally, if \code{value} is a numeric vector, it is assumed to represent the unrestricted coefficients of the matrix-logarithm parametrization of the underlying positive-definite matrix. } } \details{ Internally, the \code{pdLogChol} representation of a symmetric positive definite matrix is a vector starting with the logarithms of the diagonal of the Choleski factorization of that matrix followed by its upper triangular portion. } \value{ a \code{pdLogChol} object representing a general positive-definite matrix, also inheriting from class \code{pdMat}. } \references{ Pinheiro, J.C. and Bates., D.M. (1996) Unconstrained Parametrizations for Variance-Covariance Matrices, \emph{Statistics and Computing} \bold{6}, 289--296. Pinheiro, J.C., and Bates, D.M. (2000) \emph{Mixed-Effects Models in S and S-PLUS}, Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.pdMat}}, \code{\link{coef.pdMat}}, \code{\link{pdClasses}}, \code{\link{matrix<-.pdMat}}} \examples{ (pd1 <- pdLogChol(diag(1:3), nam = c("A","B","C"))) (pd4 <- pdLogChol(1:6)) (pd4c <- chol(pd4)) # -> upper-tri matrix with off-diagonals 4 5 6 pd4c[upper.tri(pd4c)] log(diag(pd4c)) # 1 2 3 } \keyword{models} nlme/man/solve.reStruct.Rd0000644000176200001440000000243112222553014015205 0ustar liggesusers% File nlme/man/solve.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{solve.reStruct} \title{Apply Solve to an reStruct Object} \usage{ \method{solve}{reStruct}(a, b, \dots) } \alias{solve.reStruct} \arguments{ \item{a}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} \item{b}{this argument is only included for consistency with the generic function and is not used in this method function.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ \code{Solve} is applied to each \code{pdMat} component of \code{a}, which results in inverting the positive-definite matrices they represent. } \value{ an \code{reStruct} object similar to \code{a}, but with the \code{pdMat} components representing the inverses of the matrices represented by the components of \code{a}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{solve.pdMat}}, \code{\link{reStruct}}} \examples{ rs1 <- reStruct(list(A = pdSymm(diag(1:3), form = ~Score), B = pdDiag(2 * diag(4), form = ~Educ))) solve(rs1) } \keyword{models} nlme/man/getGroups.lmList.Rd0000644000176200001440000000313112222553014015463 0ustar liggesusers% File nlme/man/getGroups.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getGroups.lmList} \title{Extract lmList Object Groups} \usage{ \method{getGroups}{lmList}(object, form, level, data, sep) } \alias{getGroups.lmList} \arguments{ \item{object}{an object inheriting from class \code{lmList}, representing a list of \code{lm} objects with a common model.} \item{form}{an optional formula with a conditioning expression on its right hand side (i.e. an expression involving the \code{|} operator). Defaults to \code{formula(object)}. Not used.} \item{level}{a positive integer vector with the level(s) of grouping to be used when multiple nested levels of grouping are present. This argument is optional for most methods of this generic function and defaults to all levels of nesting. Not used.} \item{data}{a data frame in which to interpret the variables named in \code{form}. Optional for most methods. Not used.} \item{sep}{character, the separator to use between group levels when multiple levels are collapsed. The default is \code{'/'}. Not used.} } \description{ The grouping factor determining the partitioning of the observations used to produce the \code{lm} components of \code{object} is extracted. } \value{ a vector with the grouping factor corresponding to the \code{lm} components of \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}}} \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) getGroups(fm1) } \keyword{models} nlme/man/Wafer.Rd0000644000176200001440000000220512222456762013322 0ustar liggesusers% File nlme/man/Wafer.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Wafer} \alias{Wafer} \title{Modeling of Analog MOS Circuits} \description{ The \code{Wafer} data frame has 400 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{Wafer}{ a factor with levels \code{1} \code{2} \code{3} \code{4} \code{5} \code{6} \code{7} \code{8} \code{9} \code{10} } \item{Site}{ a factor with levels \code{1} \code{2} \code{3} \code{4} \code{5} \code{6} \code{7} \code{8} } \item{voltage}{ a numeric vector } \item{current}{ a numeric vector } } } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } %\examples{} \keyword{datasets} nlme/man/Variogram.corLin.Rd0000644000176200001440000000371012222553014015420 0ustar liggesusers% File nlme/man/Variogram.corLin.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Variogram.corLin} \title{Calculate Semi-variogram for a corLin Object} \usage{ \method{Variogram}{corLin}(object, distance, sig2, length.out, \dots) } \alias{Variogram.corLin} \arguments{ \item{object}{an object inheriting from class \code{"\link{corLin}"}, representing an Linear spatial correlation structure.} \item{distance}{an optional numeric vector with the distances at which the semi-variogram is to be calculated. Defaults to \code{NULL}, in which case a sequence of length \code{length.out} between the minimum and maximum values of \code{getCovariate(object)} is used.} \item{sig2}{an optional numeric value representing the process variance. Defaults to \code{1}.} \item{length.out}{an optional integer specifying the length of the sequence of distances to be used for calculating the semi-variogram, when \code{distance = NULL}. Defaults to \code{50}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function calculates the semi-variogram values corresponding to the Linear correlation model, using the estimated coefficients corresponding to \code{object}, at the distances defined by \code{distance}. } \value{ a data frame with columns \code{variog} and \code{dist} representing, respectively, the semi-variogram values and the corresponding distances. The returned value inherits from class \code{Variogram}. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corLin}}, \code{\link{plot.Variogram}}, \code{\link{Variogram}} } \examples{ cs1 <- corLin(15, form = ~ Time | Rat) cs1 <- Initialize(cs1, BodyWeight) Variogram(cs1)[1:10,] } \keyword{models} nlme/man/corMatrix.Rd0000644000176200001440000000163512222553014014220 0ustar liggesusers% File nlme/man/corMatrix.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corMatrix} \title{Extract Correlation Matrix} \usage{ corMatrix(object, \dots) } \alias{corMatrix} \arguments{ \item{object}{an object for which a correlation matrix can be extracted.} \item{\dots}{some methods for this generic function require additional arguments.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include all \code{corStruct} classes. } \value{ will depend on the method function used; see the appropriate documentation. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{corMatrix.corStruct}}, \code{\link{corMatrix.pdMat}}} \examples{ ## see the method function documentation } \keyword{models} nlme/man/Matrix.pdMat.Rd0000644000176200001440000000245612675271210014571 0ustar liggesusers% File nlme/man/Matrix.pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Matrix.pdMat} \title{Assign Matrix to a pdMat or pdBlocked Object} \alias{matrix<-.pdMat} \alias{matrix<-.pdBlocked} \usage{ \method{matrix}{pdMat}(object) <- value \method{matrix}{pdBlocked}(object) <- value } \arguments{ \item{object}{an object inheriting from class \code{"\link{pdMat}"}, representing a positive definite matrix.} \item{value}{a matrix with the new values to be assigned to the positive-definite matrix represented by \code{object}. Must have the same dimensions as \code{as.matrix(object)}.} } \description{ The positive-definite matrix represented by \code{object} is replaced by \code{value}. If the original matrix had row and/or column names, the corresponding names for \code{value} can either be \code{NULL}, or a permutation of the original names. } \value{ a \code{pdMat} or \code{pdBlocked} object similar to \code{object}, but with its coefficients modified to produce the matrix in \code{value}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{pdMat}}, \code{"\link{matrix<-}"} } \examples{ class(pd1 <- pdSymm(diag(3))) # "pdSymm" "pdMat" matrix(pd1) <- diag(1:3) pd1 } \keyword{models} nlme/man/splitFormula.Rd0000644000176200001440000000173012222553014014725 0ustar liggesusers% File nlme/man/splitFormula.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{splitFormula} \title{Split a Formula} \usage{ splitFormula(form, sep) } \alias{splitFormula} \arguments{ \item{form}{a \code{formula} object.} \item{sep}{an optional character string specifying the separator to be used for splitting the formula. Defaults to \code{"/"}. } } \description{ Splits the right hand side of \code{form} into a list of subformulas according to the presence of \code{sep}. The left hand side of \code{form}, if present, will be ignored. The length of the returned list will be equal to the number of occurrences of \code{sep} in \code{form} plus one. } \value{ a list of formulas, corresponding to the split of \code{form} according to \code{sep}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{formula}}} \examples{ splitFormula(~ g1/g2/g3) } \keyword{models} nlme/man/corMatrix.reStruct.Rd0000644000176200001440000000220712222553014016026 0ustar liggesusers% File nlme/man/corMatrix.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corMatrix.reStruct} \title{Extract Correlation Matrix from Components of an reStruct Object} \usage{ \method{corMatrix}{reStruct}(object, \dots) } \alias{corMatrix.reStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the correlation matrices corresponding to the \code{pdMat} elements of \code{object}. } \value{ a list with components given by the correlation matrices corresponding to the elements of \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.reStruct}}, \code{\link{corMatrix}}, \code{\link{reStruct}}, \code{\link{pdMat}}} \examples{ rs1 <- reStruct(pdSymm(diag(3), ~age+Sex, data = Orthodont)) corMatrix(rs1) } \keyword{models} nlme/man/update.modelStruct.Rd0000644000176200001440000000237312222553014016036 0ustar liggesusers% File nlme/man/update.modelStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{update.modelStruct} \title{Update a modelStruct Object} \usage{ \method{update}{modelStruct}(object, data, \dots) } \alias{update.modelStruct} \alias{update.corStruct} \alias{update.reStruct} \arguments{ \item{object}{an object inheriting from class \code{"modelStruct"}, representing a list of model components, such as \code{corStruct} and \code{varFunc} objects.} \item{data}{a data frame in which to evaluate the variables needed for updating the elements of \code{object}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function updates each element of \code{object}, allowing the access to \code{data}. } \value{ an object similar to \code{object} (same class, length, and names), but with updated elements. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{reStruct}} } \note{This method function is primarily used within model fitting functions, such as \code{lme} and \code{gls}, that allow model components such as variance functions.} \keyword{models} nlme/man/pairs.lme.Rd0000644000176200001440000000725713330762523014160 0ustar liggesusers% File nlme/man/pairs.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pairs.lme} \title{Pairs Plot of an lme Object} \usage{ \method{pairs}{lme}(x, form, label, id, idLabels, grid, \dots) } \alias{pairs.lme} \arguments{ \item{x}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model.} \item{form}{an optional one-sided formula specifying the desired type of plot. Any variable present in the original data frame used to obtain \code{x} can be referenced. In addition, \code{x} itself can be referenced in the formula using the symbol \code{"."}. Conditional expressions on the right of a \code{|} operator can be used to define separate panels in a Trellis display. The expression on the right hand side of \code{form}, and to the left of the \code{|} operator, must evaluate to a data frame with at least two columns. Default is \code{~ coef(.) }, corresponding to a pairs plot of the coefficients evaluated at the innermost level of nesting.} \item{label}{an optional character vector of labels for the variables in the pairs plot.} \item{id}{an optional numeric value, or one-sided formula. If given as a value, it is used as a significance level for an outlier test based on the Mahalanobis distances of the estimated random effects. Groups with random effects distances greater than the \eqn{1-value} percentile of the appropriate chi-square distribution are identified in the plot using \code{idLabels}. If given as a one-sided formula, its right hand side must evaluate to a logical, integer, or character vector which is used to identify points in the plot. If missing, no points are identified.} \item{idLabels}{an optional vector, or one-sided formula. If given as a vector, it is converted to character and used to label the points identified according to \code{id}. If given as a one-sided formula, its right hand side must evaluate to a vector which is converted to character and used to label the identified points. Default is the innermost grouping factor. } \item{grid}{an optional logical value indicating whether a grid should be added to plot. Default is \code{FALSE}.} \item{\dots}{optional arguments passed to the Trellis plot function.} } \description{ Diagnostic plots for the linear mixed-effects fit are obtained. The \code{form} argument gives considerable flexibility in the type of plot specification. A conditioning expression (on the right side of a \code{|} operator) always implies that different panels are used for each level of the conditioning factor, according to a Trellis display. The expression on the right hand side of the formula, before a \code{|} operator, must evaluate to a data frame with at least two columns. If the data frame has two columns, a scatter plot of the two variables is displayed (the Trellis function \code{xyplot} is used). Otherwise, if more than two columns are present, a scatter plot matrix with pairwise scatter plots of the columns in the data frame is displayed (the Trellis function \code{splom} is used). } \value{ a diagnostic Trellis plot. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{pairs.compareFits}}, \code{\link{pairs.lmList}}, \code{\link{xyplot}}, \code{\link{splom}} } \examples{ fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject) # scatter plot of coefficients by gender, identifying unusual subjects pairs(fm1, ~coef(., augFrame = TRUE) | Sex, id = 0.1, adj = -0.5) # scatter plot of estimated random effects : pairs(fm1, ~ranef(.)) } \keyword{models} nlme/man/pdCompSymm.Rd0000644000176200001440000000637712222553014014350 0ustar liggesusers% File nlme/man/pdCompSymm.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdCompSymm} \title{Positive-Definite Matrix with Compound Symmetry Structure} \usage{ pdCompSymm(value, form, nam, data) } \alias{pdCompSymm} \arguments{ \item{value}{an optional initialization value, which can be any of the following: a \code{pdMat} object, a positive-definite matrix, a one-sided linear formula (with variables separated by \code{+}), a vector of character strings, or a numeric vector of length 2. Defaults to \code{numeric(0)}, corresponding to an uninitialized object.} \item{form}{an optional one-sided linear formula specifying the row/column names for the matrix represented by \code{object}. Because factors may be present in \code{form}, the formula needs to be evaluated on a data.frame to resolve the names it defines. This argument is ignored when \code{value} is a one-sided formula. Defaults to \code{NULL}.} \item{nam}{an optional vector of character strings specifying the row/column names for the matrix represented by object. It must have length equal to the dimension of the underlying positive-definite matrix and unreplicated elements. This argument is ignored when \code{value} is a vector of character strings. Defaults to \code{NULL}.} \item{data}{an optional data frame in which to evaluate the variables named in \code{value} and \code{form}. It is used to obtain the levels for \code{factors}, which affect the dimensions and the row/column names of the underlying matrix. If \code{NULL}, no attempt is made to obtain information on \code{factors} appearing in the formulas. Defaults to the parent frame from which the function was called.} } \description{ This function is a constructor for the \code{pdCompSymm} class, representing a positive-definite matrix with compound symmetry structure (constant diagonal and constant off-diagonal elements). The underlying matrix is represented by 2 unrestricted parameters. When \code{value} is \code{numeric(0)}, an unitialized \code{pdMat} object, a one-sided formula, or a vector of character strings, \code{object} is returned as an uninitialized \code{pdCompSymm} object (with just some of its attributes and its class defined) and needs to have its coefficients assigned later, generally using the \code{coef} or \code{matrix} replacement functions. If \code{value} is an initialized \code{pdMat} object, \code{object} will be constructed from \code{as.matrix(value)}. Finally, if \code{value} is a numeric vector of length 2, it is assumed to represent the unrestricted coefficients of the underlying positive-definite matrix. } \value{ a \code{pdCompSymm} object representing a positive-definite matrix with compound symmetry structure, also inheriting from class \code{pdMat}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. p. 161. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.pdMat}}, \code{\link{coef.pdMat}}, \code{\link{matrix<-.pdMat}}, \code{\link{pdClasses}} } \examples{ pd1 <- pdCompSymm(diag(3) + 1, nam = c("A","B","C")) pd1 } \keyword{models} nlme/man/collapse.Rd0000644000176200001440000000150612222553014014047 0ustar liggesusers% File nlme/man/collapse.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{collapse} \title{Collapse According to Groups} \usage{ collapse(object, \dots) } \alias{collapse} \arguments{ \item{object}{an object to be collapsed, usually a data frame.} \item{\dots}{some methods for the generic may require additional arguments.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Currently, only a \code{groupedData} method is available. } \value{ will depend on the method function used; see the appropriate documentation. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{collapse.groupedData}}} \examples{ ## see the method function documentation } \keyword{models} nlme/man/as.matrix.reStruct.Rd0000644000176200001440000000222412222553014015763 0ustar liggesusers% File nlme/man/as.matrix.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{as.matrix.reStruct} \title{Matrices of an reStruct Object} \usage{ \method{as.matrix}{reStruct}(x, \dots) } \alias{as.matrix.reStruct} \arguments{ \item{x}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} \item{\dots}{further arguments passed from other methods.} } \description{ This method function extracts the positive-definite matrices corresponding to the \code{pdMat} elements of \code{object}. } \value{ a list with components given by the positive-definite matrices corresponding to the elements of \code{object}. } \references{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.pdMat}}, \code{\link{reStruct}}, \code{\link{pdMat}}} \examples{ rs1 <- reStruct(pdSymm(diag(3), ~age+Sex, data = Orthodont)) as.matrix(rs1) } \keyword{models} nlme/man/getGroups.lme.Rd0000644000176200001440000000311012222553014014771 0ustar liggesusers% File nlme/man/getGroups.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getGroups.lme} \title{Extract lme Object Groups} \usage{ \method{getGroups}{lme}(object, form, level, data, sep) } \alias{getGroups.lme} \arguments{ \item{object}{an object inheriting from class \code{lme}, representing a fitted linear mixed-effects model.} \item{form}{this argument is included to make the method function compatible with the generic and is ignored in this method.} \item{level}{an optional integer vector giving the level(s) of grouping to be extracted from \code{object}. Defaults to the highest or innermost level of grouping.} \item{data}{unused} \item{sep}{character, the separator to use between group levels when multiple levels are collapsed. The default is \code{'/'}.} } \description{ The grouping factors corresponding to the linear mixed-effects model represented by \code{object} are extracted. If more than one level is indicated in \code{level}, the corresponding grouping factors are combined into a data frame; else the selected grouping factor is returned as a vector. } \value{ either a data frame with columns given by the grouping factors indicated in \code{level}, or, when a single level is requested, a factor representing the selected grouping factor. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}} \examples{ fm1 <- lme(pixel ~ day + day^2, Pixel, random = list(Dog = ~day, Side = ~1)) getGroups(fm1, level = 1:2) } \keyword{models} nlme/man/VarCorr.Rd0000644000176200001440000000447013057521546013642 0ustar liggesusers% File nlme/man/VarCorr.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{VarCorr} \title{Extract variance and correlation components} \alias{VarCorr} \alias{VarCorr.lme} \alias{VarCorr.pdMat} \alias{VarCorr.pdBlocked} \alias{print.VarCorr.lme} \usage{ VarCorr(x, sigma = 1, \dots) \method{VarCorr}{lme}(x, sigma = x$sigma, rdig = 3, \dots) \method{VarCorr}{pdMat}(x, sigma = 1, rdig = 3, \dots) \method{VarCorr}{pdBlocked}(x, sigma = 1, rdig = 3, \dots) } \arguments{ \item{x}{a fitted model object, usually an object inheriting from class \code{"\link{lme}"}.} \item{sigma}{an optional numeric value used as a multiplier for the standard deviations. The default is \code{x$sigma} or \code{1} depending on \code{\link{class}(x)}.} \item{rdig}{an optional integer value specifying the number of digits used to represent correlation estimates. Default is \code{3}.} \item{\dots}{further optional arguments passed to other methods (none for the methods documented here).} } \description{ This function calculates the estimated variances, standard deviations, and correlations between the random-effects terms in a linear mixed-effects model, of class \code{"\link{lme}"}, or a nonlinear mixed-effects model, of class \code{"\link{nlme}"}. The within-group error variance and standard deviation are also calculated. } \value{ a matrix with the estimated variances, standard deviations, and correlations for the random effects. The first two columns, named \code{Variance} and \code{StdDev}, give, respectively, the variance and the standard deviations. If there are correlation components in the random effects model, the third column, named \code{Corr}, and the remaining unnamed columns give the estimated correlations among random effects within the same level of grouping. The within-group error variance and standard deviation are included as the last row in the matrix. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) \emph{Mixed-Effects Models in S and S-PLUS}, Springer, esp. pp. 100, 461. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{nlme}}} \examples{ fm1 <- lme(distance ~ age, data = Orthodont, random = ~age) VarCorr(fm1) } \keyword{models} nlme/man/nlmeControl.Rd0000644000176200001440000001161713245437022014553 0ustar liggesusers% File nlme/man/nlmeControl.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{nlmeControl} \title{Control Values for nlme Fit} \usage{ nlmeControl(maxIter, pnlsMaxIter, msMaxIter, minScale, tolerance, niterEM, pnlsTol, msTol, returnObject, msVerbose, msWarnNoConv, gradHess, apVar, .relStep, minAbsParApVar = 0.05, opt = c("nlminb", "nlm"), natural = TRUE, sigma = NULL, \dots) } \alias{nlmeControl} \arguments{ \item{maxIter}{maximum number of iterations for the \code{nlme} optimization algorithm. Default is 50.} \item{pnlsMaxIter}{maximum number of iterations for the \code{PNLS} optimization step inside the \code{nlme} optimization. Default is 7.} \item{msMaxIter}{maximum number of iterations for \code{\link{nlminb}} (\code{iter.max}) or the \code{\link{nlm}} (\code{iterlim}, from the 10-th step) optimization step inside the \code{nlme} optimization. Default is 50 (which may be too small for e.g. for overparametrized cases).} \item{minScale}{minimum factor by which to shrink the default step size in an attempt to decrease the sum of squares in the \code{PNLS} step. Default \code{0.001}.} \item{tolerance}{tolerance for the convergence criterion in the \code{nlme} algorithm. Default is \code{1e-6}.} \item{niterEM}{number of iterations for the EM algorithm used to refine the initial estimates of the random effects variance-covariance coefficients. Default is 25.} \item{pnlsTol}{tolerance for the convergence criterion in \code{PNLS} step. Default is \code{1e-3}.} \item{msTol}{tolerance for the convergence criterion in \code{nlm}, passed as the \code{gradtol} argument to the function (see documentation on \code{nlm}). Default is \code{1e-7}. } \item{returnObject}{a logical value indicating whether the fitted object should be returned when the maximum number of iterations is reached without convergence of the algorithm. Default is \code{FALSE}.} \item{msVerbose}{a logical value passed as the \code{trace} to \code{\link{nlminb}(.., control= list(trace = *, ..))} or as argument \code{print.level} to \code{\link{nlm}()}. Default is \code{FALSE}.} \item{msWarnNoConv}{logical indicating if a \code{\link{warning}} should be signalled whenever the minimization by (\code{opt}) in the LME step does not converge; defaults to \code{TRUE}.} \item{gradHess}{a logical value indicating whether numerical gradient vectors and Hessian matrices of the log-likelihood function should be used in the \code{nlm} optimization. This option is only available when the correlation structure (\code{corStruct}) and the variance function structure (\code{varFunc}) have no "varying" parameters and the \code{pdMat} classes used in the random effects structure are \code{pdSymm} (general positive-definite), \code{pdDiag} (diagonal), \code{pdIdent} (multiple of the identity), or \code{pdCompSymm} (compound symmetry). Default is \code{TRUE}.} \item{apVar}{a logical value indicating whether the approximate covariance matrix of the variance-covariance parameters should be calculated. Default is \code{TRUE}.} \item{.relStep}{relative step for numerical derivatives calculations. Default is \code{.Machine$double.eps^(1/3)}.} \item{minAbsParApVar}{numeric value - minimum absolute parameter value in the approximate variance calculation. The default is \code{0.05}.} \item{opt}{the optimizer to be used, either \code{"\link{nlminb}"} (the default) or \code{"\link{nlm}"}.} \item{natural}{a logical value indicating whether the \code{pdNatural} parametrization should be used for general positive-definite matrices (\code{pdSymm}) in \code{reStruct}, when the approximate covariance matrix of the estimators is calculated. Default is \code{TRUE}.} \item{sigma}{optionally a positive number to fix the residual error at. If \code{NULL}, as by default, or \code{0}, sigma is estimated.} \item{\dots}{Further, named control arguments to be passed to \code{\link{nlminb}} (apart from \code{trace} and \code{iter.max} mentioned above), where used (\code{eval.max} and those from \code{abs.tol} down).} } \description{ The values supplied in the function call replace the defaults and a list with all possible arguments is returned. The returned list is used as the \code{control} argument to the \code{nlme} function. } \value{ a list with components for each of the possible arguments. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}; the \code{sigma} option: Siem Heisterkamp and Bert van Willigen.} \seealso{\code{\link{nlme}}, \code{\link{nlm}}, \code{\link{optim}}, \code{\link{nlmeStruct}}} \examples{ # decrease the maximum number iterations in the ms call and # request that information on the evolution of the ms iterations be printed nlmeControl(msMaxIter = 20, msVerbose = TRUE) } \keyword{models} nlme/man/plot.nffGroupedData.Rd0000644000176200001440000000777712222553014016133 0ustar liggesusers% File nlme/man/plot.nffGroupedData.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.nffGroupedData} \title{Plot an nffGroupedData Object} \usage{ \method{plot}{nffGroupedData}(x, outer, inner, innerGroups, xlab, ylab, strip, panel, key, grid, \dots) } \alias{plot.nffGroupedData} \arguments{ \item{x}{an object inheriting from class \code{nffGroupedData}, representing a \code{groupedData} object with a factor primary covariate and a single grouping level. } \item{outer}{an optional logical value or one-sided formula, indicating covariates that are outer to the grouping factor, which are used to determine the panels of the Trellis plot. If equal to \code{TRUE}, \code{attr(object, "outer")} is used to indicate the outer covariates. An outer covariate is invariant within the sets of rows defined by the grouping factor. Ordering of the groups is done in such a way as to preserve adjacency of groups with the same value of the outer variables. Defaults to \code{NULL}, meaning that no outer covariates are to be used. } \item{inner}{an optional logical value or one-sided formula, indicating a covariate that is inner to the grouping factor, which is used to associate points within each panel of the Trellis plot. If equal to \code{TRUE}, \code{attr(object, "inner")} is used to indicate the inner covariate. An inner covariate can change within the sets of rows defined by the grouping factor. Defaults to \code{NULL}, meaning that no inner covariate is present. } \item{innerGroups}{an optional one-sided formula specifying a factor to be used for grouping the levels of the \code{inner} covariate. Different colors, or symbols, are used for each level of the \code{innerGroups} factor. Default is \code{NULL}, meaning that no \code{innerGroups} covariate is present. } \item{xlab}{an optional character string with the label for the horizontal axis. Default is the \code{y} elements of \code{attr(object, "labels")} and \code{attr(object, "units")} pasted together. } \item{ylab}{an optional character string with the label for the vertical axis. Default is the grouping factor name. } \item{strip}{an optional function passed as the \code{strip} argument to the \code{dotplot} function. Default is \code{strip.default(..., style = 1)} (see \code{trellis.args}). } \item{panel}{an optional function used to generate the individual panels in the Trellis display, passed as the \code{panel} argument to the \code{dotplot} function. } \item{key}{an optional logical function or function. If \code{TRUE} and either \code{inner} or \code{innerGroups} are non-\code{NULL}, a legend for the different \code{inner} (\code{innerGroups}) levels is included at the top of the plot. If given as a function, it is passed as the \code{key} argument to the \code{dotplot} function. Default is \code{TRUE} is either \code{inner} or \code{innerGroups} are non-\code{NULL} and \code{FALSE} otherwise. } \item{grid}{this argument is included for consistency with the \code{plot.nfnGroupedData} method calling sequence. It is ignored in this method function.} \item{\dots}{optional arguments passed to the \code{dotplot} function.} } \description{ A Trellis dot-plot of the response by group is generated. If outer variables are specified, the combination of their levels are used to determine the panels of the Trellis display. The Trellis function \code{dotplot} is used. } \value{ a Trellis dot-plot of the response by group. } \references{ Bates, D.M. and Pinheiro, J.C. (1997), "Software Design for Longitudinal Data", in "Modelling Longitudinal and Spatially Correlated Data: Methods, Applications and Future Directions", T.G. Gregoire (ed.), Springer-Verlag, New York. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{groupedData}}, \code{\link{dotplot}}} \examples{ plot(Machines) plot(Machines, inner = TRUE) } \keyword{models} nlme/man/LDEsysMat.Rd0000644000176200001440000000322112222456762014062 0ustar liggesusers% File nlme/man/LDEsysMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{LDEsysMat} \alias{LDEsysMat} \title{Generate system matrix for LDEs} \description{ Generate the system matrix for the linear differential equations determined by a compartment model. } \usage{ LDEsysMat(pars, incidence) } \arguments{ \item{pars}{a numeric vector of parameter values.} \item{incidence}{an integer matrix with columns named \code{From}, \code{To}, and \code{Par}. Values in the \code{Par} column must be in the range 1 to \code{length(pars)}. Values in the \code{From} column must be between 1 and the number of compartments. Values in the \code{To} column must be between 0 and the number of compartments.} } \details{ A compartment model describes material transfer between \code{k} in a system of \code{k} compartments to a linear system of differential equations. Given a description of the system and a vector of parameter values this function returns the system matrix. This function is intended for use in a general system for solving compartment models, as described in Bates and Watts (1988). } \value{ A \code{k} by \code{k} numeric matrix. } \references{ Bates, D. M. and Watts, D. G. (1988), \emph{Nonlinear Regression Analysis and Its Applications}, Wiley, New York. } \author{Douglas Bates \email{bates@stat.wisc.edu}} \examples{ # incidence matrix for a two compartment open system incidence <- matrix(c(1,1,2,2,2,1,3,2,0), ncol = 3, byrow = TRUE, dimnames = list(NULL, c("Par", "From", "To"))) incidence LDEsysMat(c(1.2, 0.3, 0.4), incidence) } \keyword{models} nlme/man/pairs.compareFits.Rd0000644000176200001440000000361313561005472015646 0ustar liggesusers% File nlme/man/pairs.compareFits.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pairs.compareFits} \title{Pairs Plot of compareFits Object} \usage{ \method{pairs}{compareFits}(x, subset, key, \dots) } \alias{pairs.compareFits} \arguments{ \item{x}{an object of class \code{compareFits}.} \item{subset}{an optional logical or integer vector specifying which rows of \code{x} should be used in the plots. If missing, all rows are used.} \item{key}{an optional logical value, or list. If \code{TRUE}, a legend is included at the top of the plot indicating which symbols (colors) correspond to which objects being compared. If \code{FALSE}, no legend is included. If given as a list, \code{key} is passed down as an argument to the \code{trellis} function generating the plots (\code{splom} or \code{xyplot}). Defaults to \code{TRUE}.} \item{\dots}{optional arguments passed down to the \code{trellis} function generating the plots.} } \description{ Scatter plots of the values being compared are generated for each pair of coefficients in \code{x}. Different symbols (colors) are used for each object being compared and values corresponding to the same group are joined by a line, to facilitate comparison of fits. If only two coefficients are present, the \code{trellis} function \code{xyplot} is used; otherwise the \code{trellis} function \code{splom} is used. } \value{ Pairwise scatter plots of the values being compared, with different symbols (colors) used for each object under comparison. } \author{José Pinheiro and Douglas Bates } \seealso{ \code{\link{compareFits}}, \code{\link{plot.compareFits}}, \code{\link{pairs.lme}}, \code{\link{pairs.lmList}}, \code{\link{xyplot}}, \code{\link{splom}} } \examples{ example(compareFits) # cF12 <- compareFits(coef(lmList(Orthodont)), .. lme(*)) pairs(cF12) } \keyword{models} nlme/man/print.summary.pdMat.Rd0000644000176200001440000000373612222553014016150 0ustar liggesusers% File nlme/man/print.summary.pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{print.summary.pdMat} \title{Print a summary.pdMat Object} \usage{ \method{print}{summary.pdMat}(x, sigma, rdig, Level, resid, \dots) } \alias{print.summary.pdMat} \arguments{ \item{x}{an object inheriting from class \code{"\link{summary.pdMat}"}, generally resulting from applying \code{\link{summary}} to an object inheriting from class \code{"\link{pdMat}"}.} \item{sigma}{an optional numeric value used as a multiplier for the square-root factor of the positive-definite matrix represented by \code{object} (usually the estimated within-group standard deviation from a mixed-effects model). Defaults to 1.} \item{rdig}{an optional integer value with the number of significant digits to be used in printing correlations. Defaults to 3.} \item{Level}{an optional character string with a description of the grouping level associated with \code{object} (generally corresponding to levels of grouping in a mixed-effects model). Defaults to NULL.} \item{resid}{an optional logical value. If \code{TRUE} an extra row with the \code{"residual"} standard deviation given in \code{sigma} will be included in the output. Defaults to \code{FALSE}.} \item{\dots}{optional arguments passed to \code{print.default}; see the documentation on that method function.} } \description{ The standard deviations and correlations associated with the positive-definite matrix represented by \code{object} (considered as a variance-covariance matrix) are printed, together with the formula and the grouping level associated \code{object}, if any are present. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{summary.pdMat}},\code{\link{pdMat}}} \examples{ pd1 <- pdCompSymm(3 * diag(2) + 1, form = ~age + age^2, data = Orthodont) print(summary(pd1), sigma = 1.2, resid = TRUE) } \keyword{models} nlme/man/varWeights.glsStruct.Rd0000644000176200001440000000232312222553014016357 0ustar liggesusers% File nlme/man/varWeights.glsStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{varWeights.glsStruct} \title{Variance Weights for glsStruct Object} \usage{ \method{varWeights}{glsStruct}(object) } \alias{varWeights.glsStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{glsStruct}"}, representing a list of linear model components, such as \code{corStruct} and \code{"\link{varFunc}"} objects.} } \description{ If \code{object} includes a \code{varStruct} component, the inverse of the standard deviations of the variance function structure represented by the corresponding \code{varFunc} object are returned; else, a vector of ones of length equal to the number of observations in the data frame used to fit the associated linear model is returned. } \value{ if \code{object} includes a \code{varStruct} component, a vector with the corresponding variance weights; else, or a vector of ones. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{varWeights}}} \keyword{models} nlme/man/getGroups.data.frame.Rd0000644000176200001440000000371712222553014016233 0ustar liggesusers% File nlme/man/getGroups.data.frame.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getGroups.data.frame} \title{Extract Groups from a Data Frame} \usage{ \method{getGroups}{data.frame}(object, form, level, data, sep) } \alias{getGroups.data.frame} \arguments{ \item{object}{an object inheriting from class \code{data.frame}.} \item{form}{an optional formula with a conditioning expression on its right hand side (i.e. an expression involving the \code{|} operator). Defaults to \code{formula(object)}.} \item{level}{a positive integer vector with the level(s) of grouping to be used when multiple nested levels of grouping are present. Defaults to all levels of nesting.} \item{data}{unused} \item{sep}{character, the separator to use between group levels when multiple levels are collapsed. The default is \code{'/'}.} } \description{ Each variable named in the expression after the \code{|} operator on the right hand side of \code{form} is evaluated in \code{object}. If more than one variable is indicated in \code{level} they are combined into a data frame; else the selected variable is returned as a vector. When multiple grouping levels are defined in \code{form} and \code{level > 1}, the levels of the returned factor are obtained by pasting together the levels of the grouping factors of level greater or equal to \code{level}, to ensure their uniqueness. } \value{ either a data frame with columns given by the grouping factors indicated in \code{level}, from outer to inner, or, when a single level is requested, a factor representing the selected grouping factor. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. pp. 100, 461. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{getGroupsFormula}}} \examples{ getGroups(Pixel) getGroups(Pixel, level = 2) } \keyword{models} nlme/man/gnlsStruct.Rd0000644000176200001440000000236612222553014014422 0ustar liggesusers% File nlme/man/gnlsStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{gnlsStruct} \title{Generalized Nonlinear Least Squares Structure} \usage{ gnlsStruct(corStruct, varStruct) } \alias{gnlsStruct} \alias{Initialize.gnlsStruct} \arguments{ \item{corStruct}{an optional \code{corStruct} object, representing a correlation structure. Default is \code{NULL}.} \item{varStruct}{an optional \code{varFunc} object, representing a variance function structure. Default is \code{NULL}.} } \description{ A generalized nonlinear least squares structure is a list of model components representing different sets of parameters in the nonlinear model. A \code{gnlsStruct} may contain \code{corStruct} and \code{varFunc} objects. \code{NULL} arguments are not included in the \code{gnlsStruct} list. } \value{ a list of model variance-covariance components determining the parameters to be estimated for the associated nonlinear model. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gnls}}, \code{\link{corClasses}}, \code{\link{residuals.gnlsStruct}} \code{\link{varFunc}} } \examples{ gnls1 <- gnlsStruct(corAR1(), varPower()) } \keyword{models} nlme/man/asOneFormula.Rd0000644000176200001440000000207612222553014014643 0ustar liggesusers% File nlme/man/asOneFormula.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{asOneFormula} \title{Combine Formulas of a Set of Objects} \usage{ asOneFormula(\dots, omit) } \alias{asOneFormula} \arguments{ \item{\dots}{objects, or lists of objects, from which a formula can be extracted.} \item{omit}{an optional character vector with the names of variables to be omitted from the returned formula. Defaults to c(".", "pi").} } \description{ The names of all variables used in the formulas extracted from the objects defined in \code{\dots} are converted into a single linear formula, with the variables names separated by \code{+}. } \value{ a one-sided linear formula with all variables named in the formulas extracted from the objects in \code{\dots}, except the ones listed in \code{omit}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{formula}}, \code{\link{all.vars}}} \examples{ asOneFormula(y ~ x + z | g, list(~ w, ~ t * sin(2 * pi))) } \keyword{models} nlme/man/plot.augPred.Rd0000644000176200001440000000310412222553014014605 0ustar liggesusers% File nlme/man/plot.augPred.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.augPred} \title{Plot an augPred Object} \usage{ \method{plot}{augPred}(x, key, grid, \dots) } \alias{plot.augPred} \arguments{ \item{x}{an object of class \code{"\link{augPred}"}.} \item{key}{an optional logical value, or list. If \code{TRUE}, a legend is included at the top of the plot indicating which symbols (colors) correspond to which prediction levels. If \code{FALSE}, no legend is included. If given as a list, \code{key} is passed down as an argument to the \code{trellis} function generating the plots (\code{xyplot}). Defaults to \code{TRUE}.} \item{grid}{an optional logical value indicating whether a grid should be added to plot. Default is \code{FALSE}.} \item{\dots}{optional arguments passed down to the \code{trellis} function generating the plots.} } \description{ A Trellis \code{xyplot} of predictions versus the primary covariate is generated, with a different panel for each value of the grouping factor. Predicted values are joined by lines, with different line types (colors) being used for each level of grouping. Original observations are represented by circles. } \value{ A Trellis plot of predictions versus the primary covariate, with panels determined by the grouping factor. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{augPred}}, \code{\link{xyplot}}} \examples{ fm1 <- lme(Orthodont) plot(augPred(fm1, level = 0:1, length.out = 2)) } \keyword{models} nlme/man/ergoStool.Rd0000644000176200001440000000262712222456762014243 0ustar liggesusers% File nlme/man/ergoStool.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{ergoStool} \alias{ergoStool} \title{Ergometrics experiment with stool types} \description{ The \code{ergoStool} data frame has 36 rows and 3 columns. } \format{ This data frame contains the following columns: \describe{ \item{effort}{ a numeric vector giving the effort (Borg scale) required to arise from a stool. } \item{Type}{ a factor with levels \code{T1}, \code{T2}, \code{T3}, and \code{T4} giving the stool type. } \item{Subject}{ an ordered factor giving a unique identifier for the subject in the experiment. } } } \details{ Devore (2000) cites data from an article in \emph{Ergometrics} (1993, pp. 519-535) on ``The Effects of a Pneumatic Stool and a One-Legged Stool on Lower Limb Joint Load and Muscular Activity.'' } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.9) Devore, J. L. (2000), \emph{Probability and Statistics for Engineering and the Sciences (5th ed)}, Duxbury, Boston, MA. } \examples{ fm1 <- lme(effort ~ Type, data = ergoStool, random = ~ 1 | Subject) anova( fm1 ) } \keyword{datasets} nlme/man/fitted.gnlsStruct.Rd0000644000176200001440000000220712222553014015672 0ustar liggesusers% File nlme/man/fitted.gnlsStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{fitted.gnlsStruct} \title{Calculate gnlsStruct Fitted Values} \usage{ \method{fitted}{gnlsStruct}(object, \dots) } \alias{fitted.gnlsStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{gnlsStruct}"}, representing a list of model components, such as \code{corStruct} and \code{varFunc} objects, and attributes specifying the underlying nonlinear model and the response variable.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The fitted values for the nonlinear model represented by \code{object} are extracted. } \value{ a vector with the fitted values for the nonlinear model represented by \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ This method function is generally only used inside \code{gnls} and \code{fitted.gnls}. } \seealso{\code{\link{gnls}}, %\code{\link{fitted.gnls}}, \code{\link{residuals.gnlsStruct}} } \keyword{models} nlme/man/logLik.glsStruct.Rd0000644000176200001440000000320712222553014015457 0ustar liggesusers% File nlme/man/logLik.glsStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{logLik.glsStruct} \title{Log-Likelihood of a glsStruct Object} \usage{ \method{logLik}{glsStruct}(object, Pars, conLin, \dots) } \alias{logLik.glsStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{glsStruct}"}, representing a list of linear model components, such as \code{corStruct} and \code{"\link{varFunc}"} objects.} \item{Pars}{the parameter values at which the (restricted) log-likelihood is to be evaluated.} \item{conLin}{an optional condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying linear model. Defaults to \code{attr(object, "conLin")}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ \code{Pars} is used to update the coefficients of the model components of \code{object} and the individual (restricted) log-likelihood contributions of each component are added together. The type of log-likelihood (restricted or not) is determined by the \code{settings} attribute of \code{object}. } \value{ the (restricted) log-likelihood for the linear model described by \code{object}, evaluated at \code{Pars}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gls}}, \code{\link{glsStruct}}, \code{\link{logLik.lme}} } \keyword{models} nlme/man/getData.lmList.Rd0000644000176200001440000000203312222553014015055 0ustar liggesusers% File nlme/man/getData.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getData.lmList} \title{Extract lmList Object Data} \usage{ \method{getData}{lmList}(object) } \alias{getData.lmList} \arguments{ \item{object}{an object inheriting from class \code{lmList}, representing a list of \code{lm} objects with a common model. } } \description{ If present in the calling sequence used to produce \code{object}, the data frame used to fit the model is obtained. } \value{ if a \code{data} argument is present in the calling sequence that produced \code{object}, the corresponding data frame (with \code{na.action} and \code{subset} applied to it, if also present in the call that produced \code{object}) is returned; else, \code{NULL} is returned. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}}, \code{\link{getData}} } \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) getData(fm1) } \keyword{models} nlme/man/pdSymm.Rd0000644000176200001440000000662412222553014013524 0ustar liggesusers% File nlme/man/pdSymm.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdSymm} \title{General Positive-Definite Matrix} \usage{ pdSymm(value, form, nam, data) } \alias{pdSymm} \arguments{ \item{value}{an optional initialization value, which can be any of the following: a \code{pdMat} object, a positive-definite matrix, a one-sided linear formula (with variables separated by \code{+}), a vector of character strings, or a numeric vector. Defaults to \code{numeric(0)}, corresponding to an uninitialized object.} \item{form}{an optional one-sided linear formula specifying the row/column names for the matrix represented by \code{object}. Because factors may be present in \code{form}, the formula needs to be evaluated on a data.frame to resolve the names it defines. This argument is ignored when \code{value} is a one-sided formula. Defaults to \code{NULL}.} \item{nam}{an optional vector of character strings specifying the row/column names for the matrix represented by object. It must have length equal to the dimension of the underlying positive-definite matrix and unreplicated elements. This argument is ignored when \code{value} is a vector of character strings. Defaults to \code{NULL}.} \item{data}{an optional data frame in which to evaluate the variables named in \code{value} and \code{form}. It is used to obtain the levels for \code{factors}, which affect the dimensions and the row/column names of the underlying matrix. If \code{NULL}, no attempt is made to obtain information on \code{factors} appearing in the formulas. Defaults to the parent frame from which the function was called.} } \description{ This function is a constructor for the \code{pdSymm} class, representing a general positive-definite matrix. If the matrix associated with \code{object} is of dimension \eqn{n}, it is represented by \eqn{n(n+1)/2}{n*(n+1)/2} unrestricted parameters, using the matrix-logarithm parametrization described in Pinheiro and Bates (1996). When \code{value} is \code{numeric(0)}, an uninitialized \code{pdMat} object, a one-sided formula, or a vector of character strings, \code{object} is returned as an uninitialized \code{pdSymm} object (with just some of its attributes and its class defined) and needs to have its coefficients assigned later, generally using the \code{coef} or \code{matrix} replacement functions. If \code{value} is an initialized \code{pdMat} object, \code{object} will be constructed from \code{as.matrix(value)}. Finally, if \code{value} is a numeric vector, it is assumed to represent the unrestricted coefficients of the matrix-logarithm parametrization of the underlying positive-definite matrix. } \value{ a \code{pdSymm} object representing a general positive-definite matrix, also inheriting from class \code{pdMat}. } \references{ Pinheiro, J.C. and Bates., D.M. (1996) "Unconstrained Parametrizations for Variance-Covariance Matrices", Statistics and Computing, 6, 289-296. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.pdMat}}, \code{\link{coef.pdMat}}, \code{\link{pdClasses}}, \code{\link{matrix<-.pdMat}}} \examples{ pd1 <- pdSymm(diag(1:3), nam = c("A","B","C")) pd1 } \keyword{models} nlme/man/varConstPower.Rd0000644000176200001440000000756512222553014015074 0ustar liggesusers% File nlme/man/varConstPower.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{varConstPower} \title{Constant Plus Power Variance Function} \usage{ varConstPower(const, power, form, fixed) } \alias{varConstPower} \arguments{ \item{const, power}{optional numeric vectors, or lists of numeric values, with, respectively, the coefficients for the constant and the power terms. Both arguments must have length one, unless a grouping factor is specified in \code{form}. If either argument has length greater than one, it must have names which identify its elements to the levels of the grouping factor defined in \code{form}. If a grouping factor is present in \code{form} and the argument has length one, its value will be assigned to all grouping levels. Only positive values are allowed for \code{const}. Default is \code{numeric(0)}, which results in a vector of zeros of appropriate length being assigned to the coefficients when \code{object} is initialized (corresponding to constant variance equal to one).} \item{form}{an optional one-sided formula of the form \code{~ v}, or \code{~ v | g}, specifying a variance covariate \code{v} and, optionally, a grouping factor \code{g} for the coefficients. The variance covariate must evaluate to a numeric vector and may involve expressions using \code{"."}, representing a fitted model object from which fitted values (\code{fitted(.)}) and residuals (\code{resid(.)}) can be extracted (this allows the variance covariate to be updated during the optimization of an object function). When a grouping factor is present in \code{form}, a different coefficient value is used for each of its levels. Several grouping variables may be simultaneously specified, separated by the \code{*} operator, as in \code{~ v | g1 * g2 * g3}. In this case, the levels of each grouping variable are pasted together and the resulting factor is used to group the observations. Defaults to \code{~ fitted(.)} representing a variance covariate given by the fitted values of a fitted model object and no grouping factor. } \item{fixed}{an optional list with components \code{const} and/or \code{power}, consisting of numeric vectors, or lists of numeric values, specifying the values at which some or all of the coefficients in the variance function should be fixed. If a grouping factor is specified in \code{form}, the components of \code{fixed} must have names identifying which coefficients are to be fixed. Coefficients included in \code{fixed} are not allowed to vary during the optimization of an objective function. Defaults to \code{NULL}, corresponding to no fixed coefficients.} } \description{ This function is a constructor for the \code{varConstPower} class, representing a constant plus power variance function structure. Letting \eqn{v} denote the variance covariate and \eqn{\sigma^2(v)}{s2(v)} denote the variance function evaluated at \eqn{v}, the constant plus power variance function is defined as \eqn{\sigma^2(v) = (\theta_1 + |v|^\theta_2)^2}{s2(v) = (t1 + |v|^t2)^2}, where \eqn{\theta_1,\theta_2}{t1, t2} are the variance function coefficients. When a grouping factor is present, different \eqn{\theta_1,\theta_2}{t1, t2} are used for each factor level. } \value{ a \code{varConstPower} object representing a constant plus power variance function structure, also inheriting from class \code{varFunc}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{varClasses}}, \code{\link{varWeights.varFunc}}, \code{\link{coef.varConstPower}}} \examples{ vf1 <- varConstPower(1.2, 0.2, form = ~age|Sex) } \keyword{models} nlme/man/varPower.Rd0000644000176200001440000000675712222553014014067 0ustar liggesusers% File nlme/man/varPower.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{varPower} \title{Power Variance Function} \usage{ varPower(value, form, fixed) } \alias{varPower} \arguments{ \item{value}{an optional numeric vector, or list of numeric values, with the variance function coefficients. \code{Value} must have length one, unless a grouping factor is specified in \code{form}. If \code{value} has length greater than one, it must have names which identify its elements to the levels of the grouping factor defined in \code{form}. If a grouping factor is present in \code{form} and \code{value} has length one, its value will be assigned to all grouping levels. Default is \code{numeric(0)}, which results in a vector of zeros of appropriate length being assigned to the coefficients when \code{object} is initialized (corresponding to constant variance equal to one).} \item{form}{an optional one-sided formula of the form \code{~ v}, or \code{~ v | g}, specifying a variance covariate \code{v} and, optionally, a grouping factor \code{g} for the coefficients. The variance covariate must evaluate to a numeric vector and may involve expressions using \code{"."}, representing a fitted model object from which fitted values (\code{fitted(.)}) and residuals (\code{resid(.)}) can be extracted (this allows the variance covariate to be updated during the optimization of an object function). When a grouping factor is present in \code{form}, a different coefficient value is used for each of its levels. Several grouping variables may be simultaneously specified, separated by the \code{*} operator, like in \code{~ v | g1 * g2 * g3}. In this case, the levels of each grouping variable are pasted together and the resulting factor is used to group the observations. Defaults to \code{~ fitted(.)} representing a variance covariate given by the fitted values of a fitted model object and no grouping factor. } \item{fixed}{an optional numeric vector, or list of numeric values, specifying the values at which some or all of the coefficients in the variance function should be fixed. If a grouping factor is specified in \code{form}, \code{fixed} must have names identifying which coefficients are to be fixed. Coefficients included in \code{fixed} are not allowed to vary during the optimization of an objective function. Defaults to \code{NULL}, corresponding to no fixed coefficients.} } \description{ This function is a constructor for the \code{varPower} class, representing a power variance function structure. Letting \eqn{v} denote the variance covariate and \eqn{\sigma^2(v)}{s2(v)} denote the variance function evaluated at \eqn{v}, the power variance function is defined as \eqn{\sigma^2(v) = |v|^{2\theta}}{s2(v) = |v|^(2*t)}, where \eqn{\theta}{t} is the variance function coefficient. When a grouping factor is present, a different \eqn{\theta}{t} is used for each factor level. } \value{ a \code{varPower} object representing a power variance function structure, also inheriting from class \code{varFunc}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{varWeights.varFunc}}, \code{\link{coef.varPower}}} \examples{ vf1 <- varPower(0.2, form = ~age|Sex) } \keyword{models} nlme/man/Spruce.Rd0000644000176200001440000000233612222456762013524 0ustar liggesusers% File nlme/man/Spruce.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Spruce} \alias{Spruce} \title{Growth of Spruce Trees} \description{ The \code{Spruce} data frame has 1027 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{Tree}{ a factor giving a unique identifier for each tree. } \item{days}{ a numeric vector giving the number of days since the beginning of the experiment. } \item{logSize}{ a numeric vector giving the logarithm of an estimate of the volume of the tree trunk. } \item{plot}{ a factor identifying the plot in which the tree was grown. } } } \details{ Diggle, Liang, and Zeger (1994, Example 1.3, page 5) describe data on the growth of spruce trees that have been exposed to an ozone-rich atmosphere or to a normal atmosphere. } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.28) Diggle, Peter J., Liang, Kung-Yee and Zeger, Scott L. (1994), \emph{Analysis of longitudinal data}, Oxford University Press, Oxford. } %\examples{} \keyword{datasets} nlme/man/PBG.Rd0000644000176200001440000000341612222456762012673 0ustar liggesusers% File nlme/man/PBG.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{PBG} \alias{PBG} \title{Effect of Phenylbiguanide on Blood Pressure} \description{ The \code{PBG} data frame has 60 rows and 5 columns. } \format{ This data frame contains the following columns: \describe{ \item{deltaBP}{ a numeric vector } \item{dose}{ a numeric vector } \item{Run}{ an ordered factor with levels \code{T5} < \code{T4} < \code{T3} < \code{T2} < \code{T1} < \code{P5} < \code{P3} < \code{P2} < \code{P4} < \code{P1} } \item{Treatment}{ a factor with levels \code{MDL 72222} \code{Placebo} } \item{Rabbit}{ an ordered factor with levels \code{5} < \code{3} < \code{2} < \code{4} < \code{1} } } } \details{ Data on an experiment to examine the effect of a antagonist MDL 72222 on the change in blood pressure experienced with increasing dosage of phenylbiguanide are described in Ludbrook (1994) and analyzed in Venables and Ripley (2002, section 10.3). Each of five rabbits was exposed to increasing doses of phenylbiguanide after having either a placebo or the HD5-antagonist MDL 72222 administered. } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.21) Venables, W. N. and Ripley, B. D. (2002) \emph{Modern Applied Statistics with S (4th ed)}, Springer, New York. Ludbrook, J. (1994), Repeated measurements and multiple comparisons in cardiovascular research, \emph{Cardiovascular Research}, \bold{28}, 303-311. } %\examples{} \keyword{datasets} nlme/man/coef.reStruct.Rd0000644000176200001440000000336312222553014014776 0ustar liggesusers% File nlme/man/coef.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{coef.reStruct} \title{reStruct Object Coefficients} \usage{ \method{coef}{reStruct}(object, unconstrained, \dots) \method{coef}{reStruct}(object, \dots) <- value } \alias{coef.reStruct} \alias{coef<-.reStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} \item{unconstrained}{a logical value. If \code{TRUE} the coefficients are returned in unconstrained form (the same used in the optimization algorithm). If \code{FALSE} the coefficients are returned in "natural", possibly constrained, form. Defaults to \code{TRUE}.} \item{value}{a vector with the replacement values for the coefficients associated with \code{object}. It must be a vector with the same length of \code{coef(object)} and must be given in unconstrained form.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the coefficients associated with the positive-definite matrix represented by \code{object}. } \value{ a vector with the coefficients corresponding to \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \section{SIDE EFFECTS}{ On the left side of an assignment, sets the values of the coefficients of \code{object} to \code{value}. } \seealso{\code{\link{coef.pdMat}}, \code{\link{reStruct}}, \code{\link{pdMat}}} \examples{ rs1 <- reStruct(list(A = pdSymm(diag(1:3), form = ~Score), B = pdDiag(2 * diag(4), form = ~Educ))) coef(rs1) } \keyword{models} nlme/man/intervals.lme.Rd0000644000176200001440000000612512707672664015057 0ustar liggesusers% File nlme/man/intervals.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{intervals.lme} \title{Confidence Intervals on lme Parameters} \usage{ \method{intervals}{lme}(object, level = 0.95, which = c("all", "var-cov", "fixed"), \dots) } \alias{intervals.lme} \alias{print.intervals.lme} \arguments{ \item{object}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model.} \item{level}{an optional numeric value with the confidence level for the intervals. Defaults to 0.95.} \item{which}{an optional character string specifying the subset of parameters for which to construct the confidence intervals. Possible values are \code{"all"} for all parameters, \code{"var-cov"} for the variance-covariance parameters only, and \code{"fixed"} for the fixed effects only. Defaults to \code{"all"}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ Approximate confidence intervals for the parameters in the linear mixed-effects model represented by \code{object} are obtained, using a normal approximation to the distribution of the (restricted) maximum likelihood estimators (the estimators are assumed to have a normal distribution centered at the true parameter values and with covariance matrix equal to the negative inverse Hessian matrix of the (restricted) log-likelihood evaluated at the estimated parameters). Confidence intervals are obtained in an unconstrained scale first, using the normal approximation, and, if necessary, transformed to the constrained scale. The \code{pdNatural} parametrization is used for general positive-definite matrices. } \value{ a list with components given by data frames with rows corresponding to parameters and columns \code{lower}, \code{est.}, and \code{upper} representing respectively lower confidence limits, the estimated values, and upper confidence limits for the parameters. Possible components are: \item{fixed}{fixed effects, only present when \code{which} is not equal to \code{"var-cov"}.} \item{reStruct}{random effects variance-covariance parameters, only present when \code{which} is not equal to \code{"fixed"}.} \item{corStruct}{within-group correlation parameters, only present when \code{which} is not equal to \code{"fixed"} and a correlation structure is used in \code{object}.} \item{varFunc}{within-group variance function parameters, only present when \code{which} is not equal to \code{"fixed"} and a variance function structure is used in \code{object}.} \item{sigma}{within-group standard deviation.} } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{intervals}}, \code{\link{print.intervals.lme}}, \code{\link{pdNatural}}} \examples{ fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject) intervals(fm1) } \keyword{models} nlme/man/getGroupsFormula.Rd0000644000176200001440000000344012222553014015551 0ustar liggesusers% File nlme/man/getGroupsFormula.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getGroupsFormula} \title{Extract Grouping Formula} \usage{ getGroupsFormula(object, asList, sep) } \alias{getGroupsFormula} \alias{getGroupsFormula.default} \alias{getGroupsFormula.gls} \alias{getGroupsFormula.lmList} \alias{getGroupsFormula.lme} \alias{getGroupsFormula.reStruct} \arguments{ \item{object}{any object from which a formula can be extracted.} \item{asList}{an optional logical value. If \code{TRUE} the returned value with be a list of formulas; else, if \code{FALSE} the returned value will be a one-sided formula. Defaults to \code{FALSE}.} \item{sep}{character, the separator to use between group levels when multiple levels are collapsed. The default is \code{'/'}.} } \description{ The conditioning expression associated with \code{formula(object)} (i.e. the expression after the \code{|} operator) is returned either as a named list of one-sided formulas, or a single one-sided formula, depending on the value of \code{asList}. The components of the returned list are ordered from outermost to innermost level and are named after the grouping factor expression. } \value{ a one-sided formula, or a list of one-sided formulas, with the grouping structure associated with \code{formula(object)}. If no conditioning expression is present in \code{formula(object)} a \code{NULL} value is returned. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{getGroupsFormula.gls}}, \code{\link{getGroupsFormula.lmList}}, \code{\link{getGroupsFormula.lme}}, \code{\link{getGroupsFormula.reStruct}}, \code{\link{getGroups}} } \examples{ getGroupsFormula(y ~ x | g1/g2) } \keyword{models} nlme/man/gnlsObject.Rd0000644000176200001440000000476212707672664014373 0ustar liggesusers% File nlme/man/gnlsObject.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{gnlsObject} \title{Fitted gnls Object} \alias{gnlsObject} \description{ An object returned by the \code{gnls} function, inheriting from class \code{gnls} and also from class \code{gls}, and representing a generalized nonlinear least squares fitted model. Objects of this class have methods for the generic functions \code{anova}, \code{coef}, \code{fitted}, \code{formula}, \code{getGroups}, \code{getResponse}, \code{intervals}, \code{logLik}, \code{plot}, \code{predict}, \code{print}, \code{residuals}, \code{summary}, and \code{update}. } \value{ The following components must be included in a legitimate \code{gnls} object. \item{apVar}{an approximate covariance matrix for the variance-covariance coefficients. If \code{apVar = FALSE} in the control values used in the call to \code{gnls}, this component is equal to \code{NULL}.} \item{call}{a list containing an image of the \code{gnls} call that produced the object.} \item{coefficients}{a vector with the estimated nonlinear model coefficients.} \item{contrasts}{a list with the contrasts used to represent factors in the model formula. This information is important for making predictions from a new data frame in which not all levels of the original factors are observed. If no factors are used in the model, this component will be an empty list.} \item{dims}{a list with basic dimensions used in the model fit, including the components \code{N} - the number of observations used in the fit and \code{p} - the number of coefficients in the nonlinear model.} \item{fitted}{a vector with the fitted values.} \item{modelStruct}{an object inheriting from class \code{gnlsStruct}, representing a list of model components, such as \code{corStruct} and \code{varFunc} objects.} \item{groups}{a vector with the correlation structure grouping factor, if any is present.} \item{logLik}{the log-likelihood at convergence.} \item{numIter}{the number of iterations used in the iterative algorithm.} \item{plist}{} \item{pmap}{} \item{residuals}{a vector with the residuals.} \item{sigma}{the estimated residual standard error.} \item{varBeta}{an approximate covariance matrix of the coefficients estimates.} } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gnls}}, \code{gnlsStruct}} \keyword{models} nlme/man/pairs.lmList.Rd0000644000176200001440000000732313330762523014641 0ustar liggesusers% File nlme/man/pairs.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pairs.lmList} \title{Pairs Plot of an lmList Object} \usage{ \method{pairs}{lmList}(x, form, label, id, idLabels, grid, \dots) } \alias{pairs.lmList} \arguments{ \item{x}{an object inheriting from class \code{"\link{lmList}"}, representing a list of \code{lm} objects with a common model. } \item{form}{an optional one-sided formula specifying the desired type of plot. Any variable present in the original data frame used to obtain \code{x} can be referenced. In addition, \code{x} itself can be referenced in the formula using the symbol \code{"."}. Conditional expressions on the right of a \code{|} operator can be used to define separate panels in a Trellis display. The expression on the right hand side of \code{form}, and to the left of the \code{|} operator, must evaluate to a data frame with at least two columns. Default is \code{~ coef(.) }, corresponding to a pairs plot of the coefficients of \code{x}. } \item{label}{an optional character vector of labels for the variables in the pairs plot.} \item{id}{an optional numeric value, or one-sided formula. If given as a value, it is used as a significance level for an outlier test based on the Mahalanobis distances of the estimated random effects. Groups with random effects distances greater than the \eqn{1-value} percentile of the appropriate chi-square distribution are identified in the plot using \code{idLabels}. If given as a one-sided formula, its right hand side must evaluate to a logical, integer, or character vector which is used to identify points in the plot. If missing, no points are identified. } \item{idLabels}{an optional vector, or one-sided formula. If given as a vector, it is converted to character and used to label the points identified according to \code{id}. If given as a one-sided formula, its right hand side must evaluate to a vector which is converted to character and used to label the identified points. Default is the innermost grouping factor. } \item{grid}{an optional logical value indicating whether a grid should be added to plot. Default is \code{FALSE}.} \item{\dots}{optional arguments passed to the Trellis plot function. } } \description{ Diagnostic plots for the linear model fits corresponding to the \code{x} components are obtained. The \code{form} argument gives considerable flexibility in the type of plot specification. A conditioning expression (on the right side of a \code{|} operator) always implies that different panels are used for each level of the conditioning factor, according to a Trellis display. The expression on the right hand side of the formula, before a \code{|} operator, must evaluate to a data frame with at least two columns. If the data frame has two columns, a scatter plot of the two variables is displayed (the Trellis function \code{xyplot} is used). Otherwise, if more than two columns are present, a scatter plot matrix with pairwise scatter plots of the columns in the data frame is displayed (the Trellis function \code{splom} is used). } \value{ a diagnostic Trellis plot. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}}, \code{\link{pairs.lme}}, \code{\link{pairs.compareFits}}, \code{\link{xyplot}}, \code{\link{splom}}} \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) # scatter plot of coefficients by gender, identifying unusual subjects pairs(fm1, ~coef(.) | Sex, id = 0.1, adj = -0.5) # scatter plot of estimated random effects -- "bivariate Gaussian (?)" pairs(fm1, ~ranef(.)) } \keyword{models} nlme/man/Coef.Rd0000644000176200001440000000216012222553014013116 0ustar liggesusers% File nlme/man/Coef.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Coef} \title{Assign Values to Coefficients} \usage{ coef(object, \dots) <- value } \alias{coef<-} \alias{coefficients<-} \arguments{ \item{object}{any object representing a fitted model, or, by default, any object with a \code{coef} component.} \item{\dots}{some methods for this generic function may require additional arguments.} \item{value}{a value to be assigned to the coefficients associated with \code{object}.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include all \code{"\link{pdMat}"}, \code{"\link{corStruct}"} and \code{"\link{varFunc}"} classes, \code{"\link{reStruct}"}, and \code{"modelStruct"}. } \value{ will depend on the method function; see the appropriate documentation. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{coef}}} \examples{ ## see the method function documentation } \keyword{models} nlme/man/plot.lmList.Rd0000644000176200001440000001024112222553014014462 0ustar liggesusers% File nlme/man/plot.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.lmList} \title{Plot an lmList Object} \usage{ \method{plot}{lmList}(x, form, abline, id, idLabels, grid, \dots) } \alias{plot.lmList} \arguments{ \item{x}{an object inheriting from class \code{"\link{lmList}"}, representing a list of \code{lm} objects with a common model.} \item{form}{an optional formula specifying the desired type of plot. Any variable present in the original data frame used to obtain \code{x} can be referenced. In addition, \code{x} itself can be referenced in the formula using the symbol \code{"."}. Conditional expressions on the right of a \code{|} operator can be used to define separate panels in a Trellis display. Default is \code{resid(., type = "pool") ~ fitted(.) }, corresponding to a plot of the standardized residuals (using a pooled estimate for the residual standard error) versus fitted values. } \item{abline}{an optional numeric value, or numeric vector of length two. If given as a single value, a horizontal line will be added to the plot at that coordinate; else, if given as a vector, its values are used as the intercept and slope for a line added to the plot. If missing, no lines are added to the plot. } \item{id}{an optional numeric value, or one-sided formula. If given as a value, it is used as a significance level for a two-sided outlier test for the standardized residuals. Observations with absolute standardized residuals greater than the \eqn{1 - value/2} quantile of the standard normal distribution are identified in the plot using \code{idLabels}. If given as a one-sided formula, its right hand side must evaluate to a logical, integer, or character vector which is used to identify observations in the plot. If missing, no observations are identified. } \item{idLabels}{an optional vector, or one-sided formula. If given as a vector, it is converted to character and used to label the observations identified according to \code{id}. If given as a one-sided formula, its right hand side must evaluate to a vector which is converted to character and used to label the identified observations. Default is \code{getGroups(x)}. } \item{grid}{an optional logical value indicating whether a grid should be added to plot. Default depends on the type of Trellis plot used: if \code{xyplot} defaults to \code{TRUE}, else defaults to \code{FALSE}. } \item{\dots}{optional arguments passed to the Trellis plot function.} } \description{ Diagnostic plots for the linear model fits corresponding to the \code{x} components are obtained. The \code{form} argument gives considerable flexibility in the type of plot specification. A conditioning expression (on the right side of a \code{|} operator) always implies that different panels are used for each level of the conditioning factor, according to a Trellis display. If \code{form} is a one-sided formula, histograms of the variable on the right hand side of the formula, before a \code{|} operator, are displayed (the Trellis function \code{histogram} is used). If \code{form} is two-sided and both its left and right hand side variables are numeric, scatter plots are displayed (the Trellis function \code{xyplot} is used). Finally, if \code{form} is two-sided and its left had side variable is a factor, box-plots of the right hand side variable by the levels of the left hand side variable are displayed (the Trellis function \code{bwplot} is used). } \value{ a diagnostic Trellis plot. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}},\code{\link{predict.lm}}, \code{\link{xyplot}}, \code{\link{bwplot}}, \code{\link{histogram}} } \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) # standardized residuals versus fitted values by gender plot(fm1, resid(., type = "pool") ~ fitted(.) | Sex, abline = 0, id = 0.05) # box-plots of residuals by Subject plot(fm1, Subject ~ resid(.)) # observed versus fitted values by Subject plot(fm1, distance ~ fitted(.) | Subject, abline = c(0,1)) } \keyword{models} nlme/man/corAR1.Rd0000644000176200001440000000661512222553014013342 0ustar liggesusers% File nlme/man/corAR1.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corAR1} \title{AR(1) Correlation Structure} \usage{ corAR1(value, form, fixed) } \alias{corAR1} \arguments{ \item{value}{the value of the lag 1 autocorrelation, which must be between -1 and 1. Defaults to 0 (no autocorrelation).} \item{form}{a one sided formula of the form \code{~ t}, or \code{~ t | g}, specifying a time covariate \code{t} and, optionally, a grouping factor \code{g}. A covariate for this correlation structure must be integer valued. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{corAR1} class, representing an autocorrelation structure of order 1. Objects created using this constructor must later be initialized using the appropriate \code{Initialize} method. } \value{ an object of class \code{corAR1}, representing an autocorrelation structure of order 1. } \references{ Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden-Day. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. pp. 235, 397. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{ACF.lme}}, \code{\link{corARMA}}, \code{\link{corClasses}}, \code{\link{Dim.corSpatial}}, \code{\link{Initialize.corStruct}}, \code{\link{summary.corStruct}} } \examples{ ## covariate is observation order and grouping factor is Mare cs1 <- corAR1(0.2, form = ~ 1 | Mare) # Pinheiro and Bates, p. 236 cs1AR1 <- corAR1(0.8, form = ~ 1 | Subject) cs1AR1. <- Initialize(cs1AR1, data = Orthodont) corMatrix(cs1AR1.) # Pinheiro and Bates, p. 240 fm1Ovar.lme <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data = Ovary, random = pdDiag(~sin(2*pi*Time))) fm2Ovar.lme <- update(fm1Ovar.lme, correlation = corAR1()) # Pinheiro and Bates, pp. 255-258: use in gls fm1Dial.gls <- gls(rate ~(pressure + I(pressure^2) + I(pressure^3) + I(pressure^4))*QB, Dialyzer) fm2Dial.gls <- update(fm1Dial.gls, weights = varPower(form = ~ pressure)) fm3Dial.gls <- update(fm2Dial.gls, corr = corAR1(0.771, form = ~ 1 | Subject)) # Pinheiro and Bates use in nlme: # from p. 240 needed on p. 396 fm1Ovar.lme <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data = Ovary, random = pdDiag(~sin(2*pi*Time))) fm5Ovar.lme <- update(fm1Ovar.lme, corr = corARMA(p = 1, q = 1)) # p. 396 fm1Ovar.nlme <- nlme(follicles~ A+B*sin(2*pi*w*Time)+C*cos(2*pi*w*Time), data=Ovary, fixed=A+B+C+w~1, random=pdDiag(A+B+w~1), start=c(fixef(fm5Ovar.lme), 1) ) # p. 397 fm2Ovar.nlme <- update(fm1Ovar.nlme, corr=corAR1(0.311) ) } \keyword{models} nlme/man/logLik.corStruct.Rd0000644000176200001440000000256412222553014015462 0ustar liggesusers% File nlme/man/logLik.corStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{logLik.corStruct} \title{Extract corStruct Log-Likelihood} \usage{ \method{logLik}{corStruct}(object, data, \dots) } \alias{logLik.corStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{corStruct}"}, representing a correlation structure.} \item{data}{this argument is included to make this method function compatible with other \code{logLik} methods and will be ignored.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the component of a Gaussian log-likelihood associated with the correlation structure, which is equal to the negative of the logarithm of the determinant (or sum of the logarithms of the determinants) of the matrix (or matrices) represented by \code{object}. } \value{ the negative of the logarithm of the determinant (or sum of the logarithms of the determinants) of the correlation matrix (or matrices) represented by \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{logDet.corStruct}}, \code{\link{logLik.lme}}, } \examples{ cs1 <- corAR1(0.2) cs1 <- Initialize(cs1, data = Orthodont) logLik(cs1) } \keyword{models} nlme/man/Rail.Rd0000644000176200001440000000234612222456762013153 0ustar liggesusers% File nlme/man/Rail.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Rail} \alias{Rail} \title{Evaluation of Stress in Railway Rails} \description{ The \code{Rail} data frame has 18 rows and 2 columns. } \format{ This data frame contains the following columns: \describe{ \item{Rail}{ an ordered factor identifying the rail on which the measurement was made. } \item{travel}{ a numeric vector giving the travel time for ultrasonic head-waves in the rail (nanoseconds). The value given is the original travel time minus 36,100 nanoseconds. } } } \details{ Devore (2000, Example 10.10, p. 427) cites data from an article in \emph{Materials Evaluation} on ``a study of travel time for a certain type of wave that results from longitudinal stress of rails used for railroad track.'' } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.26) Devore, J. L. (2000), \emph{Probability and Statistics for Engineering and the Sciences (5th ed)}, Duxbury, Boston, MA. } %\examples{} \keyword{datasets} nlme/man/Wheat.Rd0000644000176200001440000000162212222456762013330 0ustar liggesusers% File nlme/man/Wheat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Wheat} \alias{Wheat} \title{Yields by growing conditions} \description{ The \code{Wheat} data frame has 48 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{Tray}{ an ordered factor with levels \code{3} < \code{1} < \code{2} < \code{4} < \code{5} < \code{6} < \code{8} < \code{9} < \code{7} < \code{12} < \code{11} < \code{10} } \item{Moisture}{ a numeric vector } \item{fertilizer}{ a numeric vector } \item{DryMatter}{ a numeric vector } } } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } %\examples{} \keyword{datasets} nlme/man/corNatural.Rd0000644000176200001440000000420712222553014014360 0ustar liggesusers% File nlme/man/corNatural.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corNatural} \title{General correlation in natural parameterization} \usage{ corNatural(value, form, fixed) } \alias{corNatural} \alias{print.corNatural} \arguments{ \item{value}{an optional vector with the parameter values. Default is \code{numeric(0)}, which results in a vector of zeros of appropriate dimension being assigned to the parameters when \code{object} is initialized (corresponding to an identity correlation structure).} \item{form}{a one sided formula of the form \code{~ t}, or \code{~ t | g}, specifying a time covariate \code{t} and, optionally, a grouping factor \code{g}. A covariate for this correlation structure must be integer valued. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{corNatural} class, representing a general correlation structure in the ``natural'' parameterization, which is described under \code{\link{pdNatural}}. Objects created using this constructor must later be initialized using the appropriate \code{Initialize} method. } \value{ an object of class \code{corNatural} representing a general correlation structure. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{Initialize.corNatural}}, \code{\link{pdNatural}}, \code{\link{summary.corNatural}} } \examples{ ## covariate is observation order and grouping factor is Subject cs1 <- corNatural(form = ~ 1 | Subject) } \keyword{models} nlme/man/ACF.gls.Rd0000644000176200001440000000664312222553014013431 0ustar liggesusers% File nlme/man/ACF.gls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{ACF.gls} \title{Autocorrelation Function for gls Residuals} \usage{ \method{ACF}{gls}(object, maxLag, resType, form, na.action, \dots) } \alias{ACF.gls} \arguments{ \item{object}{an object inheriting from class \code{"\link{gls}"}, representing a generalized least squares fitted model.} \item{maxLag}{an optional integer giving the maximum lag for which the autocorrelation should be calculated. Defaults to maximum lag in the residuals.} \item{resType}{an optional character string specifying the type of residuals to be used. If \code{"response"}, the "raw" residuals (observed - fitted) are used; else, if \code{"pearson"}, the standardized residuals (raw residuals divided by the corresponding standard errors) are used; else, if \code{"normalized"}, the normalized residuals (standardized residuals pre-multiplied by the inverse square-root factor of the estimated error correlation matrix) are used. Partial matching of arguments is used, so only the first character needs to be provided. Defaults to \code{"pearson"}.} \item{form}{an optional one sided formula of the form \code{~ t}, or \code{~ t | g}, specifying a time covariate \code{t} and, optionally, a grouping factor \code{g}. The time covariate must be integer valued. When a grouping factor is present in \code{form}, the autocorrelations are calculated using residual pairs within the same group. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{na.fail}) causes \code{ACF.gls} to print an error message and terminate if there are any incomplete observations.} \item{\dots}{some methods for this generic require additional arguments.} } \description{ This method function calculates the empirical autocorrelation function for the residuals from a \code{gls} fit. If a grouping variable is specified in \code{form}, the autocorrelation values are calculated using pairs of residuals within the same group; otherwise all possible residual pairs are used. The autocorrelation function is useful for investigating serial correlation models for equally spaced data. } \value{ a data frame with columns \code{lag} and \code{ACF} representing, respectively, the lag between residuals within a pair and the corresponding empirical autocorrelation. The returned value inherits from class \code{ACF}. } \references{ Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden-Day. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{ACF.lme}}, \code{\link{plot.ACF}}} \examples{ fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary) ACF(fm1, form = ~ 1 | Mare) # Pinheiro and Bates, p. 255-257 fm1Dial.gls <- gls(rate ~ (pressure+I(pressure^2)+I(pressure^3)+I(pressure^4))*QB, Dialyzer) fm2Dial.gls <- update(fm1Dial.gls, weights = varPower(form = ~ pressure)) ACF(fm2Dial.gls, form = ~ 1 | Subject) } \keyword{models} nlme/man/intervals.lmList.Rd0000644000176200001440000000362112707672664015544 0ustar liggesusers% File nlme/man/intervals.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{intervals.lmList} \title{Confidence Intervals on lmList Coefficients} \usage{ \method{intervals}{lmList}(object, level = 0.95, pool = attr(object, "pool"), \dots) } \alias{intervals.lmList} \alias{print.intervals.lmList} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmList}"}, representing a list of \code{lm} objects with a common model. } \item{level}{an optional numeric value with the confidence level for the intervals. Defaults to 0.95. } \item{pool}{an optional logical value indicating whether a pooled estimate of the residual standard error should be used. Default is \code{attr(object, "pool")}. } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ Confidence intervals on the linear model coefficients are obtained for each \code{lm} component of \code{object} and organized into a three dimensional array. The first dimension corresponding to the names of the \code{object} components. The second dimension is given by \code{lower}, \code{est.}, and \code{upper} corresponding, respectively, to the lower confidence limit, estimated coefficient, and upper confidence limit. The third dimension is given by the coefficients names. } \value{ a three dimensional array with the confidence intervals and estimates for the coefficients of each \code{lm} component of \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \seealso{\code{\link{lmList}}, \code{\link{intervals}}, \code{\link{plot.intervals.lmList}} } \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) intervals(fm1) } \keyword{models} nlme/man/BodyWeight.Rd0000644000176200001440000000363112222456762014327 0ustar liggesusers% File nlme/man/BodyWeight.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{BodyWeight} \alias{BodyWeight} \title{Rat weight over time for different diets} \description{ The \code{BodyWeight} data frame has 176 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{weight}{ a numeric vector giving the body weight of the rat (grams). } \item{Time}{ a numeric vector giving the time at which the measurement is made (days). } \item{Rat}{ an ordered factor with levels \code{2} < \code{3} < \code{4} < \code{1} < \code{8} < \code{5} < \code{6} < \code{7} < \code{11} < \code{9} < \code{10} < \code{12} < \code{13} < \code{15} < \code{14} < \code{16} identifying the rat whose weight is measured. } \item{Diet}{ a factor with levels \code{1} to \code{3} indicating the diet that the rat receives. } } } \details{ Hand and Crowder (1996) describe data on the body weights of rats measured over 64 days. These data also appear in Table 2.4 of Crowder and Hand (1990). The body weights of the rats (in grams) are measured on day 1 and every seven days thereafter until day 64, with an extra measurement on day 44. The experiment started several weeks before ``day 1.'' There are three groups of rats, each on a different diet. } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.3) Crowder, M. and Hand, D. (1990), \emph{Analysis of Repeated Measures}, Chapman and Hall, London. Hand, D. and Crowder, M. (1996), \emph{Practical Longitudinal Data Analysis}, Chapman and Hall, London. } %\examples{} \keyword{datasets} nlme/man/Dim.corSpatial.Rd0000644000176200001440000000327212222553014015060 0ustar liggesusers% File nlme/man/Dim.corSpatial.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Dim.corSpatial} \title{Dimensions of a corSpatial Object} \usage{ \method{Dim}{corSpatial}(object, groups, \dots) } \alias{Dim.corSpatial} \arguments{ \item{object}{an object inheriting from class \code{"\link{corSpatial}"}, representing a spatial correlation structure.} \item{groups}{an optional factor defining the grouping of the observations; observations within a group are correlated and observations in different groups are uncorrelated.} \item{\dots}{further arguments to be passed to or from methods.} } \description{ if \code{groups} is missing, it returns the \code{Dim} attribute of \code{object}; otherwise, calculates the dimensions associated with the grouping factor. } \value{ a list with components: \item{N}{length of \code{groups}} \item{M}{number of groups} \item{spClass}{an integer representing the spatial correlation class; 0 = user defined class, 1 = \code{corSpher}, 2 = \code{corExp}, 3 = \code{corGaus}, 4 = \code{corLin}} \item{sumLenSq}{sum of the squares of the number of observations per group} \item{len}{an integer vector with the number of observations per group} \item{start}{an integer vector with the starting position for the distance vectors in each group, beginning from zero} } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{Dim}}, \code{\link{Dim.corStruct}} } \examples{ Dim(corGaus(), getGroups(Orthodont)) cs1ARMA <- corARMA(0.4, form = ~ 1 | Subject, q = 1) cs1ARMA <- Initialize(cs1ARMA, data = Orthodont) Dim(cs1ARMA) } \keyword{models} nlme/man/coef.corStruct.Rd0000644000176200001440000000514112222553014015147 0ustar liggesusers% File nlme/man/coef.corStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{coef.corStruct} \title{Coefficients of a corStruct Object} \usage{ \method{coef}{corStruct}(object, unconstrained, \dots) \method{coef}{corStruct}(object, \dots) <- value } \alias{coef.corStruct} \alias{coef.corAR1} \alias{coef.corARMAd} \alias{coef.corCAR1} \alias{coef.corCompSymm} \alias{coef.corHF} \alias{coef.corIdent} \alias{coef.corLin} \alias{coef.corNatural} \alias{coef.corSpatial} \alias{coef.corSpher} \alias{coef.corSymm} \alias{coef<-.corStruct} \alias{coef<-.corAR1} \alias{coef<-.corARMA} \alias{coef<-.corCAR1} \alias{coef<-.corCompSymm} \alias{coef<-.corNatural} \alias{coef<-.corHF} \alias{coef<-.corIdent} \alias{coef<-.corLin} \alias{coef<-.corSpatial} \alias{coef<-.corSpher} \alias{coef<-.corSymm} \alias{coef.summary.nlsList} \arguments{ \item{object}{an object inheriting from class \code{"\link{corStruct}"}, representing a correlation structure.} \item{unconstrained}{a logical value. If \code{TRUE} the coefficients are returned in unconstrained form (the same used in the optimization algorithm). If \code{FALSE} the coefficients are returned in "natural", possibly constrained, form. Defaults to \code{TRUE}.} \item{value}{a vector with the replacement values for the coefficients associated with \code{object}. It must be a vector with the same length of \code{coef{object}} and must be given in unconstrained form.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the coefficients associated with the correlation structure represented by \code{object}. } \value{ a vector with the coefficients corresponding to \code{object}. } \references{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } \author{José Pinheiro and Douglas Bates } \section{SIDE EFFECTS}{ On the left side of an assignment, sets the values of the coefficients of \code{object} to \code{value}. \code{Object} must be initialized (using \code{Initialize}) before new values can be assigned to its coefficients. } \seealso{\code{\link{corAR1}}, \code{\link{corARMA}}, \code{\link{corCAR1}}, \code{\link{corCompSymm}}, \code{\link{corExp}}, \code{\link{corGaus}}, \code{\link{corLin}}, \code{\link{corRatio}}, \code{\link{corSpatial}}, \code{\link{corSpher}}, \code{\link{corSymm}},\code{\link{Initialize}}} \examples{ cst1 <- corARMA(p = 1, q = 1) coef(cst1) } \keyword{models} nlme/man/predict.gnls.Rd0000644000176200001440000000314212222553014014637 0ustar liggesusers% File nlme/man/predict.gnls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{predict.gnls} \title{Predictions from a gnls Object} \usage{ \method{predict}{gnls}(object, newdata, na.action, naPattern, \dots) } \alias{predict.gnls} \arguments{ \item{object}{an object inheriting from class \code{"\link{gnls}"}, representing a generalized nonlinear least squares fitted model.} \item{newdata}{an optional data frame to be used for obtaining the predictions. All variables used in the nonlinear model must be present in the data frame. If missing, the fitted values are returned.} \item{na.action}{a function that indicates what should happen when \code{newdata} contains \code{NA}s. The default action (\code{na.fail}) causes the function to print an error message and terminate if there are any incomplete observations.} \item{naPattern}{an expression or formula object, specifying which returned values are to be regarded as missing.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The predictions for the nonlinear model represented by \code{object} are obtained at the covariate values defined in \code{newdata}. } \value{ a vector with the predicted values. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gnls}}} \examples{ fm1 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal), Soybean, weights = varPower()) newSoybean <- data.frame(Time = c(10,30,50,80,100)) predict(fm1, newSoybean) } \keyword{models} nlme/man/corCompSymm.Rd0000644000176200001440000000472412222553014014522 0ustar liggesusers% File nlme/man/corCompSymm.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corCompSymm} \title{Compound Symmetry Correlation Structure} \usage{ corCompSymm(value, form, fixed) } \alias{corCompSymm} \arguments{ \item{value}{the correlation between any two correlated observations. Defaults to 0.} \item{form}{a one sided formula of the form \code{~ t}, or \code{~ t | g}, specifying a time covariate \code{t} and, optionally, a grouping factor \code{g}. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{corCompSymm} class, representing a compound symmetry structure corresponding to uniform correlation. Objects created using this constructor must later be initialized using the appropriate \code{Initialize} method. } \value{ an object of class \code{corCompSymm}, representing a compound symmetry correlation structure. } \references{ Milliken, G. A. and Johnson, D. E. (1992) "Analysis of Messy Data, Volume I: Designed Experiments", Van Nostrand Reinhold. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. pp. 233-234. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corClasses}}, \code{\link{Initialize.corStruct}}, \code{\link{summary.corStruct}} } \examples{ ## covariate is observation order and grouping factor is Subject cs1 <- corCompSymm(0.5, form = ~ 1 | Subject) # Pinheiro and Bates, pp. 222-225 fm1BW.lme <- lme(weight ~ Time * Diet, BodyWeight, random = ~ Time) # p. 223 fm2BW.lme <- update(fm1BW.lme, weights = varPower()) # p. 225 cs1CompSymm <- corCompSymm(value = 0.3, form = ~ 1 | Subject) cs2CompSymm <- corCompSymm(value = 0.3, form = ~ age | Subject) cs1CompSymm <- Initialize(cs1CompSymm, data = Orthodont) corMatrix(cs1CompSymm) } \keyword{models} nlme/man/logDet.corStruct.Rd0000644000176200001440000000306412222553014015453 0ustar liggesusers% File nlme/man/logDet.corStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{logDet.corStruct} \title{Extract corStruct Log-Determinant} \usage{ \method{logDet}{corStruct}(object, covariate, \dots) } \alias{logDet.corStruct} \alias{logDet.corIdent} \arguments{ \item{object}{an object inheriting from class \code{"\link{corStruct}"}, representing a correlation structure.} \item{covariate}{an optional covariate vector (matrix), or list of covariate vectors (matrices), at which values the correlation matrix, or list of correlation matrices, are to be evaluated. Defaults to \code{getCovariate(object)}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the logarithm of the determinant of a square-root factor of the correlation matrix associated with \code{object}, or the sum of the log-determinants of square-root factors of the list of correlation matrices associated with \code{object}. } \value{ the log-determinant of a square-root factor of the correlation matrix associated with \code{object}, or the sum of the log-determinants of square-root factors of the list of correlation matrices associated with \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{logLik.corStruct}}, \code{\link{corMatrix.corStruct}}, \code{\link{logDet}} } \examples{ cs1 <- corAR1(0.3) logDet(cs1, covariate = 1:4) } \keyword{models} nlme/man/logLik.gnlsStruct.Rd0000644000176200001440000000307412222553014015637 0ustar liggesusers% File nlme/man/logLik.gnlsStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{logLik.gnlsStruct} \title{Log-Likelihood of a gnlsStruct Object} \usage{ \method{logLik}{gnlsStruct}(object, Pars, conLin, \dots) } \alias{logLik.gnlsStruct} \arguments{ \item{object}{an object inheriting from class \code{gnlsStruct}, representing a list of model components, such as \code{corStruct} and \code{varFunc} objects, and attributes specifying the underlying nonlinear model and the response variable.} \item{Pars}{the parameter values at which the log-likelihood is to be evaluated.} \item{conLin}{an optional condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying nonlinear model. Defaults to \code{attr(object, "conLin")}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ \code{Pars} is used to update the coefficients of the model components of \code{object} and the individual log-likelihood contributions of each component are added together. } \value{ the log-likelihood for the linear model described by \code{object}, evaluated at \code{Pars}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gnls}}, \code{\link{gnlsStruct}}, \code{\link{logLik.gnls}} } \keyword{models} nlme/man/balancedGrouped.Rd0000644000176200001440000000442412222553014015326 0ustar liggesusers% File nlme/man/balancedGrouped.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{balancedGrouped} \alias{balancedGrouped} \title{Create a groupedData object from a matrix} \usage{ balancedGrouped(form, data, labels=NULL, units=NULL) } \arguments{ \item{form}{A formula of the form \code{y ~ x | g} giving the name of the response, the primary covariate, and the grouping factor.} \item{data}{A matrix or data frame containing the values of the response grouped according to the levels of the grouping factor (rows) and the distinct levels of the primary covariate (columns). The \code{dimnames} of the matrix are used to construct the levels of the grouping factor and the primary covariate.} \item{labels}{an optional list of character strings giving labels for the response and the primary covariate. The label for the primary covariate is named \code{x} and that for the response is named \code{y}. Either label can be omitted.} \item{units}{an optional list of character strings giving the units for the response and the primary covariate. The units string for the primary covariate is named \code{x} and that for the response is named \code{y}. Either units string can be omitted.} } \description{ Create a \code{groupedData} object from a data matrix. This function can be used only with balanced data. The opposite conversion, from a \code{groupedData} object to a \code{matrix}, is done with \code{asTable}. } \value{ A balanced \code{groupedData} object. } \references{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{groupedData}}, \code{\link{isBalanced}}, \code{\link{asTable}}} \examples{ OrthoMat <- asTable( Orthodont ) Orth2 <- balancedGrouped(distance ~ age | Subject, data = OrthoMat, labels = list(x = "Age", y = "Distance from pituitary to pterygomaxillary fissure"), units = list(x = "(yr)", y = "(mm)")) Orth2[ 1:10, ] ## check the first few entries # Pinheiro and Bates, p. 109 ergoStool.mat <- asTable(ergoStool) balancedGrouped(effort~Type|Subject, data=ergoStool.mat) } \keyword{data} nlme/man/anova.gls.Rd0000644000176200001440000001433712222553014014143 0ustar liggesusers% File nlme/man/anova.gls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{anova.gls} \title{Compare Likelihoods of Fitted Objects} \usage{ \method{anova}{gls}(object, \dots, test, type, adjustSigma, Terms, L, verbose) } \alias{anova.gls} \arguments{ \item{object}{a fitted model object inheriting from class \code{gls}, representing a generalized least squares fit.} \item{\dots}{other optional fitted model objects inheriting from classes \code{"gls"}, \code{"gnls"}, \code{"lm"}, \code{"lme"}, \code{"lmList"}, \code{"nlme"}, \code{"nlsList"}, or \code{"nls"}.} \item{test}{an optional logical value controlling whether likelihood ratio tests should be used to compare the fitted models represented by \code{object} and the objects in \code{\dots}. Defaults to \code{TRUE}.} \item{type}{an optional character string specifying the type of sum of squares to be used in F-tests for the terms in the model. If \code{"sequential"}, the sequential sum of squares obtained by including the terms in the order they appear in the model is used; else, if \code{"marginal"}, the marginal sum of squares obtained by deleting a term from the model at a time is used. This argument is only used when a single fitted object is passed to the function. Partial matching of arguments is used, so only the first character needs to be provided. Defaults to \code{"sequential"}.} \item{adjustSigma}{an optional logical value. If \code{TRUE} and the estimation method used to obtain \code{object} was maximum likelihood, the residual standard error is multiplied by \eqn{\sqrt{n_{obs}/(n_{obs} - n_{par})}}{sqrt(nobs/(nobs - npar))}, converting it to a REML-like estimate. This argument is only used when a single fitted object is passed to the function. Default is \code{TRUE}.} \item{Terms}{an optional integer or character vector specifying which terms in the model should be jointly tested to be zero using a Wald F-test. If given as a character vector, its elements must correspond to term names; else, if given as an integer vector, its elements must correspond to the order in which terms are included in the model. This argument is only used when a single fitted object is passed to the function. Default is \code{NULL}.} \item{L}{an optional numeric vector or array specifying linear combinations of the coefficients in the model that should be tested to be zero. If given as an array, its rows define the linear combinations to be tested. If names are assigned to the vector elements (array columns), they must correspond to coefficients names and will be used to map the linear combination(s) to the coefficients; else, if no names are available, the vector elements (array columns) are assumed in the same order as the coefficients appear in the model. This argument is only used when a single fitted object is passed to the function. Default is \code{NULL}.} \item{verbose}{an optional logical value. If \code{TRUE}, the calling sequences for each fitted model object are printed with the rest of the output, being omitted if \code{verbose = FALSE}. Defaults to \code{FALSE}.} } \description{ When only one fitted model object is present, a data frame with the sums of squares, numerator degrees of freedom, F-values, and P-values for Wald tests for the terms in the model (when \code{Terms} and \code{L} are \code{NULL}), a combination of model terms (when \code{Terms} in not \code{NULL}), or linear combinations of the model coefficients (when \code{L} is not \code{NULL}). Otherwise, when multiple fitted objects are being compared, a data frame with the degrees of freedom, the (restricted) log-likelihood, the Akaike Information Criterion (AIC), and the Bayesian Information Criterion (BIC) of each object is returned. If \code{test=TRUE}, whenever two consecutive objects have different number of degrees of freedom, a likelihood ratio statistic, with the associated p-value is included in the returned data frame. } \value{ a data frame inheriting from class \code{"anova.lme"}. } \references{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ Likelihood comparisons are not meaningful for objects fit using restricted maximum likelihood and with different fixed effects. } \seealso{\code{\link{gls}}, \code{\link{gnls}}, \code{\link{lme}}, \code{\link{logLik.gls}}, \code{\link{AIC}}, \code{\link{BIC}}, \code{\link{print.anova.lme}} } \examples{ # AR(1) errors within each Mare fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) anova(fm1) # variance changes with a power of the absolute fitted values? fm2 <- update(fm1, weights = varPower()) anova(fm1, fm2) # Pinheiro and Bates, p. 251-252 fm1Orth.gls <- gls(distance ~ Sex * I(age - 11), Orthodont, correlation = corSymm(form = ~ 1 | Subject), weights = varIdent(form = ~ 1 | age)) fm2Orth.gls <- update(fm1Orth.gls, corr = corCompSymm(form = ~ 1 | Subject)) anova(fm1Orth.gls, fm2Orth.gls) # Pinheiro and Bates, pp. 215-215, 255-260 #p. 215 fm1Dial.lme <- lme(rate ~(pressure + I(pressure^2) + I(pressure^3) + I(pressure^4))*QB, Dialyzer, ~ pressure + I(pressure^2)) # p. 216 fm2Dial.lme <- update(fm1Dial.lme, weights = varPower(form = ~ pressure)) # p. 255 fm1Dial.gls <- gls(rate ~ (pressure + I(pressure^2) + I(pressure^3) + I(pressure^4))*QB, Dialyzer) fm2Dial.gls <- update(fm1Dial.gls, weights = varPower(form = ~ pressure)) anova(fm1Dial.gls, fm2Dial.gls) fm3Dial.gls <- update(fm2Dial.gls, corr = corAR1(0.771, form = ~ 1 | Subject)) anova(fm2Dial.gls, fm3Dial.gls) # anova.gls to compare a gls and an lme fit anova(fm3Dial.gls, fm2Dial.lme, test = FALSE) # Pinheiro and Bates, pp. 261-266 fm1Wheat2 <- gls(yield ~ variety - 1, Wheat2) fm3Wheat2 <- update(fm1Wheat2, corr = corRatio(c(12.5, 0.2), form = ~ latitude + longitude, nugget = TRUE)) # Test a specific contrast anova(fm3Wheat2, L = c(-1, 0, 1)) } \keyword{models} nlme/man/formula.pdBlocked.Rd0000644000176200001440000000267212222553014015605 0ustar liggesusers% File nlme/man/formula.pdBlocked.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{formula.pdBlocked} \title{Extract pdBlocked Formula} \usage{ \method{formula}{pdBlocked}(x, asList, \dots) } \alias{formula.pdBlocked} \arguments{ \item{x}{an object inheriting from class \code{"pdBlocked"}, representing a positive definite block diagonal matrix.} \item{asList}{an optional logical value. If \code{TRUE}, a list with the formulas for the individual block diagonal elements of \code{x} is returned; else, if \code{FALSE}, a one-sided formula combining all individual formulas is returned. Defaults to \code{FALSE}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The \code{formula} attributes of the \code{pdMat} elements of \code{x} are extracted and returned as a list, in case \code{asList=TRUE}, or converted to a single one-sided formula when \code{asList=FALSE}. If the \code{pdMat} elements do not have a \code{formula} attribute, a \code{NULL} value is returned. } \value{ a list of one-sided formulas, or a single one-sided formula, or \code{NULL}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{pdBlocked}}, \code{\link{pdMat}}} \examples{ pd1 <- pdBlocked(list(~ age, ~ Sex - 1)) formula(pd1) formula(pd1, asList = TRUE) } \keyword{models} nlme/man/plot.gls.Rd0000644000176200001440000001127312222553014014011 0ustar liggesusers% File nlme/man/plot.gls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.gls} \title{Plot a gls Object} \usage{ \method{plot}{gls}(x, form, abline, id, idLabels, idResType, grid, \dots) } \alias{plot.gls} \arguments{ \item{x}{an object inheriting from class \code{"\link{gls}"}, representing a generalized least squares fitted linear model.} \item{form}{an optional formula specifying the desired type of plot. Any variable present in the original data frame used to obtain \code{x} can be referenced. In addition, \code{x} itself can be referenced in the formula using the symbol \code{"."}. Conditional expressions on the right of a \code{|} operator can be used to define separate panels in a Trellis display. Default is \code{resid(., type = "p") ~ fitted(.) }, corresponding to a plot of the standardized residuals versus fitted values, both evaluated at the innermost level of nesting.} \item{abline}{an optional numeric value, or numeric vector of length two. If given as a single value, a horizontal line will be added to the plot at that coordinate; else, if given as a vector, its values are used as the intercept and slope for a line added to the plot. If missing, no lines are added to the plot.} \item{id}{an optional numeric value, or one-sided formula. If given as a value, it is used as a significance level for a two-sided outlier test for the standardized residuals. Observations with absolute standardized residuals greater than the \eqn{1 - value/2} quantile of the standard normal distribution are identified in the plot using \code{idLabels}. If given as a one-sided formula, its right hand side must evaluate to a logical, integer, or character vector which is used to identify observations in the plot. If missing, no observations are identified.} \item{idLabels}{an optional vector, or one-sided formula. If given as a vector, it is converted to character mode and used to label the observations identified according to \code{id}. If given as a one-sided formula, its right hand side must evaluate to a vector which is converted to character mode and used to label the identified observations. Default is the innermost grouping factor.} \item{idResType}{an optional character string specifying the type of residuals to be used in identifying outliers, when \code{id} is a numeric value. If \code{"pearson"}, the standardized residuals (raw residuals divided by the corresponding standard errors) are used; else, if \code{"normalized"}, the normalized residuals (standardized residuals pre-multiplied by the inverse square-root factor of the estimated error correlation matrix) are used. Partial matching of arguments is used, so only the first character needs to be provided. Defaults to \code{"pearson"}.} \item{grid}{an optional logical value indicating whether a grid should be added to plot. Default depends on the type of Trellis plot used: if \code{xyplot} defaults to \code{TRUE}, else defaults to \code{FALSE}.} \item{\dots}{optional arguments passed to the Trellis plot function.} } \description{ Diagnostic plots for the linear model fit are obtained. The \code{form} argument gives considerable flexibility in the type of plot specification. A conditioning expression (on the right side of a \code{|} operator) always implies that different panels are used for each level of the conditioning factor, according to a Trellis display. If \code{form} is a one-sided formula, histograms of the variable on the right hand side of the formula, before a \code{|} operator, are displayed (the Trellis function \code{histogram} is used). If \code{form} is two-sided and both its left and right hand side variables are numeric, scatter plots are displayed (the Trellis function \code{xyplot} is used). Finally, if \code{form} is two-sided and its left had side variable is a factor, box-plots of the right hand side variable by the levels of the left hand side variable are displayed (the Trellis function \code{bwplot} is used). } \value{ a diagnostic Trellis plot. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gls}}, \code{\link{xyplot}}, \code{\link{bwplot}}, \code{\link{histogram}} } \examples{ fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) # standardized residuals versus fitted values by Mare plot(fm1, resid(., type = "p") ~ fitted(.) | Mare, abline = 0) # box-plots of residuals by Mare plot(fm1, Mare ~ resid(.)) # observed versus fitted values by Mare plot(fm1, follicles ~ fitted(.) | Mare, abline = c(0,1)) } \keyword{models} nlme/man/Variogram.default.Rd0000644000176200001440000000371613330762523015634 0ustar liggesusers% File nlme/man/Variogram.default.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Variogram.default} \title{Calculate Semi-variogram} \usage{ \method{Variogram}{default}(object, distance, \dots) } \alias{Variogram.default} \arguments{ \item{object}{a numeric vector with the values to be used for calculating the semi-variogram, usually a residual vector from a fitted model.} \item{distance}{a numeric vector with the pairwise distances corresponding to the elements of \code{object}. The order of the elements in \code{distance} must correspond to the pairs \code{(1,2), (1,3), \dots, (n-1,n)}, with \code{n} representing the length of \code{object}, and must have length \code{n(n-1)/2}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function calculates the semi-variogram for an arbitrary vector \code{object}, according to the distances in \code{distance}. For each pair of elements \eqn{x,y} in \code{object}, the corresponding semi-variogram is \eqn{(x-y)^2/2}. The semi-variogram is useful for identifying and modeling spatial correlation structures in observations with constant expectation and constant variance. } \value{ a data frame with columns \code{variog} and \code{dist} representing, respectively, the semi-variogram values and the corresponding distances. The returned value inherits from class \code{Variogram}. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{Variogram}}, \code{\link{Variogram.gls}}, \code{\link{Variogram.lme}}, \code{\link{plot.Variogram}}} \examples{ fm1 <- lm(follicles ~ sin(2 * pi * Time) + cos(2 * pi * Time), Ovary, subset = Mare == 1) Variogram(resid(fm1), dist(1:29))[1:10,] } \keyword{models} nlme/man/fitted.lmList.Rd0000644000176200001440000000306412222553014014770 0ustar liggesusers% File nlme/man/fitted.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{fitted.lmList} \title{Extract lmList Fitted Values} \usage{ \method{fitted}{lmList}(object, subset, asList, \dots) } \alias{fitted.lmList} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmList}"}, representing a list of \code{lm} objects with a common model. } \item{subset}{an optional character or integer vector naming the \code{lm} components of \code{object} from which the fitted values are to be extracted. Default is \code{NULL}, in which case all components are used. } \item{asList}{an optional logical value. If \code{TRUE}, the returned object is a list with the fitted values split by groups; else the returned value is a vector. Defaults to \code{FALSE}. } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The fitted values are extracted from each \code{lm} component of \code{object} and arranged into a list with as many components as \code{object}, or combined into a single vector. } \value{ a list with components given by the fitted values of each \code{lm} component of \code{object}, or a vector with the fitted values for all \code{lm} components of \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}}, \code{\link{residuals.lmList}}} \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) fitted(fm1) } \keyword{models} nlme/man/Oxide.Rd0000644000176200001440000000311512222456762013327 0ustar liggesusers% File nlme/man/Oxide.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Oxide} \alias{Oxide} \title{Variability in Semiconductor Manufacturing} \description{ The \code{Oxide} data frame has 72 rows and 5 columns. } \format{ This data frame contains the following columns: \describe{ \item{Source}{ a factor with levels \code{1} and \code{2} } \item{Lot}{ a factor giving a unique identifier for each lot. } \item{Wafer}{ a factor giving a unique identifier for each wafer within a lot. } \item{Site}{ a factor with levels \code{1}, \code{2}, and \code{3} } \item{Thickness}{ a numeric vector giving the thickness of the oxide layer. } } } \details{ These data are described in Littell et al. (1996, p. 155) as coming ``from a passive data collection study in the semiconductor industry where the objective is to estimate the variance components to determine the assignable causes of the observed variability.'' The observed response is the thickness of the oxide layer on silicon wafers, measured at three different sites of each of three wafers selected from each of eight lots sampled from the population of lots. } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.20) Littell, R. C., Milliken, G. A., Stroup, W. W. and Wolfinger, R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute, Cary, NC. } %\examples{} \keyword{datasets} nlme/man/glsStruct.Rd0000644000176200001440000000227212222553014014240 0ustar liggesusers% File nlme/man/glsStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{glsStruct} \title{Generalized Least Squares Structure} \usage{ glsStruct(corStruct, varStruct) } \alias{glsStruct} \arguments{ \item{corStruct}{an optional \code{corStruct} object, representing a correlation structure. Default is \code{NULL}.} \item{varStruct}{an optional \code{varFunc} object, representing a variance function structure. Default is \code{NULL}.} } \description{ A generalized least squares structure is a list of model components representing different sets of parameters in the linear model. A \code{glsStruct} may contain \code{corStruct} and \code{varFunc} objects. \code{NULL} arguments are not included in the \code{glsStruct} list. } \value{ a list of model variance-covariance components determining the parameters to be estimated for the associated linear model. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corClasses}}, \code{\link{gls}}, \code{\link{residuals.glsStruct}}, \code{\link{varFunc}} } \examples{ gls1 <- glsStruct(corAR1(), varPower()) } \keyword{models} nlme/man/recalc.corStruct.Rd0000644000176200001440000000331512222553014015465 0ustar liggesusers% File nlme/man/recalc.corStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{recalc.corStruct} \title{Recalculate for corStruct Object} \usage{ \method{recalc}{corStruct}(object, conLin, \dots) } \alias{recalc.corStruct} \alias{recalc.corAR1} \alias{recalc.corARMA} \alias{recalc.corCAR1} \alias{recalc.corCompSymm} \alias{recalc.corHF} \alias{recalc.corIdent} \alias{recalc.corNatural} \alias{recalc.corSpatial} \alias{recalc.corSymm} \arguments{ \item{object}{an object inheriting from class \code{"\link{corStruct}"}, representing a correlation structure.} \item{conLin}{a condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying model.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function pre-multiples the \code{"Xy"} component of \code{conLin} by the transpose square-root factor(s) of the correlation matrix (matrices) associated with \code{object} and adds the log-likelihood contribution of \code{object}, given by \code{logLik(object)}, to the \code{"logLik"} component of \code{conLin}. } \value{ the recalculated condensed linear model object. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{This method function is only used inside model fitting functions, such as \code{lme} and \code{gls}, that allow correlated error terms.} \seealso{\code{\link{corFactor}}, \code{\link{logLik.corStruct}} } \keyword{models} nlme/man/plot.compareFits.Rd0000644000176200001440000000350113330762523015503 0ustar liggesusers% File nlme/man/plot.compareFits.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.compareFits} \title{Plot a compareFits Object} \usage{ \method{plot}{compareFits}(x, subset, key, mark, \dots) } \alias{plot.compareFits} \arguments{ \item{x}{an object of class \code{"\link{compareFits}"}.} \item{subset}{an optional logical or integer vector specifying which rows of \code{x} should be used in the plots. If missing, all rows are used.} \item{key}{an optional logical value, or list. If \code{TRUE}, a legend is included at the top of the plot indicating which symbols (colors) correspond to which objects being compared. If \code{FALSE}, no legend is included. If given as a list, \code{key} is passed down as an argument to the \code{trellis} function generating the plots (\code{dotplot}). Defaults to \code{TRUE}.} \item{mark}{an optional numeric vector, of length equal to the number of coefficients being compared, indicating where vertical lines should be drawn in the plots. If missing, no lines are drawn.} \item{\dots}{optional arguments passed down to the \code{trellis} function generating the plots.} } \description{ A Trellis \code{dotplot} of the values being compared, with different rows per group, is generated, with a different panel for each coefficient. Different symbols (colors) are used for each object being compared. } \value{ A Trellis \code{dotplot} of the values being compared, with rows determined by the groups and panels by the coefficients. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{compareFits}}, \code{\link{pairs.compareFits}}, \code{\link{dotplot}} } \examples{ example(compareFits) # cF12 <- compareFits(coef(lmList(Orthodont)), .. lme(*)) plot(cF12) } \keyword{models} nlme/man/Covariate.Rd0000644000176200001440000000155012222553014014161 0ustar liggesusers% File nlme/man/Covariate.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Covariate} \title{Assign Covariate Values} \usage{ covariate(object) <- value } \alias{covariate<-} \arguments{ \item{object}{any object with a \code{covariate} component.} \item{value}{a value to be assigned to the covariate associated with \code{object}.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include all \code{"\link{varFunc}"} classes. } \value{ will depend on the method function; see the appropriate documentation. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{getCovariate}}} \examples{ ## see the method function documentation } \keyword{models} nlme/man/gls-internal.Rd0000644000176200001440000000210412231172057014643 0ustar liggesusers% File nlme/man/gls-internal.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{gls-internal} \title{Auxiliary functions used by gls} \alias{glsApVar} \alias{glsEstimate} \description{ These are functions used by \code{gls} to call its compiled C code. They are exported to allow experimentation with modified versions. } \usage{ glsApVar(glsSt, sigma, conLin = attr(glsSt, "conLin"), .relStep = .Machine$double.eps^(1/3), minAbsPar = 0, natural = TRUE) glsEstimate(object, conLin = attr(object, "conLin"), control = list(singular.ok = FALSE)) } \arguments{ \item{glsSt, object}{An object inheriting from class \code{"\link{glsStruct}"}.} \item{sigma}{the estimated residual standard error: see \code{\link{glsObject}}.} \item{conLin}{A \sQuote{condensed linear model}: see \code{\link{logLik.glsStruct}}.} \item{.relStep, minAbsPar, natural}{Control values: see \code{\link{glsControl}}.} \item{control}{The relevant part of a \code{\link{glsControl}} return value.} } \keyword{internal} nlme/man/glsObject.Rd0000644000176200001440000000507712222553014014170 0ustar liggesusers% File nlme/man/glsObject.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{glsObject} \title{Fitted gls Object} \alias{glsObject} \description{ An object returned by the \code{\link{gls}} function, inheriting from class \code{"gls"} and representing a generalized least squares fitted linear model. Objects of this class have methods for the generic functions \code{anova}, \code{coef}, \code{fitted}, \code{formula}, \code{getGroups}, \code{getResponse}, \code{intervals}, \code{logLik}, \code{plot}, \code{predict}, \code{print}, \code{residuals}, \code{summary}, and \code{update}. } \value{ The following components must be included in a legitimate \code{"gls"} object. \item{apVar}{an approximate covariance matrix for the variance-covariance coefficients. If \code{apVar = FALSE} in the list of control values used in the call to \code{gls}, this component is equal to \code{NULL}.} \item{call}{a list containing an image of the \code{gls} call that produced the object.} \item{coefficients}{a vector with the estimated linear model coefficients.} \item{contrasts}{a list with the contrasts used to represent factors in the model formula. This information is important for making predictions from a new data frame in which not all levels of the original factors are observed. If no factors are used in the model, this component will be an empty list.} \item{dims}{a list with basic dimensions used in the model fit, including the components \code{N} - the number of observations in the data and \code{p} - the number of coefficients in the linear model.} \item{fitted}{a vector with the fitted values..} \item{glsStruct}{an object inheriting from class \code{glsStruct}, representing a list of linear model components, such as \code{corStruct} and \code{varFunc} objects.} \item{groups}{a vector with the correlation structure grouping factor, if any is present.} \item{logLik}{the log-likelihood at convergence.} \item{method}{the estimation method: either \code{"ML"} for maximum likelihood, or \code{"REML"} for restricted maximum likelihood.} \item{numIter}{the number of iterations used in the iterative algorithm.} \item{residuals}{a vector with the residuals.} \item{sigma}{the estimated residual standard error.} \item{varBeta}{an approximate covariance matrix of the coefficients estimates.} } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gls}}, \code{glsStruct}} \keyword{models} nlme/man/Initialize.glsStruct.Rd0000644000176200001440000000254412222553014016342 0ustar liggesusers% File nlme/man/Initialize.glsStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Initialize.glsStruct} \title{Initialize a glsStruct Object} \usage{ \method{Initialize}{glsStruct}(object, data, control, \dots) } \alias{Initialize.glsStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{glsStruct}"}, representing a list of linear model components, such as \code{corStruct} and \code{varFunc} objects.} \item{data}{a data frame in which to evaluate the variables defined in \code{formula(object)}.} \item{control}{an optional list with control parameters for the initialization and optimization algorithms used in \code{gls}. Defaults to \code{list(singular.ok = FALSE)}, implying that linear dependencies are not allowed in the model.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The individual linear model components of the \code{glsStruct} list are initialized. } \value{ a \code{glsStruct} object similar to \code{object}, but with initialized model components. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gls}}, \code{\link{Initialize.corStruct}}, \code{\link{Initialize.varFunc}}, \code{\link{Initialize}}} \keyword{models} nlme/man/getData.Rd0000644000176200001440000000157512222553014013624 0ustar liggesusers% File nlme/man/getData.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getData} \title{Extract Data from an Object} \usage{ getData(object) } \alias{getData} \arguments{ \item{object}{an object from which a data.frame can be extracted, generally a fitted model object.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include \code{gls}, \code{lme}, and \code{lmList}. } \value{ will depend on the method function used; see the appropriate documentation. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{getData.gls}}, \code{\link{getData.lme}}, \code{\link{getData.lmList}} } \examples{ ## see the method function documentation } \keyword{models} nlme/man/lme.groupedData.Rd0000644000176200001440000001525412222553014015265 0ustar liggesusers% File nlme/man/lme.groupedData.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{lme.groupedData} \title{LME fit from groupedData Object} \usage{ \method{lme}{groupedData}(fixed, data, random, correlation, weights, subset, method, na.action, control, contrasts, keep.data = TRUE) } \alias{lme.groupedData} \arguments{ \item{fixed}{a data frame inheriting from class \code{"\link{groupedData}"}.} \item{data}{this argument is included for consistency with the generic function. It is ignored in this method function.} \item{random}{optionally, any of the following: (i) a one-sided formula of the form \code{~x1+...+xn | g1/.../gm}, with \code{x1+...+xn} specifying the model for the random effects and \code{g1/.../gm} the grouping structure (\code{m} may be equal to 1, in which case no \code{/} is required). The random effects formula will be repeated for all levels of grouping, in the case of multiple levels of grouping; (ii) a list of one-sided formulas of the form \code{~x1+...+xn | g}, with possibly different random effects models for each grouping level. The order of nesting will be assumed the same as the order of the elements in the list; (iii) a one-sided formula of the form \code{~x1+...+xn}, or a \code{pdMat} object with a formula (i.e. a non-\code{NULL} value for \code{formula(object)}), or a list of such formulas or \code{pdMat} objects. In this case, the grouping structure formula will be derived from the data used to fit the linear mixed-effects model, which should inherit from class \code{groupedData}; (iv) a named list of formulas or \code{pdMat} objects as in (iii), with the grouping factors as names. The order of nesting will be assumed the same as the order of the order of the elements in the list; (v) an \code{reStruct} object. See the documentation on \code{pdClasses} for a description of the available \code{pdMat} classes. Defaults to a formula consisting of the right hand side of \code{fixed}.} \item{correlation}{an optional \code{corStruct} object describing the within-group correlation structure. See the documentation of \code{corClasses} for a description of the available \code{corStruct} classes. Defaults to \code{NULL}, corresponding to no within-group correlations.} \item{weights}{an optional \code{varFunc} object or one-sided formula describing the within-group heteroscedasticity structure. If given as a formula, it is used as the argument to \code{varFixed}, corresponding to fixed variance weights. See the documentation on \code{varClasses} for a description of the available \code{varFunc} classes. Defaults to \code{NULL}, corresponding to homoscedastic within-group errors.} \item{subset}{an optional expression indicating the subset of the rows of \code{data} that should be used in the fit. This can be a logical vector, or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.} \item{method}{a character string. If \code{"REML"} the model is fit by maximizing the restricted log-likelihood. If \code{"ML"} the log-likelihood is maximized. Defaults to \code{"REML"}.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{na.fail}) causes \code{lme} to print an error message and terminate if there are any incomplete observations.} \item{control}{a list of control values for the estimation algorithm to replace the default values returned by the function \code{lmeControl}. Defaults to an empty list.} \item{contrasts}{an optional list. See the \code{contrasts.arg} of \code{model.matrix.default}.} \item{keep.data}{logical: should the \code{data} argument (if supplied and a data frame) be saved as part of the model object?} } \description{ The response variable and primary covariate in \code{formula(fixed)} are used to construct the fixed effects model formula. This formula and the \code{groupedData} object are passed as the \code{fixed} and \code{data} arguments to \code{lme.formula}, together with any other additional arguments in the function call. See the documentation on \code{lme.formula} for a description of that function. } \value{ an object of class \code{lme} representing the linear mixed-effects model fit. Generic functions such as \code{print}, \code{plot} and \code{summary} have methods to show the results of the fit. See \code{lmeObject} for the components of the fit. The functions \code{resid}, \code{coef}, \code{fitted}, \code{fixed.effects}, and \code{random.effects} can be used to extract some of its components. } \references{ The computational methods follow on the general framework of Lindstrom, M.J. and Bates, D.M. (1988). The model formulation is described in Laird, N.M. and Ware, J.H. (1982). The variance-covariance parametrizations are described in Pinheiro, J.C. and Bates., D.M. (1996). The different correlation structures available for the \code{correlation} argument are described in Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994), Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996), and Venables, W.N. and Ripley, B.D. (2002). The use of variance functions for linear and nonlinear mixed effects models is presented in detail in Davidian, M. and Giltinan, D.M. (1995). Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden-Day. Davidian, M. and Giltinan, D.M. (1995) "Nonlinear Mixed Effects Models for Repeated Measurement Data", Chapman and Hall. Laird, N.M. and Ware, J.H. (1982) "Random-Effects Models for Longitudinal Data", Biometrics, 38, 963-974. Lindstrom, M.J. and Bates, D.M. (1988) "Newton-Raphson and EM Algorithms for Linear Mixed-Effects Models for Repeated-Measures Data", Journal of the American Statistical Association, 83, 1014-1022. Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996) "SAS Systems for Mixed Models", SAS Institute. Pinheiro, J.C. and Bates., D.M. (1996) "Unconstrained Parametrizations for Variance-Covariance Matrices", Statistics and Computing, 6, 289-296. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{groupedData}}, \code{\link{lmeObject}} } \examples{ fm1 <- lme(Orthodont) summary(fm1) } \keyword{models} nlme/man/lmList.Rd0000644000176200001440000000764712704356630013537 0ustar liggesusers% File nlme/man/lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{lmList} \title{List of lm Objects with a Common Model} \usage{ lmList(object, data, level, subset, na.action = na.fail, pool = TRUE, warn.lm = TRUE) \method{update}{lmList}(object, formula., \dots, evaluate = TRUE) \method{print}{lmList}(x, pool, \dots) } \alias{lmList} \alias{lmList.formula} \alias{print.lmList} \alias{update.lmList} \arguments{ \item{object}{For \code{lmList}, either a linear formula object of the form \code{y ~ x1+...+xn | g} or a \code{groupedData} object. In the formula object, \code{y} represents the response, \code{x1,...,xn} the covariates, and \code{g} the grouping factor specifying the partitioning of the data according to which different \code{lm} fits should be performed. The grouping factor \code{g} may be omitted from the formula, in which case the grouping structure will be obtained from \code{data}, which must inherit from class \code{groupedData}. The method function \code{\link{lmList.groupedData}} is documented separately. For the method \code{update.lmList}, \code{object} is an object inheriting from class \code{lmList}. } \item{formula}{(used in \code{update.lmList} only) a two-sided linear formula with the common model for the individuals \code{lm} fits. } \item{formula.}{Changes to the formula -- see \code{update.formula} for details.} \item{data}{ a data frame in which to interpret the variables named in \code{object}. } \item{level}{ an optional integer specifying the level of grouping to be used when multiple nested levels of grouping are present. } \item{subset}{an optional expression indicating which subset of the rows of \code{data} should be used in the fit. This can be a logical vector, or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{na.fail}) causes \code{lmList} to print an error message and terminate if there are any incomplete observations. } \item{pool}{ an optional logical value indicating whether a pooled estimate of the residual standard error should be used in calculations of standard deviations or standard errors for summaries. } \item{warn.lm}{\code{\link{logical}} indicating if \code{\link{lm}()} errors (all of which are caught by \code{\link{tryCatch}}) should be signalled as a \dQuote{summarizing} \code{\link{warning}}.} \item{x}{an object inheriting from class \code{lmList} to be printed.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} \item{evaluate}{If \code{TRUE} evaluate the new call else return the call.} } \description{ \code{Data} is partitioned according to the levels of the grouping factor \code{g} and individual \code{lm} fits are obtained for each \code{data} partition, using the model defined in \code{object}. } \value{ a list of \code{lm} objects with as many components as the number of groups defined by the grouping factor. Generic functions such as \code{coef}, \code{fixed.effects}, \code{lme}, \code{pairs}, \code{plot}, \code{predict}, \code{random.effects}, \code{summary}, and \code{update} have methods that can be applied to an \code{lmList} object. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \seealso{ \code{\link{lm}}, \code{\link{lme.lmList}}, \code{\link{plot.lmList}}, \code{\link{pooledSD}}, \code{\link{predict.lmList}}, \code{\link{residuals.lmList}}, \code{\link{summary.lmList}} } \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) summary(fm1) } \keyword{models} nlme/man/Variogram.lme.Rd0000644000176200001440000001446112222553014014754 0ustar liggesusers% File nlme/man/Variogram.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Variogram.lme} \title{Calculate Semi-variogram for Residuals from an lme Object} \usage{ \method{Variogram}{lme}(object, distance, form, resType, data, na.action, maxDist, length.out, collapse, nint, breaks, robust, metric, \dots) } \alias{Variogram.lme} \arguments{ \item{object}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model.} \item{distance}{an optional numeric vector with the distances between residual pairs. If a grouping variable is present, only the distances between residual pairs within the same group should be given. If missing, the distances are calculated based on the values of the arguments \code{form}, \code{data}, and \code{metric}, unless \code{object} includes a \code{corSpatial} element, in which case the associated covariate (obtained with the \code{getCovariate} method) is used.} \item{form}{an optional one-sided formula specifying the covariate(s) to be used for calculating the distances between residual pairs and, optionally, a grouping factor for partitioning the residuals (which must appear to the right of a \code{|} operator in \code{form}). Default is \code{~1}, implying that the observation order within the groups is used to obtain the distances.} \item{resType}{an optional character string specifying the type of residuals to be used. If \code{"response"}, the "raw" residuals (observed - fitted) are used; else, if \code{"pearson"}, the standardized residuals (raw residuals divided by the corresponding standard errors) are used; else, if \code{"normalized"}, the normalized residuals (standardized residuals pre-multiplied by the inverse square-root factor of the estimated error correlation matrix) are used. Partial matching of arguments is used, so only the first character needs to be provided. Defaults to \code{"pearson"}.} \item{data}{an optional data frame in which to interpret the variables in \code{form}. By default, the same data used to fit \code{object} is used.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{na.fail}) causes an error message to be printed and the function to terminate, if there are any incomplete observations.} \item{maxDist}{an optional numeric value for the maximum distance used for calculating the semi-variogram between two residuals. By default all residual pairs are included.} \item{length.out}{an optional integer value. When \code{object} includes a \code{corSpatial} element, its semi-variogram values are calculated and this argument is used as the \code{length.out} argument to the corresponding \code{Variogram} method. Defaults to \code{50}.} \item{collapse}{an optional character string specifying the type of collapsing to be applied to the individual semi-variogram values. If equal to \code{"quantiles"}, the semi-variogram values are split according to quantiles of the distance distribution, with equal number of observations per group, with possibly varying distance interval lengths. Else, if \code{"fixed"}, the semi-variogram values are divided according to distance intervals of equal lengths, with possibly different number of observations per interval. Else, if \code{"none"}, no collapsing is used and the individual semi-variogram values are returned. Defaults to \code{"quantiles"}.} \item{nint}{an optional integer with the number of intervals to be used when collapsing the semi-variogram values. Defaults to \code{20}.} \item{robust}{an optional logical value specifying if a robust semi-variogram estimator should be used when collapsing the individual values. If \code{TRUE} the robust estimator is used. Defaults to \code{FALSE}.} \item{breaks}{an optional numeric vector with the breakpoints for the distance intervals to be used in collapsing the semi-variogram values. If not missing, the option specified in \code{collapse} is ignored.} \item{metric}{an optional character string specifying the distance metric to be used. The currently available options are \code{"euclidean"} for the root sum-of-squares of distances; \code{"maximum"} for the maximum difference; and \code{"manhattan"} for the sum of the absolute differences. Partial matching of arguments is used, so only the first three characters need to be provided. Defaults to \code{"euclidean"}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function calculates the semi-variogram for the within-group residuals from an \code{lme} fit. The semi-variogram values are calculated for pairs of residuals within the same group. If \code{collapse} is different from \code{"none"}, the individual semi-variogram values are collapsed using either a robust estimator (\code{robust = TRUE}) defined in Cressie (1993), or the average of the values within the same distance interval. The semi-variogram is useful for modeling the error term correlation structure. } \value{ a data frame with columns \code{variog} and \code{dist} representing, respectively, the semi-variogram values and the corresponding distances. If the semi-variogram values are collapsed, an extra column, \code{n.pairs}, with the number of residual pairs used in each semi-variogram calculation, is included in the returned data frame. If \code{object} includes a \code{corSpatial} element, a data frame with its corresponding semi-variogram is included in the returned value, as an attribute \code{"modelVariog"}. The returned value inherits from class \code{Variogram}. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{lme}}, \code{\link{Variogram}}, \code{\link{Variogram.default}}, \code{\link{Variogram.gls}}, \code{\link{plot.Variogram}} } \examples{ fm1 <- lme(weight ~ Time * Diet, data=BodyWeight, ~ Time | Rat) Variogram(fm1, form = ~ Time | Rat, nint = 10, robust = TRUE) } \keyword{models} nlme/man/corMatrix.pdMat.Rd0000644000176200001440000000212412222553014015256 0ustar liggesusers% File nlme/man/corMatrix.pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corMatrix.pdMat} \title{Extract Correlation Matrix from a pdMat Object} \usage{ \method{corMatrix}{pdMat}(object, \dots) } \alias{corMatrix.pdBlocked} \alias{corMatrix.pdCompSymm} \alias{corMatrix.pdDiag} \alias{corMatrix.pdIdent} \alias{corMatrix.pdMat} \alias{corMatrix.pdSymm} \arguments{ \item{object}{an object inheriting from class \code{"\link{pdMat}"}, representing a positive definite matrix.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The correlation matrix corresponding to the positive-definite matrix represented by \code{object} is obtained. } \value{ the correlation matrix corresponding to the positive-definite matrix represented by \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.pdMat}}, \code{\link{pdMatrix}}} \examples{ pd1 <- pdSymm(diag(1:4)) corMatrix(pd1) } \keyword{models} nlme/man/Glucose2.Rd0000644000176200001440000000265112222456762013746 0ustar liggesusers% File nlme/man/Glucose2.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Glucose2} \alias{Glucose2} \title{Glucose Levels Following Alcohol Ingestion} \description{ The \code{Glucose2} data frame has 196 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{Subject}{ a factor with levels \code{1} to \code{7} identifying the subject whose glucose level is measured. } \item{Date}{ a factor with levels \code{1} \code{2} indicating the occasion in which the experiment was conducted. } \item{Time}{ a numeric vector giving the time since alcohol ingestion (in min/10). } \item{glucose}{ a numeric vector giving the blood glucose level (in mg/dl). } } } \details{ Hand and Crowder (Table A.14, pp. 180-181, 1996) describe data on the blood glucose levels measured at 14 time points over 5 hours for 7 volunteers who took alcohol at time 0. The same experiment was repeated on a second date with the same subjects but with a dietary additive used for all subjects. } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.10) Hand, D. and Crowder, M. (1996), \emph{Practical Longitudinal Data Analysis}, Chapman and Hall, London. } %\examples{} \keyword{datasets} nlme/man/corLin.Rd0000644000176200001440000001014012222553014013465 0ustar liggesusers% File nlme/man/corLin.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corLin} \title{Linear Correlation Structure} \usage{ corLin(value, form, nugget, metric, fixed) } \alias{corLin} \arguments{ \item{value}{an optional vector with the parameter values in constrained form. If \code{nugget} is \code{FALSE}, \code{value} can have only one element, corresponding to the "range" of the linear correlation structure, which must be greater than zero. If \code{nugget} is \code{TRUE}, meaning that a nugget effect is present, \code{value} can contain one or two elements, the first being the "range" and the second the "nugget effect" (one minus the correlation between two observations taken arbitrarily close together); the first must be greater than zero and the second must be between zero and one. Defaults to \code{numeric(0)}, which results in a range of 90\% of the minimum distance and a nugget effect of 0.1 being assigned to the parameters when \code{object} is initialized.} \item{form}{a one sided formula of the form \code{~ S1+...+Sp}, or \code{~ S1+...+Sp | g}, specifying spatial covariates \code{S1} through \code{Sp} and, optionally, a grouping factor \code{g}. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{nugget}{an optional logical value indicating whether a nugget effect is present. Defaults to \code{FALSE}.} \item{metric}{an optional character string specifying the distance metric to be used. The currently available options are \code{"euclidean"} for the root sum-of-squares of distances; \code{"maximum"} for the maximum difference; and \code{"manhattan"} for the sum of the absolute differences. Partial matching of arguments is used, so only the first three characters need to be provided. Defaults to \code{"euclidean"}.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{corLin} class, representing a linear spatial correlation structure. Letting \eqn{d} denote the range and \eqn{n} denote the nugget effect, the correlation between two observations a distance \eqn{r < d} apart is \eqn{1-(r/d)} when no nugget effect is present and \eqn{(1-n) (1 -(r/d))}{(1-n)*(1-(r/d))} when a nugget effect is assumed. If \eqn{r \geq d}{r >= d} the correlation is zero. Objects created using this constructor must later be initialized using the appropriate \code{Initialize} method. } \value{ an object of class \code{corLin}, also inheriting from class \code{corSpatial}, representing a linear spatial correlation structure. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. Littel, Milliken, Stroup, and Wolfinger (1996) "SAS Systems for Mixed Models", SAS Institute. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{Initialize.corStruct}}, \code{\link{summary.corStruct}}, \code{\link{dist}} } \examples{ sp1 <- corLin(form = ~ x + y) # example lme(..., corLin ...) # Pinheiro and Bates, pp. 222-249 fm1BW.lme <- lme(weight ~ Time * Diet, BodyWeight, random = ~ Time) # p. 223 fm2BW.lme <- update(fm1BW.lme, weights = varPower()) # p 246 fm3BW.lme <- update(fm2BW.lme, correlation = corExp(form = ~ Time)) # p. 249 fm7BW.lme <- update(fm3BW.lme, correlation = corLin(form = ~ Time)) } \keyword{models} nlme/man/nlsList.Rd0000644000176200001440000001176512741076552013722 0ustar liggesusers% File nlme/man/nlsList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{nlsList} \title{List of nls Objects with a Common Model} \alias{nlsList} \alias{nlsList.formula}% + ./nlsList.selfStart.Rd \alias{update.nlsList} \usage{ nlsList(model, data, start, control, level, subset, na.action = na.fail, pool = TRUE, warn.nls = NA) \method{update}{nlsList}(object, model., \dots, evaluate = TRUE) } \arguments{ \item{object}{an object inheriting from class \code{nlsList}, representing a list of fitted \code{nls} objects.} \item{model}{either a nonlinear model formula, with the response on the left of a \code{~} operator and an expression involving parameters, covariates, and a grouping factor separated by the \code{|} operator on the right, or a \code{selfStart} function. The method function \code{\link{nlsList.selfStart}} is documented separately. } \item{model.}{changes to the model -- see \code{\link{update.formula}} for details.} \item{data}{a data frame in which to interpret the variables named in \code{model}. } \item{start}{an optional named list with initial values for the parameters to be estimated in \code{model}. It is passed as the \code{start} argument to each \code{nls} call and is required when the nonlinear function in \code{model} does not inherit from class \code{selfStart}. } \item{control}{a list of control values passed as the \code{control} argument to \code{nls}. Defaults to an empty list. } \item{level}{an optional integer specifying the level of grouping to be used when multiple nested levels of grouping are present.} \item{subset}{an optional expression indicating the subset of the rows of \code{data} that should be used in the fit. This can be a logical vector, or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{na.fail}) causes \code{nlsList} to print an error message and terminate if there are any incomplete observations. } \item{pool}{ an optional logical value that is preserved as an attribute of the returned value. This will be used as the default for \code{pool} in calculations of standard deviations or standard errors for summaries. } \item{warn.nls}{\code{\link{logical}} indicating if \code{\link{nls}()} errors (all of which are caught by \code{\link{tryCatch}}) should be signalled as a \dQuote{summarizing} \code{\link{warning}}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} \item{evaluate}{If \code{TRUE} evaluate the new call else return the call.} } \description{ \code{Data} is partitioned according to the levels of the grouping factor defined in \code{model} and individual \code{nls} fits are obtained for each \code{data} partition, using the model defined in \code{model}. } \details{ As \code{\link{nls}(.)} is called on each sub group, and convergence of these may be problematic, these calls happen with error catching. Since \pkg{nlme} version \code{3.1-127} (2016-04), all the errors are caught (via \code{\link{tryCatch}}) and if present, a \dQuote{summarizing} \code{\link{warning}} is stored as attribute of the resulting \code{"nlsList"} object and signalled unless suppressed by \code{warn.nls = FALSE} or currently also when \code{warn.nls = NA} (default) \emph{and} \code{\link{getOption}("show.error.messages")} is false. \code{nlsList()} originally had used \code{\link{try}(*)} (with its default \code{silent=FALSE)} and hence all errors were printed to the console \emph{unless} the global option \code{show.error.messages} was set to true. This still works, but has been \emph{deprecated}.% For 3.1-127, April 14, 2016 } \value{ a list of \code{nls} objects with as many components as the number of groups defined by the grouping factor. Generic functions such as \code{coef}, \code{fixed.effects}, \code{lme}, \code{pairs}, \code{plot}, \code{predict}, \code{random.effects}, \code{summary}, and \code{update} have methods that can be applied to an \code{nlsList} object. } \references{ Pinheiro, J.C., and Bates, D.M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer. } \seealso{ \code{\link{nls}}, \code{\link{nlme.nlsList}}, \code{\link{nlsList.selfStart}}, \code{\link{summary.nlsList}} } \examples{ fm1 <- nlsList(uptake ~ SSasympOff(conc, Asym, lrc, c0), data = CO2, start = c(Asym = 30, lrc = -4.5, c0 = 52)) summary(fm1) cfm1 <- confint(fm1) # via profiling each % FIXME: only *one* message instead of one *each* stopifnot((i.ok <- which(sapply(cfm1, class) == "matrix")) \%in\% c(2:4,6:9, 12)) ## where as (some of) the others gave errors during profile re-fitting : str(cfm1[- i.ok]) } \keyword{models} nlme/man/residuals.gls.Rd0000644000176200001440000000327312222553014015027 0ustar liggesusers% File nlme/man/residuals.gls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{residuals.gls} \title{Extract gls Residuals} \usage{ \method{residuals}{gls}(object, type, \dots) } \alias{residuals.gls} \alias{residuals.gnls} \arguments{ \item{object}{an object inheriting from class \code{"\link{gls}"}, representing a generalized least squares fitted linear model, or from class \code{gnls}, representing a generalized nonlinear least squares fitted linear model.} \item{type}{an optional character string specifying the type of residuals to be used. If \code{"response"}, the "raw" residuals (observed - fitted) are used; else, if \code{"pearson"}, the standardized residuals (raw residuals divided by the corresponding standard errors) are used; else, if \code{"normalized"}, the normalized residuals (standardized residuals pre-multiplied by the inverse square-root factor of the estimated error correlation matrix) are used. Partial matching of arguments is used, so only the first character needs to be provided. Defaults to \code{"response"}.} \item{\dots}{some methods for this generic function require additional arguments. None are used in this method.} } \description{ The residuals for the linear model represented by \code{object} are extracted. } \value{ a vector with the residuals for the linear model represented by \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gls}}} \examples{ fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) residuals(fm1) } \keyword{models} nlme/man/Tetracycline1.Rd0000644000176200001440000000164012222456762014767 0ustar liggesusers% File nlme/man/Tetracycline1.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Tetracycline1} \alias{Tetracycline1} \title{Pharmacokinetics of tetracycline} \description{ The \code{Tetracycline1} data frame has 40 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{conc}{ a numeric vector } \item{Time}{ a numeric vector } \item{Subject}{ an ordered factor with levels \code{5} < \code{3} < \code{2} < \code{4} < \code{1} } \item{Formulation}{ a factor with levels \code{tetrachel} \code{tetracyn} } } } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } %\examples{} \keyword{datasets} nlme/man/Soybean.Rd0000644000176200001440000000265012222456762013662 0ustar liggesusers% File nlme/man/Soybean.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Soybean} \alias{Soybean} \title{Growth of soybean plants} \description{ The \code{Soybean} data frame has 412 rows and 5 columns. } \format{ This data frame contains the following columns: \describe{ \item{Plot}{ a factor giving a unique identifier for each plot. } \item{Variety}{ a factor indicating the variety; Forrest (F) or Plant Introduction \#416937 (P). } \item{Year}{ a factor indicating the year the plot was planted. } \item{Time}{ a numeric vector giving the time the sample was taken (days after planting). } \item{weight}{ a numeric vector giving the average leaf weight per plant (g). } } } \details{ These data are described in Davidian and Giltinan (1995, 1.1.3, p.7) as ``Data from an experiment to compare growth patterns of two genotypes of soybeans: Plant Introduction \#416937 (P), an experimental strain, and Forrest (F), a commercial variety.'' } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.27) Davidian, M. and Giltinan, D. M. (1995), \emph{Nonlinear Models for Repeated Measurement Data}, Chapman and Hall, London. } \examples{ summary(fm1 <- nlsList(SSlogis, data = Soybean)) } \keyword{datasets} nlme/man/corClasses.Rd0000644000176200001440000000354712222553014014355 0ustar liggesusers% File nlme/man/corClasses.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corClasses} \title{Correlation Structure Classes} \alias{corClasses} \alias{corIdent} \alias{corStruct} \description{ Standard classes of correlation structures (\code{corStruct}) available in the \code{nlme} package. } \value{ Available standard classes: \item{corAR1}{autoregressive process of order 1.} \item{corARMA}{autoregressive moving average process, with arbitrary orders for the autoregressive and moving average components.} \item{corCAR1}{continuous autoregressive process (AR(1) process for a continuous time covariate).} \item{corCompSymm}{compound symmetry structure corresponding to a constant correlation.} \item{corExp}{exponential spatial correlation.} \item{corGaus}{Gaussian spatial correlation.} \item{corLin}{linear spatial correlation.} \item{corRatio}{Rational quadratics spatial correlation.} \item{corSpher}{spherical spatial correlation.} \item{corSymm}{general correlation matrix, with no additional structure.} } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ Users may define their own \code{corStruct} classes by specifying a \code{constructor} function and, at a minimum, methods for the functions \code{corMatrix} and \code{coef}. For examples of these functions, see the methods for classes \code{corSymm} and \code{corAR1}. } \seealso{ \code{\link{corAR1}}, \code{\link{corARMA}}, \code{\link{corCAR1}}, \code{\link{corCompSymm}}, \code{\link{corExp}}, \code{\link{corGaus}}, \code{\link{corLin}}, \code{\link{corRatio}}, \code{\link{corSpher}}, \code{\link{corSymm}}, \code{\link{summary.corStruct}}} \keyword{models} nlme/man/simulate.lme.Rd0000644000176200001440000000726712634171737014675 0ustar liggesusers% File nlme/man/simulate.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{simulate.lme} \title{Simulate Results from \code{lme} Models} \alias{simulate.lme} \alias{plot.simulate.lme} \alias{print.simulate.lme} \usage{ \method{simulate}{lme}(object, nsim = 1, seed = , m2, method = c("REML", "ML"), niterEM = c(40, 200), useGen, \dots) } \arguments{ \item{object}{ an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model, or a list containing an \code{lme} model specification. If given as a list, it should contain components \code{fixed}, \code{data}, and \code{random} with values suitable for a call to \code{\link{lme}}. This argument defines the null model. } \item{m2}{an \code{"\link{lme}"} object or a list, like \code{object} containing a second lme model specification. This argument defines the alternative model. If given as a list, only those parts of the specification that change between model \code{object} and \code{m2} need to be specified.} \item{seed}{ an optional integer that is passed to \code{set.seed}. Defaults to a random integer. } \item{method}{an optional character array. If it includes \code{"REML"} the models are fit by maximizing the restricted log-likelihood. If it includes \code{"ML"} the log-likelihood is maximized. Defaults to \code{c("REML", "ML")}, in which case both methods are used.} \item{nsim}{an optional positive integer specifying the number of simulations to perform. Defaults to \code{1}. \bold{This has changed. Previously the default was 1000.} } \item{niterEM}{an optional integer vector of length 2 giving the number of iterations of the EM algorithm to apply when fitting the \code{object} and \code{m2} to each simulated set of data. Defaults to \code{c(40,200)}. } \item{useGen}{ an optional logical value. If \code{TRUE}, numerical derivatives are used to obtain the gradient and the Hessian of the log-likelihood in the optimization algorithm in the \code{ms} function. If \code{FALSE}, the default algorithm in \code{ms} for functions that do not incorporate gradient and Hessian attributes is used. Default depends on the \code{"\link{pdMat}"} classes used in \code{object} and \code{m2}: if both are standard classes (see \code{\link{pdClasses}}) then defaults to \code{TRUE}, otherwise defaults to \code{FALSE}. } \item{\dots}{optional additional arguments. None are used.} } \description{ The model \code{object} is fit to the data. Using the fitted values of the parameters, \code{nsim} new data vectors from this model are simulated. Both \code{object} and \code{m2} are fit by maximum likelihood (ML) and/or by restricted maximum likelihood (REML) to each of the simulated data vectors. } \value{ an object of class \code{simulate.lme} with components \code{null} and \code{alt}. Each of these has components \code{ML} and/or \code{REML} which are matrices. An attribute called \code{Random.seed} contains the seed that was used for the random number generator. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) \emph{Mixed-Effects Models in S and S-PLUS}, Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{set.seed}}} \examples{ \donttest{% takes too long for routine R CMD check orthSim <- simulate.lme(list(fixed = distance ~ age, data = Orthodont, random = ~ 1 | Subject), nsim = 200, m2 = list(random = ~ age | Subject)) }% dont ==> check in ../tests/predict.lme.R } \keyword{models} nlme/man/corCAR1.Rd0000644000176200001440000000502612222553014013440 0ustar liggesusers% File nlme/man/corCAR1.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corCAR1} \title{Continuous AR(1) Correlation Structure} \usage{ corCAR1(value, form, fixed) } \alias{corCAR1} \arguments{ \item{value}{the correlation between two observations one unit of time apart. Must be between 0 and 1. Defaults to 0.2.} \item{form}{a one sided formula of the form \code{~ t}, or \code{~ t | g}, specifying a time covariate \code{t} and, optionally, a grouping factor \code{g}. Covariates for this correlation structure need not be integer valued. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{corCAR1} class, representing an autocorrelation structure of order 1, with a continuous time covariate. Objects created using this constructor must be later initialized using the appropriate \code{Initialize} method. } \value{ an object of class \code{corCAR1}, representing an autocorrelation structure of order 1, with a continuous time covariate. } \references{ Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden-Day. Jones, R.H. (1993) "Longitudinal Data with Serial Correlation: A State-space Approach", Chapman and Hall. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. pp. 236, 243. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corClasses}}, \code{\link{Initialize.corStruct}}, \code{\link{summary.corStruct}} } \examples{ ## covariate is Time and grouping factor is Mare cs1 <- corCAR1(0.2, form = ~ Time | Mare) # Pinheiro and Bates, pp. 240, 243 fm1Ovar.lme <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data = Ovary, random = pdDiag(~sin(2*pi*Time))) fm4Ovar.lme <- update(fm1Ovar.lme, correlation = corCAR1(form = ~Time)) } \keyword{models} nlme/man/logLik.gnls.Rd0000644000176200001440000000222112222553014014423 0ustar liggesusers% File nlme/man/logLik.gnls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{logLik.gnls} \title{Log-Likelihood of a gnls Object} \usage{ \method{logLik}{gnls}(object, REML, \dots) } \alias{logLik.gnls} \arguments{ \item{object}{an object inheriting from class \code{"\link{gnls}"}, representing a generalized nonlinear least squares fitted model.} \item{REML}{an logical value for consistency with \code{logLik,gls}, but only \code{FALSE} is accepted.. } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ Returns the log-likelihood value of the nonlinear model represented by \code{object} evaluated at the estimated coefficients. } \value{ the log-likelihood of the linear model represented by \code{object} evaluated at the estimated coefficients. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gnls}}, \code{\link{logLik.lme}} } \examples{ fm1 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal), Soybean, weights = varPower()) logLik(fm1) } \keyword{models} nlme/man/Names.reStruct.Rd0000644000176200001440000000306112222553014015120 0ustar liggesusers% File nlme/man/Names.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Names.reStruct} \title{Names of an reStruct Object} \usage{ \method{Names}{reStruct}(object, \dots) \method{Names}{reStruct}(object, \dots) <- value } \alias{Names.reStruct} \alias{Names<-.reStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} \item{value}{a list of character vectors with the replacement values for the names of the individual \code{pdMat} objects that form \code{object}. It must have the same length as \code{object}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the column names of each of the positive-definite matrices represented the \code{pdMat} elements of \code{object}. } \value{ a list containing the column names of each of the positive-definite matrices represented by the \code{pdMat} elements of \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \section{SIDE EFFECTS}{ On the left side of an assignment, sets the \code{Names} of the \code{pdMat} elements of \code{object} to the corresponding element of \code{value}. } \seealso{\code{\link{reStruct}}, \code{\link{pdMat}}, \code{\link{Names.pdMat}} } \examples{ rs1 <- reStruct(list(Dog = ~day, Side = ~1), data = Pixel) Names(rs1) } \keyword{models} nlme/man/ACF.Rd0000644000176200001440000000245512222456762012656 0ustar liggesusers% File nlme/man/ACF.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{ACF} \title{Autocorrelation Function} \usage{ ACF(object, maxLag, \dots) } \alias{ACF} \arguments{ \item{object}{any object from which an autocorrelation function can be obtained. Generally an object resulting from a model fit, from which residuals can be extracted.} \item{maxLag}{maximum lag for which the autocorrelation should be calculated.} \item{\dots}{some methods for this generic require additional arguments.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include: \code{gls} and \code{lme}. } \value{ will depend on the method function used; see the appropriate documentation. } \references{ Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden-Day. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{Bates@stat.wisc.edu}} \seealso{\code{\link{ACF.gls}}, \code{\link{ACF.lme}}, \code{\link{plot.ACF}} } \examples{ ## see the method function documentation } \keyword{models} nlme/man/Cefamandole.Rd0000644000176200001440000000257012222456762014461 0ustar liggesusers% File nlme/man/Cefamandole.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Cefamandole} \alias{Cefamandole} \title{Pharmacokinetics of Cefamandole} \description{ The \code{Cefamandole} data frame has 84 rows and 3 columns. } \format{ This data frame contains the following columns: \describe{ \item{Subject}{ a factor giving the subject from which the sample was drawn. } \item{Time}{ a numeric vector giving the time at which the sample was drawn (minutes post-injection). } \item{conc}{ a numeric vector giving the observed plasma concentration of cefamandole (mcg/ml). } } } \details{ Davidian and Giltinan (1995, 1.1, p. 2) describe data obtained during a pilot study to investigate the pharmacokinetics of the drug cefamandole. Plasma concentrations of the drug were measured on six healthy volunteers at 14 time points following an intraveneous dose of 15 mg/kg body weight of cefamandole. } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.4) Davidian, M. and Giltinan, D. M. (1995), \emph{Nonlinear Models for Repeated Measurement Data}, Chapman and Hall, London. } \examples{ plot(Cefamandole) fm1 <- nlsList(SSbiexp, data = Cefamandole) summary(fm1) } \keyword{datasets} nlme/man/pdConstruct.Rd0000644000176200001440000000541212222553014014555 0ustar liggesusers% File nlme/man/pdConstruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdConstruct} \title{Construct pdMat Objects} \usage{ pdConstruct(object, value, form, nam, data, \dots) } \alias{pdConstruct} \alias{pdConstruct.pdCompSymm} \alias{pdConstruct.pdDiag} \alias{pdConstruct.pdIdent} \alias{pdConstruct.pdMat} \alias{pdConstruct.pdNatural} \alias{pdConstruct.pdSymm} \alias{pdConstruct.pdLogChol} \arguments{ \item{object}{an object inheriting from class \code{pdMat}, representing a positive definite matrix.} \item{value}{an optional initialization value, which can be any of the following: a \code{pdMat} object, a positive-definite matrix, a one-sided linear formula (with variables separated by \code{+}), a vector of character strings, or a numeric vector. Defaults to \code{numeric(0)}, corresponding to an uninitialized object.} \item{form}{an optional one-sided linear formula specifying the row/column names for the matrix represented by \code{object}. Because factors may be present in \code{form}, the formula needs to be evaluated on a data.frame to resolve the names it defines. This argument is ignored when \code{value} is a one-sided formula. Defaults to \code{NULL}.} \item{nam}{an optional vector of character strings specifying the row/column names for the matrix represented by object. It must have length equal to the dimension of the underlying positive-definite matrix and unreplicated elements. This argument is ignored when \code{value} is a vector of character strings. Defaults to \code{NULL}.} \item{data}{an optional data frame in which to evaluate the variables named in \code{value} and \code{form}. It is used to obtain the levels for \code{factors}, which affect the dimensions and the row/column names of the underlying matrix. If \code{NULL}, no attempt is made to obtain information on \code{factors} appearing in the formulas. Defaults to the parent frame from which the function was called.} \item{\dots}{optional arguments for some methods.} } \description{ This function is an alternative constructor for the \code{pdMat} class associated with \code{object} and is mostly used internally in other functions. See the documentation on the principal constructor function, generally with the same name as the \code{pdMat} class of object. } \value{ a \code{pdMat} object representing a positive-definite matrix, inheriting from the same classes as \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{pdCompSymm}}, \code{\link{pdDiag}}, \code{\link{pdIdent}}, \code{\link{pdNatural}}, \code{\link{pdSymm}}} \examples{ pd1 <- pdSymm() pdConstruct(pd1, diag(1:4)) } \keyword{models} nlme/man/lmeStruct.Rd0000644000176200001440000000257612222553014014237 0ustar liggesusers% File nlme/man/lmeStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{lmeStruct} \title{Linear Mixed-Effects Structure} \usage{ lmeStruct(reStruct, corStruct, varStruct) } \alias{lmeStruct} \arguments{ \item{reStruct}{a \code{reStruct} representing a random effects structure.} \item{corStruct}{an optional \code{corStruct} object, representing a correlation structure. Default is \code{NULL}.} \item{varStruct}{an optional \code{varFunc} object, representing a variance function structure. Default is \code{NULL}.} } \description{ A linear mixed-effects structure is a list of model components representing different sets of parameters in the linear mixed-effects model. An \code{lmeStruct} list must contain at least a \code{reStruct} object, but may also contain \code{corStruct} and \code{varFunc} objects. \code{NULL} arguments are not included in the \code{lmeStruct} list. } \value{ a list of model components determining the parameters to be estimated for the associated linear mixed-effects model. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corClasses}}, \code{\link{lme}}, \code{\link{residuals.lmeStruct}}, \code{\link{reStruct}}, \code{\link{varFunc}} } \examples{ lms1 <- lmeStruct(reStruct(~age), corAR1(), varPower()) } \keyword{models} nlme/man/gnls.Rd0000644000176200001440000001431213615562400013215 0ustar liggesusers% File nlme/man/gnls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{gnls} \title{Fit Nonlinear Model Using Generalized Least Squares} \usage{ gnls(model, data, params, start, correlation, weights, subset, na.action, naPattern, control, verbose) %\method{update}{gnls}(object, model, data, params, start, correlation, % weights, subset, na.action, naPattern, control, verbose, \dots) } \alias{gnls} %\alias{update.gnls} \arguments{ \item{model}{a two-sided formula object describing the model, with the response on the left of a \code{~} operator and a nonlinear expression involving parameters and covariates on the right. If \code{data} is given, all names used in the formula should be defined as parameters or variables in the data frame.} \item{data}{an optional data frame containing the variables named in \code{model}, \code{correlation}, \code{weights}, \code{subset}, and \code{naPattern}. By default the variables are taken from the environment from which \code{gnls} is called.} \item{params}{an optional two-sided linear formula of the form \code{p1+...+pn~x1+...+xm}, or list of two-sided formulas of the form \code{p1~x1+...+xm}, with possibly different models for each parameter. The \code{p1,\dots,pn} represent parameters included on the right hand side of \code{model} and \code{x1+...+xm} define a linear model for the parameters (when the left hand side of the formula contains several parameters, they are all assumed to follow the same linear model described by the right hand side expression). A \code{1} on the right hand side of the formula(s) indicates a single fixed effects for the corresponding parameter(s). By default, the parameters are obtained from the names of \code{start}.} \item{start}{an optional named list, or numeric vector, with the initial values for the parameters in \code{model}. It can be omitted when a \code{selfStarting} function is used in \code{model}, in which case the starting estimates will be obtained from a single call to the \code{nls} function.} \item{correlation}{an optional \code{corStruct} object describing the within-group correlation structure. See the documentation of \code{corClasses} for a description of the available \code{corStruct} classes. If a grouping variable is to be used, it must be specified in the \code{form} argument to the \code{corStruct} constructor. Defaults to \code{NULL}, corresponding to uncorrelated errors.} \item{weights}{an optional \code{varFunc} object or one-sided formula describing the within-group heteroscedasticity structure. If given as a formula, it is used as the argument to \code{varFixed}, corresponding to fixed variance weights. See the documentation on \code{varClasses} for a description of the available \code{varFunc} classes. Defaults to \code{NULL}, corresponding to homoscedastic errors.} \item{subset}{an optional expression indicating which subset of the rows of \code{data} should be used in the fit. This can be a logical vector, or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{na.fail}) causes \code{gnls} to print an error message and terminate if there are any incomplete observations.} \item{naPattern}{an expression or formula object, specifying which returned values are to be regarded as missing.} \item{control}{a list of control values for the estimation algorithm to replace the default values returned by the function \code{gnlsControl}. Defaults to an empty list.} \item{verbose}{an optional logical value. If \code{TRUE} information on the evolution of the iterative algorithm is printed. Default is \code{FALSE}.} % \item{\dots}{some methods for this generic require additional % arguments. None are used in this method.} } \description{ This function fits a nonlinear model using generalized least squares. The errors are allowed to be correlated and/or have unequal variances. } \value{ an object of class \code{gnls}, also inheriting from class \code{gls}, representing the nonlinear model fit. Generic functions such as \code{print}, \code{plot} and \code{summary} have methods to show the results of the fit. See \code{gnlsObject} for the components of the fit. The functions \code{resid}, \code{coef}, and \code{fitted} can be used to extract some of its components. } \references{ The different correlation structures available for the \code{correlation} argument are described in Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994), Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996), and Venables, W.N. and Ripley, B.D. (2002). The use of variance functions for linear and nonlinear models is presented in detail in Carrol, R.J. and Rupert, D. (1988) and Davidian, M. and Giltinan, D.M. (1995). Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden-Day. Carrol, R.J. and Rupert, D. (1988) "Transformation and Weighting in Regression", Chapman and Hall. Davidian, M. and Giltinan, D.M. (1995) "Nonlinear Mixed Effects Models for Repeated Measurement Data", Chapman and Hall. Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996) "SAS Systems for Mixed Models", SAS Institute. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corClasses}}, \code{\link{gnlsControl}}, \code{\link{gnlsObject}}, \code{\link{gnlsStruct}}, \code{\link{predict.gnls}}, \code{\link{varClasses}}, \code{\link{varFunc}} } \examples{ # variance increases with a power of the absolute fitted values fm1 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal), Soybean, weights = varPower()) summary(fm1) } \keyword{models} nlme/man/ranef.lmList.Rd0000644000176200001440000000667012222553014014612 0ustar liggesusers% File nlme/man/ranef.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{ranef.lmList} \title{Extract lmList Random Effects} \usage{ \method{ranef}{lmList}(object, augFrame, data, which, FUN, standard, omitGroupingFactor, \dots) } \alias{random.effects.lmList} \alias{ranef.lmList} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmList}"}, representing a list of \code{lm} objects with a common model. } \item{augFrame}{an optional logical value. If \code{TRUE}, the returned data frame is augmented with variables defined in \code{data}; else, if \code{FALSE}, only the coefficients are returned. Defaults to \code{FALSE}.} \item{data}{an optional data frame with the variables to be used for augmenting the returned data frame when \code{augFrame = TRUE}. Defaults to the data frame used to fit \code{object}.} \item{which}{an optional positive integer vector specifying which columns of \code{data} should be used in the augmentation of the returned data frame. Defaults to all columns in \code{data}.} \item{FUN}{an optional summary function or a list of summary functions to be applied to group-varying variables, when collapsing \code{data} by groups. Group-invariant variables are always summarized by the unique value that they assume within that group. If \code{FUN} is a single function it will be applied to each non-invariant variable by group to produce the summary for that variable. If \code{FUN} is a list of functions, the names in the list should designate classes of variables in the frame such as \code{ordered}, \code{factor}, or \code{numeric}. The indicated function will be applied to any group-varying variables of that class. The default functions to be used are \code{mean} for numeric factors, and \code{Mode} for both \code{factor} and \code{ordered}. The \code{Mode} function, defined internally in \code{gsummary}, returns the modal or most popular value of the variable. It is different from the \code{mode} function that returns the S-language mode of the variable.} \item{standard}{an optional logical value indicating whether the estimated random effects should be "standardized" (i.e. divided by the corresponding estimated standard error). Defaults to \code{FALSE}.} \item{omitGroupingFactor}{an optional logical value. When \code{TRUE} the grouping factor itself will be omitted from the group-wise summary of \code{data} but the levels of the grouping factor will continue to be used as the row names for the returned data frame. Defaults to \code{FALSE}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The difference between the individual \code{lm} components coefficients and their average is calculated. } \value{ a vector with the differences between the individual \code{lm} coefficients in \code{object} and their average. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. pp. 100, 461. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{fixed.effects.lmList}}, \code{\link{lmList}}, \code{\link{random.effects}} } \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) ranef(fm1) random.effects(fm1) # same as above } \keyword{models} nlme/man/Tetracycline2.Rd0000644000176200001440000000164212222456762014772 0ustar liggesusers% File nlme/man/Tetracycline2.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Tetracycline2} \alias{Tetracycline2} \title{Pharmacokinetics of tetracycline} \description{ The \code{Tetracycline2} data frame has 40 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{conc}{ a numeric vector } \item{Time}{ a numeric vector } \item{Subject}{ an ordered factor with levels \code{4} < \code{5} < \code{2} < \code{1} < \code{3} } \item{Formulation}{ a factor with levels \code{Berkmycin} \code{tetramycin} } } } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } %\examples{} \keyword{datasets} nlme/man/fitted.lmeStruct.Rd0000644000176200001440000000471312222553014015510 0ustar liggesusers% File nlme/man/fitted.lmeStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{fitted.lmeStruct} \title{Calculate lmeStruct Fitted Values} \usage{ \method{fitted}{lmeStruct}(object, level, conLin, lmeFit, \dots) } \alias{fitted.lmeStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmeStruct}"}, representing a list of linear mixed-effects model components, such as \code{reStruct}, \code{corStruct}, and \code{varFunc} objects.} \item{level}{an optional integer vector giving the level(s) of grouping to be used in extracting the fitted values from \code{object}. Level values increase from outermost to innermost grouping, with level zero corresponding to the population fitted values. Defaults to the highest or innermost level of grouping.} \item{conLin}{an optional condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying lme model. Defaults to \code{attr(object, "conLin")}.} \item{lmeFit}{an optional list with components \code{beta} and \code{b} containing respectively the fixed effects estimates and the random effects estimates to be used to calculate the fitted values. Defaults to \code{attr(object, "lmeFit")}.} \item{\dots}{some methods for this generic accept other optional arguments.} } \description{ The fitted values at level \eqn{i} are obtained by adding together the population fitted values (based only on the fixed effects estimates) and the estimated contributions of the random effects to the fitted values at grouping levels less or equal to \eqn{i}. The resulting values estimate the best linear unbiased predictions (BLUPs) at level \eqn{i}. } \value{ if a single level of grouping is specified in \code{level}, the returned value is a vector with the fitted values at the desired level; else, when multiple grouping levels are specified in \code{level}, the returned object is a matrix with columns given by the fitted values at different levels. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ This method function is generally only used inside \code{lme} and \code{fitted.lme}. } \seealso{\code{\link{lme}}, \code{\link{fitted.lme}}, \code{\link{residuals.lmeStruct}} } \keyword{models} nlme/man/plot.Variogram.Rd0000644000176200001440000000506412222553014015154 0ustar liggesusers% File nlme/man/plot.Variogram.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.Variogram} \title{Plot a Variogram Object} \usage{ \method{plot}{Variogram}(x, smooth, showModel, sigma, span, xlab, ylab, type, ylim, grid, \dots) } \alias{plot.Variogram} \arguments{ \item{x}{an object inheriting from class \code{"\link{Variogram}"}, consisting of a data frame with two columns named \code{variog} and \code{dist}, representing the semi-variogram values and the corresponding distances. } \item{smooth}{an optional logical value controlling whether a \code{loess} smoother should be added to the plot. Defaults to \code{TRUE}, when \code{showModel} is \code{FALSE}. } \item{showModel}{an optional logical value controlling whether the semi-variogram corresponding to an \code{"modelVariog"} attribute of \code{x}, if any is present, should be added to the plot. Defaults to \code{TRUE}, when the \code{"modelVariog"} attribute is present. } \item{sigma}{an optional numeric value used as the height of a horizontal line displayed in the plot. Can be used to represent the process standard deviation. Default is \code{NULL}, implying that no horizontal line is drawn. } \item{span}{an optional numeric value with the smoothing parameter for the \code{loess} fit. Default is 0.6. } \item{xlab,ylab}{optional character strings with the x- and y-axis labels. Default respectively to \code{"Distance"} and \code{"SemiVariogram"}. } \item{type}{an optional character indicating the type of plot. Defaults to \code{"p"}. } \item{ylim}{an optional numeric vector with the limits for the y-axis. Defaults to \code{c(0, max(x$variog))}. } \item{grid}{an optional logical value indicating whether a grid should be added to plot. Default is \code{FALSE}.} \item{\dots}{optional arguments passed to the Trellis \code{xyplot} function.} } \description{ an \code{xyplot} of the semi-variogram versus the distances is produced. If \code{smooth = TRUE}, a \code{loess} smoother is added to the plot. If \code{showModel = TRUE} and \code{x} includes an \code{"modelVariog"} attribute, the corresponding semi-variogram is added to the plot. } \value{ an \code{xyplot} Trellis plot. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{Variogram}}, \code{\link{xyplot}}, \code{\link{loess}}} \examples{ fm1 <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary) plot(Variogram(fm1, form = ~ Time | Mare, maxDist = 0.7)) } \keyword{models} nlme/man/nlmeObject.Rd0000644000176200001440000001063312707672664014355 0ustar liggesusers% File nlme/man/nlmeObject.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{nlmeObject} \title{Fitted nlme Object} \alias{nlmeObject} \description{ An object returned by the \code{\link{nlme}} function, inheriting from class \code{"nlme"}, also inheriting from class \code{"lme"}, and representing a fitted nonlinear mixed-effects model. Objects of this class have methods for the generic functions \code{anova}, \code{coef}, \code{fitted}, \code{fixed.effects}, \code{formula}, \code{getGroups}, \code{getResponse}, \code{intervals}, \code{logLik}, \code{pairs}, \code{plot}, \code{predict}, \code{print}, \code{random.effects}, \code{residuals}, \code{summary}, and \code{update}. } \value{ The following components must be included in a legitimate \code{"nlme"} object. \item{apVar}{an approximate covariance matrix for the variance-covariance coefficients. If \code{apVar = FALSE} in the control values used in the call to \code{nlme}, this component is \code{NULL}.} \item{call}{a list containing an image of the \code{nlme} call that produced the object.} \item{coefficients}{a list with two components, \code{fixed} and \code{random}, where the first is a vector containing the estimated fixed effects and the second is a list of matrices with the estimated random effects for each level of grouping. For each matrix in the \code{random} list, the columns refer to the random effects and the rows to the groups.} \item{contrasts}{a list with the contrasts used to represent factors in the fixed effects formula and/or random effects formula. This information is important for making predictions from a new data frame in which not all levels of the original factors are observed. If no factors are used in the nlme model, this component will be an empty list.} \item{dims}{a list with basic dimensions used in the nlme fit, including the components \code{N} - the number of observations in the data, \code{Q} - the number of grouping levels, \code{qvec} - the number of random effects at each level from innermost to outermost (last two values are equal to zero and correspond to the fixed effects and the response), \code{ngrps} - the number of groups at each level from innermost to outermost (last two values are one and correspond to the fixed effects and the response), and \code{ncol} - the number of columns in the model matrix for each level of grouping from innermost to outermost (last two values are equal to the number of fixed effects and one).} \item{fitted}{a data frame with the fitted values as columns. The leftmost column corresponds to the population fixed effects (corresponding to the fixed effects only) and successive columns from left to right correspond to increasing levels of grouping.} \item{fixDF}{a list with components \code{X} and \code{terms} specifying the denominator degrees of freedom for, respectively, t-tests for the individual fixed effects and F-tests for the fixed-effects terms in the models.} \item{groups}{a data frame with the grouping factors as columns. The grouping level increases from left to right.} \item{logLik}{the (restricted) log-likelihood at convergence.} \item{map}{a list with components \code{fmap}, \code{rmap}, \code{rmapRel}, and \code{bmap}, specifying various mappings for the fixed and random effects, used to generate predictions from the fitted object.} \item{method}{the estimation method: either \code{"ML"} for maximum likelihood, or \code{"REML"} for restricted maximum likelihood.} \item{modelStruct}{an object inheriting from class \code{nlmeStruct}, representing a list of mixed-effects model components, such as \code{reStruct}, \code{corStruct}, and \code{varFunc} objects.} \item{numIter}{the number of iterations used in the iterative algorithm.} \item{residuals}{a data frame with the residuals as columns. The leftmost column corresponds to the population residuals and successive columns from left to right correspond to increasing levels of grouping.} \item{sigma}{the estimated within-group error standard deviation.} \item{varFix}{an approximate covariance matrix of the fixed effects estimates.} } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{nlme}}, \code{nlmeStruct}} \keyword{models} nlme/man/reStruct.Rd0000644000176200001440000000767012222553014014070 0ustar liggesusers% File nlme/man/reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{reStruct} \title{Random Effects Structure} \usage{ reStruct(object, pdClass, REML, data) \method{print}{reStruct}(x, sigma, reEstimates, verbose, \dots) } \alias{reStruct} \alias{[.reStruct} \alias{print.reStruct} \arguments{ \item{object}{any of the following: (i) a one-sided formula of the form \code{~x1+...+xn | g1/.../gm}, with \code{x1+...+xn} specifying the model for the random effects and \code{g1/.../gm} the grouping structure (\code{m} may be equal to 1, in which case no \code{/} is required). The random effects formula will be repeated for all levels of grouping, in the case of multiple levels of grouping; (ii) a list of one-sided formulas of the form \code{~x1+...+xn | g}, with possibly different random effects models for each grouping level. The order of nesting will be assumed the same as the order of the elements in the list; (iii) a one-sided formula of the form \code{~x1+...+xn}, or a \code{pdMat} object with a formula (i.e. a non-\code{NULL} value for \code{formula(object)}), or a list of such formulas or \code{pdMat} objects. In this case, the grouping structure formula will be derived from the data used to to fit the mixed-effects model, which should inherit from class \code{groupedData}; (iv) a named list of formulas or \code{pdMat} objects as in (iii), with the grouping factors as names. The order of nesting will be assumed the same as the order of the order of the elements in the list; (v) an \code{reStruct} object.} \item{pdClass}{an optional character string with the name of the \code{pdMat} class to be used for the formulas in \code{object}. Defaults to \code{"pdSymm"} which corresponds to a general positive-definite matrix.} \item{REML}{an optional logical value. If \code{TRUE}, the associated mixed-effects model will be fitted using restricted maximum likelihood; else, if \code{FALSE}, maximum likelihood will be used. Defaults to \code{FALSE}.} \item{data}{an optional data frame in which to evaluate the variables used in the random effects formulas in \code{object}. It is used to obtain the levels for \code{factors}, which affect the dimensions and the row/column names of the underlying \code{pdMat} objects. If \code{NULL}, no attempt is made to obtain information on \code{factors} appearing in the formulas. Defaults to the parent frame from which the function was called.} \item{x}{an object inheriting from class \code{reStruct} to be printed.} \item{sigma}{an optional numeric value used as a multiplier for the square-root factors of the \code{pdMat} components (usually the estimated within-group standard deviation from a mixed-effects model). Defaults to 1.} \item{reEstimates}{an optional list with the random effects estimates for each level of grouping. Only used when \code{verbose = TRUE}.} \item{verbose}{an optional logical value determining if the random effects estimates should be printed. Defaults to \code{FALSE}.} \item{\dots}{Optional arguments can be given to other methods for this generic. None are used in this method.} } \description{ This function is a constructor for the \code{reStruct} class, representing a random effects structure and consisting of a list of \code{pdMat} objects, plus a \code{settings} attribute containing information for the optimization algorithm used to fit the associated mixed-effects model. } \value{ an object inheriting from class \code{reStruct}, representing a random effects structure. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{groupedData}}, \code{\link{lme}}, \code{\link{pdMat}}, \code{\link{solve.reStruct}}, \code{\link{summary.reStruct}}, \code{\link{update.reStruct}} } \examples{ rs1 <- reStruct(list(Dog = ~day, Side = ~1), data = Pixel) rs1 } \keyword{models} nlme/man/Covariate.varFunc.Rd0000644000176200001440000000214612222553014015566 0ustar liggesusers% File nlme/man/Covariate.varFunc.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Covariate.varFunc} \title{Assign varFunc Covariate} \usage{ \method{covariate}{varFunc}(object) <- value } \alias{covariate<-.varFunc} \arguments{ \item{object}{an object inheriting from class \code{"\link{varFunc}"}, representing a variance function structure.} \item{value}{a value to be assigned to the covariate associated with \code{object}.} } \description{ The covariate(s) used in the calculation of the weights of the variance function represented by \code{object} is (are) replaced by \code{value}. If \code{object} has been initialized, \code{value} must have the same dimensions as \code{getCovariate(object)}. } \value{ a \code{varFunc} object similar to \code{object}, but with its \code{covariate} attribute replaced by \code{value}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{getCovariate.varFunc}}} \examples{ vf1 <- varPower(1.1, form = ~age) covariate(vf1) <- Orthodont[["age"]] } \keyword{models} nlme/man/getGroups.Rd0000644000176200001440000000337112222553014014226 0ustar liggesusers% File nlme/man/getGroups.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getGroups} \title{Extract Grouping Factors from an Object} \usage{ getGroups(object, form, level, data, sep) } \alias{getGroups} \arguments{ \item{object}{any object} \item{form}{an optional formula with a conditioning expression on its right hand side (i.e. an expression involving the \code{|} operator). Defaults to \code{formula(object)}.} \item{level}{a positive integer vector with the level(s) of grouping to be used when multiple nested levels of grouping are present. This argument is optional for most methods of this generic function and defaults to all levels of nesting.} \item{data}{a data frame in which to interpret the variables named in \code{form}. Optional for most methods.} \item{sep}{character, the separator to use between group levels when multiple levels are collapsed. The default is \code{'/'}.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include \code{corStruct}, \code{data.frame}, \code{gls}, \code{lme}, \code{lmList}, and \code{varFunc}. } \value{ will depend on the method function used; see the appropriate documentation. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. pp. 100, 461. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{getGroupsFormula}}, \code{\link{getGroups.data.frame}}, \code{\link{getGroups.gls}}, \code{\link{getGroups.lmList}}, \code{\link{getGroups.lme}}} \examples{ ## see the method function documentation } \keyword{models} nlme/man/predict.gls.Rd0000644000176200001440000000275012222553014014465 0ustar liggesusers% File nlme/man/predict.gls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{predict.gls} \title{Predictions from a gls Object} \usage{ \method{predict}{gls}(object, newdata, na.action, \dots) } \alias{predict.gls} \arguments{ \item{object}{an object inheriting from class \code{"\link{gls}"}, representing a generalized least squares fitted linear model.} \item{newdata}{an optional data frame to be used for obtaining the predictions. All variables used in the linear model must be present in the data frame. If missing, the fitted values are returned.} \item{na.action}{a function that indicates what should happen when \code{newdata} contains \code{NA}s. The default action (\code{na.fail}) causes the function to print an error message and terminate if there are any incomplete observations.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The predictions for the linear model represented by \code{object} are obtained at the covariate values defined in \code{newdata}. } \value{ a vector with the predicted values. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{gls}}} \examples{ fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) newOvary <- data.frame(Time = c(-0.75, -0.5, 0, 0.5, 0.75)) predict(fm1, newOvary) } \keyword{models} nlme/man/Nitrendipene.Rd0000644000176200001440000000150712222456762014706 0ustar liggesusers% File nlme/man/Nitrendipene.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Nitrendipene} \alias{Nitrendipene} \title{Assay of nitrendipene} \description{ The \code{Nitrendipene} data frame has 89 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{activity}{ a numeric vector } \item{NIF}{ a numeric vector } \item{Tissue}{ an ordered factor with levels \code{2} < \code{1} < \code{3} < \code{4} } \item{log.NIF}{ a numeric vector } } } \source{ Bates, D. M. and Watts, D. G. (1988), \emph{Nonlinear Regression Analysis and Its Applications}, Wiley, New York. } %\examples{} \keyword{datasets} nlme/man/corFactor.corStruct.Rd0000644000176200001440000000441712222553014016162 0ustar liggesusers% File nlme/man/corFactor.corStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corFactor.corStruct} \title{Factor of a corStruct Object Matrix} \usage{ \method{corFactor}{corStruct}(object, \dots) } \alias{corFactor.compSymm} \alias{corFactor.corAR1} \alias{corFactor.corARMA} \alias{corFactor.corCAR1} \alias{corFactor.corNatural} \alias{corFactor.corSpatial} \alias{corFactor.corStruct} \alias{corFactor.corSymm} \arguments{ \item{object}{an object inheriting from class \code{"\link{corStruct}"} representing a correlation structure, which must have been initialized (using \code{Initialize}).} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts a transpose inverse square-root factor, or a series of transpose inverse square-root factors, of the correlation matrix, or list of correlation matrices, represented by \code{object}. Letting \eqn{\Sigma}{S} denote a correlation matrix, a square-root factor of \eqn{\Sigma}{S} is any square matrix \eqn{L}{L} such that \eqn{\Sigma = L'L}{S = L'L}. This method extracts \eqn{L^{-t}}{L^(-t)}. } \value{ If the correlation structure does not include a grouping factor, the returned value will be a vector with a transpose inverse square-root factor of the correlation matrix associated with \code{object} stacked column-wise. If the correlation structure includes a grouping factor, the returned value will be a vector with transpose inverse square-root factors of the correlation matrices for each group, stacked by group and stacked column-wise within each group. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu} } \note{ This method function is used intensively in optimization algorithms and its value is returned as a vector for efficiency reasons. The \code{corMatrix} method function can be used to obtain transpose inverse square-root factors in matrix form. } \seealso{ \code{\link{corFactor}}, \code{\link{corMatrix.corStruct}}, \code{\link{recalc.corStruct}}, \code{\link{Initialize.corStruct}} } \examples{ cs1 <- corAR1(form = ~1 | Subject) cs1 <- Initialize(cs1, data = Orthodont) corFactor(cs1) } \keyword{models} nlme/man/compareFits.Rd0000644000176200001440000000332313330762523014530 0ustar liggesusers% File nlme/man/compareFits.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{compareFits} \title{Compare Fitted Objects} \usage{ compareFits(object1, object2, which) } \alias{compareFits} \alias{print.compareFits} \arguments{ \item{object1,object2}{data frames, or matrices, with the same row names, but possibly different column names. These will usually correspond to coefficients from fitted objects with a grouping structure (e.g. \code{lme} and \code{lmList} objects).} \item{which}{an optional integer or character vector indicating which columns in \code{object1} and \code{object2} are to be used in the returned object. Defaults to all columns.} } \description{ The columns in \code{object1} and \code{object2} are put together in matrices which allow direct comparison of the individual elements for each object. Missing columns in either object are replaced by \code{NA}s. } \value{ a three-dimensional array, with the third dimension given by the number of unique column names in either \code{object1} or \code{object2}. To each column name there corresponds a matrix with as many rows as the rows in \code{object1} and two columns, corresponding to \code{object1} and \code{object2}. The returned object inherits from class \code{compareFits}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{plot.compareFits}}, \code{\link{pairs.compareFits}}, \code{\link{comparePred}}, \code{\link{coef}}, \code{\link{random.effects}} } \examples{% don't change lightly -- now called from other examples! fm1 <- lmList(Orthodont) fm2 <- lme(fm1) (cF12 <- compareFits(coef(fm1), coef(fm2))) } \keyword{models} nlme/man/Variogram.corSpatial.Rd0000644000176200001440000000455512222553014016303 0ustar liggesusers% File nlme/man/Variogram.corSpatial.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Variogram.corSpatial} \title{Calculate Semi-variogram for a corSpatial Object} \usage{ \method{Variogram}{corSpatial}(object, distance, sig2, length.out, FUN, \dots) } \alias{Variogram.corSpatial} \arguments{ \item{object}{an object inheriting from class \code{"\link{corSpatial}"}, representing spatial correlation structure.} \item{distance}{an optional numeric vector with the distances at which the semi-variogram is to be calculated. Defaults to \code{NULL}, in which case a sequence of length \code{length.out} between the minimum and maximum values of \code{getCovariate(object)} is used.} \item{sig2}{an optional numeric value representing the process variance. Defaults to \code{1}.} \item{length.out}{an optional integer specifying the length of the sequence of distances to be used for calculating the semi-variogram, when \code{distance = NULL}. Defaults to \code{50}.} \item{FUN}{a function of two arguments, the distance and the range corresponding to \code{object}, specifying the semi-variogram model.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function calculates the semi-variogram values corresponding to the model defined in \code{FUN}, using the estimated coefficients corresponding to \code{object}, at the distances defined by \code{distance}. } \value{ a data frame with columns \code{variog} and \code{dist} representing, respectively, the semi-variogram values and the corresponding distances. The returned value inherits from class \code{Variogram}. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corSpatial}}, \code{\link{Variogram}}, \code{\link{Variogram.default}}, \code{\link{Variogram.corExp}}, \code{\link{Variogram.corGaus}}, \code{\link{Variogram.corLin}}, \code{\link{Variogram.corRatio}}, \code{\link{Variogram.corSpher}}, \code{\link{plot.Variogram}} } \examples{ cs1 <- corExp(3, form = ~ Time | Rat) cs1 <- Initialize(cs1, BodyWeight) Variogram(cs1, FUN = function(x, y) (1 - exp(-x/y)))[1:10,] } \keyword{models} nlme/man/MathAchSchool.Rd0000644000176200001440000000242712222456762014741 0ustar liggesusers% File nlme/man/MathAchSchool.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{MathAchSchool} \alias{MathAchSchool} \title{School demographic data for MathAchieve} \description{ The \code{MathAchSchool} data frame has 160 rows and 7 columns. } \format{ This data frame contains the following columns: \describe{ \item{School}{ a factor giving the school on which the measurement is made. } \item{Size}{ a numeric vector giving the number of students in the school } \item{Sector}{ a factor with levels \code{Public} \code{Catholic} } \item{PRACAD}{ a numeric vector giving the percentage of students on the academic track } \item{DISCLIM}{ a numeric vector measuring the discrimination climate } \item{HIMINTY}{ a factor with levels \code{0} \code{1} } \item{MEANSES}{ a numeric vector giving the mean SES score. } } } \details{ These variables give the school-level demographic data to accompany the \code{MathAchieve} data. } %\source{} %\examples{} \keyword{datasets} nlme/man/formula.pdMat.Rd0000644000176200001440000000237712222553014014765 0ustar liggesusers% File nlme/man/formula.pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{formula.pdMat} \title{Extract pdMat Formula} \usage{ \method{formula}{pdMat}(x, asList, \dots) } \alias{formula.pdMat} \arguments{ \item{x}{an object inheriting from class \code{"\link{pdMat}"}, representing a positive definite matrix.} \item{asList}{logical. Should the asList argument be applied to each of the components? Never used.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function extracts the formula associated with a \code{pdMat} object, in which the column and row names are specified. } \value{ if \code{x} has a \code{formula} attribute, its value is returned, else \code{NULL} is returned. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ Because factors may be present in \code{formula(x)}, the \code{pdMat} object needs to have access to a data frame where the variables named in the formula can be evaluated, before it can resolve its row and column names from the formula. } \seealso{\code{\link{pdMat}}} \examples{ pd1 <- pdSymm(~Sex*age) formula(pd1) } \keyword{models} nlme/man/pdMat.Rd0000644000176200001440000000605212222553014013313 0ustar liggesusers% File nlme/man/pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdMat} \title{Positive-Definite Matrix} \usage{ pdMat(value, form, nam, data, pdClass) } \alias{pdMat} \alias{plot.pdMat} \arguments{ \item{value}{an optional initialization value, which can be any of the following: a \code{pdMat} object, a positive-definite matrix, a one-sided linear formula (with variables separated by \code{+}), a vector of character strings, or a numeric vector. Defaults to \code{numeric(0)}, corresponding to an uninitialized object.} \item{form}{an optional one-sided linear formula specifying the row/column names for the matrix represented by \code{object}. Because factors may be present in \code{form}, the formula needs to be evaluated on a data.frame to resolve the names it defines. This argument is ignored when \code{value} is a one-sided formula. Defaults to \code{NULL}.} \item{nam}{an optional vector of character strings specifying the row/column names for the matrix represented by object. It must have length equal to the dimension of the underlying positive-definite matrix and unreplicated elements. This argument is ignored when \code{value} is a vector of character strings. Defaults to \code{NULL}.} \item{data}{an optional data frame in which to evaluate the variables named in \code{value} and \code{form}. It is used to obtain the levels for \code{factors}, which affect the dimensions and the row/column names of the underlying matrix. If \code{NULL}, no attempt is made to obtain information on \code{factors} appearing in the formulas. Defaults to the parent frame from which the function was called.} \item{pdClass}{an optional character string naming the \code{pdMat} class to be assigned to the returned object. This argument will only be used when \code{value} is not a \code{pdMat} object. Defaults to \code{"pdSymm"}.} } \description{ This function gives an alternative way of constructing an object inheriting from the \code{pdMat} class named in \code{pdClass}, or from \code{data.class(object)} if \code{object} inherits from \code{pdMat}, and is mostly used internally in other functions. See the documentation on the principal constructor function, generally with the same name as the \code{pdMat} class of object. } \value{ a \code{pdMat} object representing a positive-definite matrix, inheriting from the class named in \code{pdClass}, or from \code{class(object)}, if \code{object} inherits from \code{pdMat}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{pdClasses}}, \code{\link{pdCompSymm}}, \code{\link{pdDiag}}, \code{\link{pdIdent}}, \code{\link{pdNatural}}, \code{\link{pdSymm}}, \code{\link{reStruct}}, \code{\link{solve.pdMat}}, \code{\link{summary.pdMat}} } \examples{ pd1 <- pdMat(diag(1:4), pdClass = "pdDiag") pd1 } \keyword{models} nlme/man/Initialize.varFunc.Rd0000644000176200001440000000317712222553014015757 0ustar liggesusers% File nlme/man/Initialize.varFunc.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Initialize.varFunc} \title{Initialize varFunc Object} \usage{ \method{Initialize}{varFunc}(object, data, \dots) } \alias{Initialize.varFunc} \alias{Initialize.varComb} \alias{Initialize.varConstPower} \alias{Initialize.varExp} \alias{Initialize.varFixed} \alias{Initialize.varIdent} \alias{Initialize.varPower} \arguments{ \item{object}{an object inheriting from class \code{"\link{varFunc}"}, representing a variance function structure.} \item{data}{a data frame in which to evaluate the variables named in \code{formula(object)}. } \item{\dots}{this argument is included to make this method compatible with the generic.} } \description{ This method initializes \code{object} by evaluating its associated covariate(s) and grouping factor, if any is present, in \code{data}; determining if the covariate(s) need to be updated when the values of the coefficients associated with \code{object} change; initializing the log-likelihood and the weights associated with \code{object}; and assigning initial values for the coefficients in \code{object}, if none were present. The covariate(s) will only be initialized if no update is needed when \code{coef(object)} changes. } \value{ an initialized object with the same class as \code{object} representing a variance function structure. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{Initialize}} } \examples{ vf1 <- varPower( form = ~ age | Sex ) vf1 <- Initialize( vf1, Orthodont ) } \keyword{models} nlme/man/varWeights.lmeStruct.Rd0000644000176200001440000000237512222553014016356 0ustar liggesusers% File nlme/man/varWeights.lmeStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{varWeights.lmeStruct} \title{Variance Weights for lmeStruct Object} \usage{ \method{varWeights}{lmeStruct}(object) } \alias{varWeights.lmeStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmeStruct}"}, representing a list of linear mixed-effects model components, such as \code{reStruct}, \code{corStruct}, and \code{varFunc} objects.} } \description{ If \code{object} includes a \code{varStruct} component, the inverse of the standard deviations of the variance function structure represented by the corresponding \code{varFunc} object are returned; else, a vector of ones of length equal to the number of observations in the data frame used to fit the associated linear mixed-effects model is returned. } \value{ if \code{object} includes a \code{varStruct} component, a vector with the corresponding variance weights; else, or a vector of ones. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{varWeights}}} \keyword{models} nlme/man/getCovariate.data.frame.Rd0000644000176200001440000000211412222553014016657 0ustar liggesusers% File nlme/man/getCovariate.data.frame.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getCovariate.data.frame} \title{Extract Data Frame Covariate} \usage{ \method{getCovariate}{data.frame}(object, form, data) } \alias{getCovariate.data.frame} \arguments{ \item{object}{an object inheriting from class \code{data.frame}.} \item{form}{an optional formula specifying the covariate to be evaluated in \code{object}. Defaults to \code{formula(object)}.} \item{data}{some methods for this generic require a separate data frame. Not used in this method.} } \description{ The right hand side of \code{form}, stripped of any conditioning expression (i.e. an expression following a \code{|} operator), is evaluated in \code{object}. } \value{ the value of the right hand side of \code{form}, stripped of any conditional expression, evaluated in \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{getCovariateFormula}}} \examples{ getCovariate(Orthodont) } \keyword{models} nlme/man/as.matrix.pdMat.Rd0000644000176200001440000000166712222553014015227 0ustar liggesusers% File nlme/man/as.matrix.pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{as.matrix.pdMat} \title{Matrix of a pdMat Object} \usage{ \method{as.matrix}{pdMat}(x, \dots) } \alias{as.matrix.pdMat} \arguments{ \item{x}{an object inheriting from class \code{"\link{pdMat}"}, representing a positive-definite matrix.} \item{\dots}{further arguments passed from other methods.} } \description{ This method function extracts the positive-definite matrix represented by \code{x}. } \value{ a matrix corresponding to the positive-definite matrix represented by \code{x}. } \references{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{pdMat}}, \code{\link{corMatrix}}} \examples{ as.matrix(pdSymm(diag(4))) } \keyword{models} nlme/man/collapse.groupedData.Rd0000644000176200001440000001146012222553014016305 0ustar liggesusers% File nlme/man/collapse.groupedData.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{collapse.groupedData} \title{Collapse a groupedData Object} \usage{ \method{collapse}{groupedData}(object, collapseLevel, displayLevel, outer, inner, preserve, FUN, subset, \dots) } \alias{collapse.groupedData} \arguments{ \item{object}{an object inheriting from class \code{groupedData}, generally with multiple grouping factors. } \item{collapseLevel}{an optional positive integer or character string indicating the grouping level to use when collapsing the data. Level values increase from outermost to innermost grouping. Default is the highest or innermost level of grouping. } \item{displayLevel}{an optional positive integer or character string indicating the grouping level to use as the grouping factor for the collapsed data. Default is \code{collapseLevel}. } \item{outer}{an optional logical value or one-sided formula, indicating covariates that are outer to the \code{displayLevel} grouping factor. If equal to \code{TRUE}, the \code{displayLevel} element \code{attr(object, "outer")} is used to indicate the outer covariates. An outer covariate is invariant within the sets of rows defined by the grouping factor. Ordering of the groups is done in such a way as to preserve adjacency of groups with the same value of the outer variables. Defaults to \code{NULL}, meaning that no outer covariates are to be used. } \item{inner}{an optional logical value or one-sided formula, indicating a covariate that is inner to the \code{displayLevel} grouping factor. If equal to \code{TRUE}, \code{attr(object, "outer")} is used to indicate the inner covariate. An inner covariate can change within the sets of rows defined by the grouping factor. Defaults to \code{NULL}, meaning that no inner covariate is present. } \item{preserve}{an optional one-sided formula indicating a covariate whose levels should be preserved when collapsing the data according to the \code{collapseLevel} grouping factor. The collapsing factor is obtained by pasting together the levels of the \code{collapseLevel} grouping factor and the values of the covariate to be preserved. Default is \code{NULL}, meaning that no covariates need to be preserved. } \item{FUN}{an optional summary function or a list of summary functions to be used for collapsing the data. The function or functions are applied only to variables in \code{object} that vary within the groups defined by \code{collapseLevel}. Invariant variables are always summarized by group using the unique value that they assume within that group. If \code{FUN} is a single function it will be applied to each non-invariant variable by group to produce the summary for that variable. If \code{FUN} is a list of functions, the names in the list should designate classes of variables in the data such as \code{ordered}, \code{factor}, or \code{numeric}. The indicated function will be applied to any non-invariant variables of that class. The default functions to be used are \code{mean} for numeric factors, and \code{Mode} for both \code{factor} and \code{ordered}. The \code{Mode} function, defined internally in \code{gsummary}, returns the modal or most popular value of the variable. It is different from the \code{mode} function that returns the S-language mode of the variable.} \item{subset}{an optional named list. Names can be either positive integers representing grouping levels, or names of grouping factors. Each element in the list is a vector indicating the levels of the corresponding grouping factor to be preserved in the collapsed data. Default is \code{NULL}, meaning that all levels are used. } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ If \code{object} has a single grouping factor, it is returned unchanged. Else, it is summarized by the values of the \code{displayLevel} grouping factor (or the combination of its values and the values of the covariate indicated in \code{preserve}, if any is present). The collapsed data is used to produce a new \code{groupedData} object, with grouping factor given by the \code{displayLevel} factor. } \value{ a \code{groupedData} object with a single grouping factor given by the \code{displayLevel} grouping factor, resulting from collapsing \code{object} over the levels of the \code{collapseLevel} grouping factor. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{groupedData}}, \code{\link{plot.nmGroupedData}} } \examples{ # collapsing by Dog collapse(Pixel, collapse = 1) # same as collapse(Pixel, collapse = "Dog") } \keyword{models} nlme/man/summary.modelStruct.Rd0000644000176200001440000000233712222553014016251 0ustar liggesusers% File nlme/man/summary.modelStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{summary.modelStruct} \alias{summary.modelStruct} \alias{summary.reStruct} \title{Summarize a modelStruct Object} \usage{ \method{summary}{modelStruct}(object, \dots) } \arguments{ \item{object}{an object inheriting from class \code{"modelStruct"}, representing a list of model components, such as \code{reStruct}, \code{corStruct} and \code{varFunc} objects. } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function applies \code{summary} to each element of \code{object}. } \value{ a list with elements given by the summarized components of \code{object}. The returned value is of class \code{summary.modelStruct}, also inheriting from the same classes as \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{reStruct}}, \code{\link{summary}} } %\seealso{\code{\link{print.summary.modelStruct}}} \examples{ lms1 <- lmeStruct(reStruct = reStruct(pdDiag(diag(2), ~age)), corStruct = corAR1(0.3)) summary(lms1) } \keyword{models} nlme/man/getResponseFormula.Rd0000644000176200001440000000132712222456762016106 0ustar liggesusers% File nlme/man/getResponseFormula.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getResponseFormula} \title{Extract Formula Specifying Response Variable} \usage{ getResponseFormula(object) } \alias{getResponseFormula} \arguments{ \item{object}{any object from which a formula can be extracted.} } \description{ The left hand side of \code{formula{object}} is returned as a one-sided formula. } \value{ a one-sided formula with the response variable associated with \code{formula{object}}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{getResponse}}} \examples{ getResponseFormula(y ~ x | g) } \keyword{models} nlme/man/corSymm.Rd0000644000176200001440000000632712222553014013704 0ustar liggesusers% File nlme/man/corSymm.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corSymm} \title{General Correlation Structure} \usage{ corSymm(value, form, fixed) } \alias{corSymm} \arguments{ \item{value}{an optional vector with the parameter values. Default is \code{numeric(0)}, which results in a vector of zeros of appropriate dimension being assigned to the parameters when \code{object} is initialized (corresponding to an identity correlation structure).} \item{form}{a one sided formula of the form \code{~ t}, or \code{~ t | g}, specifying a time covariate \code{t} and, optionally, a grouping factor \code{g}. A covariate for this correlation structure must be integer valued. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{corSymm} class, representing a general correlation structure. The internal representation of this structure, in terms of unconstrained parameters, uses the spherical parametrization defined in Pinheiro and Bates (1996). Objects created using this constructor must later be initialized using the appropriate \code{Initialize} method. } \value{ an object of class \code{corSymm} representing a general correlation structure. } \references{ Pinheiro, J.C. and Bates., D.M. (1996) "Unconstrained Parametrizations for Variance-Covariance Matrices", Statistics and Computing, 6, 289-296. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{Initialize.corSymm}}, \code{\link{summary.corSymm}} } \examples{ ## covariate is observation order and grouping factor is Subject cs1 <- corSymm(form = ~ 1 | Subject) # Pinheiro and Bates, p. 225 cs1CompSymm <- corCompSymm(value = 0.3, form = ~ 1 | Subject) cs1CompSymm <- Initialize(cs1CompSymm, data = Orthodont) corMatrix(cs1CompSymm) # Pinheiro and Bates, p. 226 cs1Symm <- corSymm(value = c(0.2, 0.1, -0.1, 0, 0.2, 0), form = ~ 1 | Subject) cs1Symm <- Initialize(cs1Symm, data = Orthodont) corMatrix(cs1Symm) # example gls(..., corSpher ...) # Pinheiro and Bates, pp. 261, 263 fm1Wheat2 <- gls(yield ~ variety - 1, Wheat2) # p. 262 fm2Wheat2 <- update(fm1Wheat2, corr = corSpher(c(28, 0.2), form = ~ latitude + longitude, nugget = TRUE)) # example gls(..., corSymm ... ) # Pinheiro and Bates, p. 251 fm1Orth.gls <- gls(distance ~ Sex * I(age - 11), Orthodont, correlation = corSymm(form = ~ 1 | Subject), weights = varIdent(form = ~ 1 | age)) } \keyword{models} nlme/man/Pixel.Rd0000644000176200001440000000226212222456762013342 0ustar liggesusers% File nlme/man/Pixel.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Pixel} \alias{Pixel} \title{X-ray pixel intensities over time} \description{ The \code{Pixel} data frame has 102 rows and 4 columns of data on the pixel intensities of CT scans of dogs over time } \format{ This data frame contains the following columns: \describe{ \item{Dog}{ a factor with levels \code{1} to \code{10} designating the dog on which the scan was made } \item{Side}{ a factor with levels \code{L} and \code{R} designating the side of the dog being scanned } \item{day}{ a numeric vector giving the day post injection of the contrast on which the scan was made } \item{pixel}{ a numeric vector of pixel intensities } } } \source{ Pinheiro, J. C. and Bates, D. M. (2000) \emph{Mixed-effects Models in S and S-PLUS}, Springer. } \examples{ fm1 <- lme(pixel ~ day + I(day^2), data = Pixel, random = list(Dog = ~ day, Side = ~ 1)) summary(fm1) VarCorr(fm1) } \keyword{datasets} nlme/man/solve.pdMat.Rd0000644000176200001440000000230512222553014014437 0ustar liggesusers% File nlme/man/solve.pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{solve.pdMat} \title{Calculate Inverse of a Positive-Definite Matrix} \usage{ \method{solve}{pdMat}(a, b, \dots) } \alias{solve.pdMat} \alias{solve.pdBlocked} \alias{solve.pdDiag} \alias{solve.pdIdent} \alias{solve.pdLogChol} \alias{solve.pdNatural} \alias{solve.pdSymm} \arguments{ \item{a}{an object inheriting from class \code{"\link{pdMat}"}, representing a positive definite matrix.} \item{b}{this argument is only included for consistency with the generic function and is not used in this method function.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The positive-definite matrix represented by \code{a} is inverted and assigned to \code{a}. } \value{ a \code{pdMat} object similar to \code{a}, but with coefficients corresponding to the inverse of the positive-definite matrix represented by \code{a}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{pdMat}}} \examples{ pd1 <- pdCompSymm(3 * diag(3) + 1) solve(pd1) } \keyword{models} nlme/man/lmList.groupedData.Rd0000644000176200001440000000454012704356630015762 0ustar liggesusers% File nlme/man/lmList.groupedData.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{lmList.groupedData} \title{lmList Fit from a groupedData Object} \alias{lmList.groupedData} \usage{ \method{lmList}{groupedData}(object, data, level, subset, na.action = na.fail, pool = TRUE, warn.lm = TRUE) } \arguments{ \item{object}{a data frame inheriting from class \code{"\link{groupedData}"}.} \item{data}{this argument is included for consistency with the generic function. It is ignored in this method function.} \item{level}{ an optional integer specifying the level of grouping to be used when multiple nested levels of grouping are present. } \item{subset}{an optional expression indicating which subset of the rows of \code{data} should be used in the fit. This can be a logical vector, or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{na.fail}) causes \code{lmList} to print an error message and terminate if there are any incomplete observations. } \item{pool, warn.lm}{optional \code{\link{logical}}s, see \code{\link{lmList}}.} } \description{ The response variable and primary covariate in \code{formula(object)} are used to construct the linear model formula. This formula and the \code{groupedData} object are passed as the \code{object} and \code{data} arguments to \code{lmList.formula}, together with any other additional arguments in the function call. See the documentation on \code{lmList.formula} for a description of that function. } \value{ a list of \code{lm} objects with as many components as the number of groups defined by the grouping factor. Generic functions such as \code{coef}, \code{fixed.effects}, \code{lme}, \code{pairs}, \code{plot}, \code{predict}, \code{random.effects}, \code{summary}, and \code{update} have methods that can be applied to an \code{lmList} object. } \seealso{ \code{\link{groupedData}}, \code{\link{lm}}, \code{\link{lme.lmList}}, \code{\link{lmList}}, \code{\link{lmList.formula}} } \examples{ fm1 <- lmList(Orthodont) summary(fm1) } \keyword{models} nlme/man/coef.lmList.Rd0000644000176200001440000000743112222553014014427 0ustar liggesusers% File nlme/man/coef.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{coef.lmList} \title{Extract lmList Coefficients} \usage{ \method{coef}{lmList}(object, augFrame, data, which, FUN, omitGroupingFactor, \dots) } \alias{coef.lmList} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmList}"}, representing a list of \code{lm} objects with a common model. } \item{augFrame}{an optional logical value. If \code{TRUE}, the returned data frame is augmented with variables defined in the data frame used to produce \code{object}; else, if \code{FALSE}, only the coefficients are returned. Defaults to \code{FALSE}. } \item{data}{an optional data frame with the variables to be used for augmenting the returned data frame when \code{augFrame = TRUE}. Defaults to the data frame used to fit \code{object}.} \item{which}{an optional positive integer or character vector specifying which columns of the data frame used to produce \code{object} should be used in the augmentation of the returned data frame. Defaults to all variables in the data. } \item{FUN}{an optional summary function or a list of summary functions to be applied to group-varying variables, when collapsing the data by groups. Group-invariant variables are always summarized by the unique value that they assume within that group. If \code{FUN} is a single function it will be applied to each non-invariant variable by group to produce the summary for that variable. If \code{FUN} is a list of functions, the names in the list should designate classes of variables in the frame such as \code{ordered}, \code{factor}, or \code{numeric}. The indicated function will be applied to any group-varying variables of that class. The default functions to be used are \code{mean} for numeric factors, and \code{Mode} for both \code{factor} and \code{ordered}. The \code{Mode} function, defined internally in \code{gsummary}, returns the modal or most popular value of the variable. It is different from the \code{mode} function that returns the S-language mode of the variable. } \item{omitGroupingFactor}{an optional logical value. When \code{TRUE} the grouping factor itself will be omitted from the group-wise summary of \code{data} but the levels of the grouping factor will continue to be used as the row names for the returned data frame. Defaults to \code{FALSE}. } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The coefficients of each \code{lm} object in the \code{object} list are extracted and organized into a data frame, with rows corresponding to the \code{lm} components and columns corresponding to the coefficients. Optionally, the returned data frame may be augmented with covariates summarized over the groups associated with the \code{lm} components. } \value{ a data frame inheriting from class \code{"coef.lmList"} with the estimated coefficients for each \code{"lm"} component of \code{object} and, optionally, other covariates summarized over the groups corresponding to the \code{"lm"} components. The returned object also inherits from classes \code{"ranef.lmList"} and \code{"data.frame"}. } \references{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York, esp. pp. 457-458. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}}, \code{\link{fixed.effects.lmList}}, \code{\link{ranef.lmList}}, \code{\link{plot.ranef.lmList}}, \code{\link{gsummary}}} \examples{ fm1 <- lmList(distance ~ age|Subject, data = Orthodont) coef(fm1) coef(fm1, augFrame = TRUE) } \keyword{models} nlme/man/logLik.lmList.Rd0000644000176200001440000000334412222553014014733 0ustar liggesusers% File nlme/man/logLik.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{logLik.lmList} \title{Log-Likelihood of an lmList Object} \usage{ \method{logLik}{lmList}(object, REML, pool, \dots) } \alias{logLik.lmList} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmList}"}, representing a list of \code{lm} objects with a common model. } \item{REML}{an optional logical value. If \code{TRUE} the restricted log-likelihood is returned, else, if \code{FALSE}, the log-likelihood is returned. Defaults to \code{FALSE}. } \item{pool}{an optional logical value indicating whether all \code{lm} components of \code{object} may be assumed to have the same error variance. Default is \code{attr(object, "pool")}. } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ If \code{pool=FALSE}, the (restricted) log-likelihoods of the \code{lm} components of \code{object} are summed together. Else, the (restricted) log-likelihood of the \code{lm} fit with different coefficients for each level of the grouping factor associated with the partitioning of the \code{object} components is obtained. } \value{ either the sum of the (restricted) log-likelihoods of each \code{lm} component in \code{object}, or the (restricted) log-likelihood for the \code{lm} fit with separate coefficients for each component of \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}}, \code{\link{logLik.lme}}, } \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) logLik(fm1) # returns NA when it should not } \keyword{models} nlme/man/Variogram.corGaus.Rd0000644000176200001440000000372312222553014015601 0ustar liggesusers% File nlme/man/Variogram.corGaus.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Variogram.corGaus} \title{Calculate Semi-variogram for a corGaus Object} \usage{ \method{Variogram}{corGaus}(object, distance, sig2, length.out, \dots) } \alias{Variogram.corGaus} \arguments{ \item{object}{an object inheriting from class \code{"\link{corGaus}"}, representing an Gaussian spatial correlation structure.} \item{distance}{an optional numeric vector with the distances at which the semi-variogram is to be calculated. Defaults to \code{NULL}, in which case a sequence of length \code{length.out} between the minimum and maximum values of \code{getCovariate(object)} is used.} \item{sig2}{an optional numeric value representing the process variance. Defaults to \code{1}.} \item{length.out}{an optional integer specifying the length of the sequence of distances to be used for calculating the semi-variogram, when \code{distance = NULL}. Defaults to \code{50}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function calculates the semi-variogram values corresponding to the Gaussian correlation model, using the estimated coefficients corresponding to \code{object}, at the distances defined by \code{distance}. } \value{ a data frame with columns \code{variog} and \code{dist} representing, respectively, the semi-variogram values and the corresponding distances. The returned value inherits from class \code{Variogram}. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corGaus}}, \code{\link{plot.Variogram}}, \code{\link{Variogram}} } \examples{ cs1 <- corGaus(3, form = ~ Time | Rat) cs1 <- Initialize(cs1, BodyWeight) Variogram(cs1)[1:10,] } \keyword{models} nlme/man/print.varFunc.Rd0000644000176200001440000000146512222553014015010 0ustar liggesusers% File nlme/man/print.varFunc.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{print.varFunc} \title{Print a varFunc Object} \usage{ \method{print}{varFunc}(x, \dots) } \alias{print.varFunc} \alias{print.varComb} \arguments{ \item{x}{an object inheriting from class \code{"\link{varFunc}"}, representing a variance function structure.} \item{\dots}{optional arguments passed to \code{print.default}; see the documentation on that method function.} } \description{ The class and the coefficients associated with \code{x} are printed. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{summary.varFunc}}} \examples{ vf1 <- varPower(0.3, form = ~age) vf1 <- Initialize(vf1, Orthodont) print(vf1) } \keyword{models} nlme/man/model.matrix.reStruct.Rd0000644000176200001440000000361112222553014016461 0ustar liggesusers% File nlme/man/model.matrix.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{model.matrix.reStruct} \title{reStruct Model Matrix} \usage{ \method{model.matrix}{reStruct}(object, data, contrast, \dots) } \alias{model.matrix.reStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} \item{data}{a data frame in which to evaluate the variables defined in \code{formula(object)}.} \item{contrast}{an optional named list specifying the contrasts to be used for representing the \code{factor} variables in \code{data}. The components names should match the names of the variables in \code{data} for which the contrasts are to be specified. The components of this list will be used as the \code{contrasts} attribute of the corresponding factor. If missing, the default contrast specification is used.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The model matrices for each element of \code{formula(object)}, calculated using \code{data}, are bound together column-wise. When multiple grouping levels are present (i.e. when \code{length(object) > 1}), the individual model matrices are combined from innermost (at the leftmost position) to outermost (at the rightmost position). } \value{ a matrix obtained by binding together, column-wise, the model matrices for each element of \code{formula(object)}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{model.matrix}}, \code{\link{contrasts}}, \code{\link{reStruct}}, \code{\link{formula.reStruct}}} \examples{ rs1 <- reStruct(list(Dog = ~day, Side = ~1), data = Pixel) model.matrix(rs1, Pixel) } \keyword{models} nlme/man/Oats.Rd0000644000176200001440000000302512222456762013165 0ustar liggesusers% File nlme/man/Oats.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Oats} \alias{Oats} \title{Split-plot Experiment on Varieties of Oats} \description{ The \code{Oats} data frame has 72 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{Block}{ an ordered factor with levels \code{VI} < \code{V} < \code{III} < \code{IV} < \code{II} < \code{I} } \item{Variety}{ a factor with levels \code{Golden Rain} \code{Marvellous} \code{Victory} } \item{nitro}{ a numeric vector } \item{yield}{ a numeric vector } } } \details{ These data have been introduced by Yates (1935) as an example of a split-plot design. The treatment structure used in the experiment was a \eqn{3 \times 4}{3 x 4} full factorial, with three varieties of oats and four concentrations of nitrogen. The experimental units were arranged into six blocks, each with three whole-plots subdivided into four subplots. The varieties of oats were assigned randomly to the whole-plots and the concentrations of nitrogen to the subplots. All four concentrations of nitrogen were used on each whole-plot. } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.15) Venables, W. N. and Ripley, B. D. (2002) \emph{Modern Applied Statistics with S. (4th ed)}, Springer, New York. } %\examples{} \keyword{datasets} nlme/man/getCovariateFormula.Rd0000644000176200001440000000147612222456762016232 0ustar liggesusers% File nlme/man/getCovariateFormula.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getCovariateFormula} \title{Extract Covariates Formula} \usage{ getCovariateFormula(object) } \alias{getCovariateFormula} \arguments{ \item{object}{any object from which a formula can be extracted.} } \description{ The right hand side of \code{formula(object)}, without any conditioning expressions (i.e. any expressions after a \code{|} operator) is returned as a one-sided formula. } \value{ a one-sided formula describing the covariates associated with \code{formula(object)}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{getCovariate}}} \examples{ getCovariateFormula(y ~ x | g) getCovariateFormula(y ~ x) } \keyword{models} nlme/man/pdMatrix.Rd0000644000176200001440000000335312222553014014037 0ustar liggesusers% File nlme/man/pdMatrix.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdMatrix} \title{Extract Matrix or Square-Root Factor from a pdMat Object} \usage{ pdMatrix(object, factor) } \alias{pdMatrix} \alias{pdMatrix.pdBlocked} \alias{pdMatrix.pdCompSymm} \alias{pdMatrix.pdDiag} \alias{pdMatrix.pdIdent} \alias{pdMatrix.pdMat} \alias{pdMatrix.pdSymm} \alias{pdMatrix.pdNatural} \arguments{ \item{object}{an object inheriting from class \code{pdMat}, representing a positive definite matrix.} \item{factor}{an optional logical value. If \code{TRUE}, a square-root factor of the positive-definite matrix represented by \code{object} is returned; else, if \code{FALSE}, the positive-definite matrix is returned. Defaults to \code{FALSE}.} } \description{ The positive-definite matrix represented by \code{object}, or a square-root factor of it is obtained. Letting \eqn{\Sigma}{S} denote a positive-definite matrix, a square-root factor of \eqn{\Sigma}{S} is any square matrix \eqn{L}{L} such that \eqn{\Sigma = L'L}{S = L'L}. This function extracts \eqn{S} or \eqn{L}. } \value{ if \code{fact} is \code{FALSE} the positive-definite matrix represented by \code{object} is returned; else a square-root of the positive-definite matrix is returned. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. p. 162. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{as.matrix.pdMat}}, \code{\link{pdClasses}}, \code{\link{pdFactor}}, \code{\link{pdMat}}, \code{\link{pdMatrix.reStruct}}, \code{\link{corMatrix}} } \examples{ pd1 <- pdSymm(diag(1:4)) pdMatrix(pd1) } \keyword{models} nlme/man/varFixed.Rd0000644000176200001440000000243112222553014014013 0ustar liggesusers% File nlme/man/varFixed.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{varFixed} \title{Fixed Variance Function} \usage{ varFixed(value) } \alias{varFixed} \arguments{ \item{value}{a one-sided formula of the form \code{~ v} specifying a variance covariate \code{v}. Grouping factors are ignored.} } \description{ This function is a constructor for the \code{varFixed} class, representing a variance function with fixed variances. Letting \eqn{v} denote the variance covariate defined in \code{value}, the variance function \eqn{\sigma^2(v)}{s2(v)} for this class is \eqn{\sigma^2(v)=|v|}{s2(v)=|v|}. The variance covariate \eqn{v} is evaluated once at initialization and remains fixed thereafter. No coefficients are required to represent this variance function. } \value{ a \code{varFixed} object representing a fixed variance function structure, also inheriting from class \code{varFunc}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{varClasses}}, \code{\link{varWeights.varFunc}}, \code{\link{varFunc}}} \examples{ vf1 <- varFixed(~age) } \keyword{models} nlme/man/fitted.lme.Rd0000644000176200001440000000503712222456762014317 0ustar liggesusers% File nlme/man/fitted.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{fitted.lme} \title{Extract lme Fitted Values} \usage{ \method{fitted}{lme}(object, level, asList, \dots) } \alias{fitted.lme} \arguments{ \item{object}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model.} \item{level}{an optional integer vector giving the level(s) of grouping to be used in extracting the fitted values from \code{object}. Level values increase from outermost to innermost grouping, with level zero corresponding to the population fitted values. Defaults to the highest or innermost level of grouping.} \item{asList}{an optional logical value. If \code{TRUE} and a single value is given in \code{level}, the returned object is a list with the fitted values split by groups; else the returned value is either a vector or a data frame, according to the length of \code{level}. Defaults to \code{FALSE}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The fitted values at level \eqn{i} are obtained by adding together the population fitted values (based only on the fixed effects estimates) and the estimated contributions of the random effects to the fitted values at grouping levels less or equal to \eqn{i}. The resulting values estimate the best linear unbiased predictions (BLUPs) at level \eqn{i}. } \value{ If a single level of grouping is specified in \code{level}, the returned value is either a list with the fitted values split by groups (\code{asList = TRUE}) or a vector with the fitted values (\code{asList = FALSE}); else, when multiple grouping levels are specified in \code{level}, the returned object is a data frame with columns given by the fitted values at different levels and the grouping factors. For a vector or data frame result the \code{\link{napredict}} method is applied. } \references{ Bates, D.M. and Pinheiro, J.C. (1998) "Computational methods for multilevel models" available in PostScript or PDF formats at http://nlme.stat.wisc.edu/pub/NLME/ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. pp. 235, 397. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{residuals.lme}} } \examples{ fm1 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) fitted(fm1, level = 0:1) } \keyword{models} nlme/man/coef.lme.Rd0000644000176200001440000000770412222553014013743 0ustar liggesusers% File nlme/man/coef.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{coef.lme} \title{Extract lme Coefficients} \usage{ \method{coef}{lme}(object, augFrame, level, data, which, FUN, omitGroupingFactor, subset, \dots) } \alias{coef.lme} \arguments{ \item{object}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model.} \item{augFrame}{an optional logical value. If \code{TRUE}, the returned data frame is augmented with variables defined in \code{data}; else, if \code{FALSE}, only the coefficients are returned. Defaults to \code{FALSE}.} \item{level}{an optional positive integer giving the level of grouping to be used in extracting the coefficients from an object with multiple nested grouping levels. Defaults to the highest or innermost level of grouping.} \item{data}{an optional data frame with the variables to be used for augmenting the returned data frame when \code{augFrame = TRUE}. Defaults to the data frame used to fit \code{object}.} \item{which}{an optional positive integer or character vector specifying which columns of \code{data} should be used in the augmentation of the returned data frame. Defaults to all columns in \code{data}.} \item{FUN}{an optional summary function or a list of summary functions to be applied to group-varying variables, when collapsing \code{data} by groups. Group-invariant variables are always summarized by the unique value that they assume within that group. If \code{FUN} is a single function it will be applied to each non-invariant variable by group to produce the summary for that variable. If \code{FUN} is a list of functions, the names in the list should designate classes of variables in the frame such as \code{ordered}, \code{factor}, or \code{numeric}. The indicated function will be applied to any group-varying variables of that class. The default functions to be used are \code{mean} for numeric factors, and \code{Mode} for both \code{factor} and \code{ordered}. The \code{Mode} function, defined internally in \code{gsummary}, returns the modal or most popular value of the variable. It is different from the \code{mode} function that returns the S-language mode of the variable.} \item{omitGroupingFactor}{an optional logical value. When \code{TRUE} the grouping factor itself will be omitted from the group-wise summary of \code{data} but the levels of the grouping factor will continue to be used as the row names for the returned data frame. Defaults to \code{FALSE}.} \item{subset}{an optional expression specifying a subset} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The estimated coefficients at level \eqn{i} are obtained by adding together the fixed effects estimates and the corresponding random effects estimates at grouping levels less or equal to \eqn{i}. The resulting estimates are returned as a data frame, with rows corresponding to groups and columns to coefficients. Optionally, the returned data frame may be augmented with covariates summarized over groups. } \value{ a data frame inheriting from class \code{"coef.lme"} with the estimated coefficients at level \code{level} and, optionally, other covariates summarized over groups. The returned object also inherits from classes \code{"ranef.lme"} and \code{"data.frame"}. } \references{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York, esp. pp. 455-457. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, %\code{\link{fixef.lme}}, \code{\link{ranef.lme}}, \code{\link{plot.ranef.lme}}, \code{\link{gsummary}} } \examples{ fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject) coef(fm1) coef(fm1, augFrame = TRUE) } \keyword{models} nlme/man/Machines.Rd0000644000176200001440000000246712222456762014017 0ustar liggesusers% File nlme/man/Machines.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Machines} \alias{Machines} \title{Productivity Scores for Machines and Workers} \description{ The \code{Machines} data frame has 54 rows and 3 columns. } \format{ This data frame contains the following columns: \describe{ \item{Worker}{ an ordered factor giving the unique identifier for the worker. } \item{Machine}{ a factor with levels \code{A}, \code{B}, and \code{C} identifying the machine brand. } \item{score}{ a productivity score. } } } \details{ Data on an experiment to compare three brands of machines used in an industrial process are presented in Milliken and Johnson (p. 285, 1992). Six workers were chosen randomly among the employees of a factory to operate each machine three times. The response is an overall productivity score taking into account the number and quality of components produced.} \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.14) Milliken, G. A. and Johnson, D. E. (1992), \emph{Analysis of Messy Data, Volume I: Designed Experiments}, Chapman and Hall, London. } %\examples{} \keyword{datasets} nlme/man/corExp.Rd0000644000176200001440000001126112222553014013504 0ustar liggesusers% File nlme/man/corExp.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corExp} \title{Exponential Correlation Structure} \usage{ corExp(value, form, nugget, metric, fixed) } \alias{corExp} \arguments{ \item{value}{an optional vector with the parameter values in constrained form. If \code{nugget} is \code{FALSE}, \code{value} can have only one element, corresponding to the "range" of the exponential correlation structure, which must be greater than zero. If \code{nugget} is \code{TRUE}, meaning that a nugget effect is present, \code{value} can contain one or two elements, the first being the "range" and the second the "nugget effect" (one minus the correlation between two observations taken arbitrarily close together); the first must be greater than zero and the second must be between zero and one. Defaults to \code{numeric(0)}, which results in a range of 90\% of the minimum distance and a nugget effect of 0.1 being assigned to the parameters when \code{object} is initialized.} \item{form}{a one sided formula of the form \code{~ S1+...+Sp}, or \code{~ S1+...+Sp | g}, specifying spatial covariates \code{S1} through \code{Sp} and, optionally, a grouping factor \code{g}. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{nugget}{an optional logical value indicating whether a nugget effect is present. Defaults to \code{FALSE}.} \item{metric}{an optional character string specifying the distance metric to be used. The currently available options are \code{"euclidean"} for the root sum-of-squares of distances; \code{"maximum"} for the maximum difference; and \code{"manhattan"} for the sum of the absolute differences. Partial matching of arguments is used, so only the first three characters need to be provided. Defaults to \code{"euclidean"}.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{"corExp"} class, representing an exponential spatial correlation structure. Letting \eqn{d} denote the range and \eqn{n} denote the nugget effect, the correlation between two observations a distance \eqn{r} apart is \eqn{\exp(-r/d)}{exp(-r/d)} when no nugget effect is present and \eqn{(1-n) \exp(-r/d)}{(1-n)*exp(-r/d)} when a nugget effect is assumed. Objects created using this constructor must later be initialized using the appropriate \code{Initialize} method. } \value{ an object of class \code{"corExp"}, also inheriting from class \code{"corSpatial"}, representing an exponential spatial correlation structure. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. Littel, Milliken, Stroup, and Wolfinger (1996) "SAS Systems for Mixed Models", SAS Institute. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. p. 238. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corClasses}}, \code{\link{Initialize.corStruct}}, \code{\link{summary.corStruct}}, \code{\link{dist}} } \examples{ sp1 <- corExp(form = ~ x + y + z) # Pinheiro and Bates, p. 238 spatDat <- data.frame(x = (0:4)/4, y = (0:4)/4) cs1Exp <- corExp(1, form = ~ x + y) cs1Exp <- Initialize(cs1Exp, spatDat) corMatrix(cs1Exp) cs2Exp <- corExp(1, form = ~ x + y, metric = "man") cs2Exp <- Initialize(cs2Exp, spatDat) corMatrix(cs2Exp) cs3Exp <- corExp(c(1, 0.2), form = ~ x + y, nugget = TRUE) cs3Exp <- Initialize(cs3Exp, spatDat) corMatrix(cs3Exp) # example lme(..., corExp ...) # Pinheiro and Bates, pp. 222-247 # p. 222 options(contrasts = c("contr.treatment", "contr.poly")) fm1BW.lme <- lme(weight ~ Time * Diet, BodyWeight, random = ~ Time) # p. 223 fm2BW.lme <- update(fm1BW.lme, weights = varPower()) # p. 246 fm3BW.lme <- update(fm2BW.lme, correlation = corExp(form = ~ Time)) # p. 247 fm4BW.lme <- update(fm3BW.lme, correlation = corExp(form = ~ Time, nugget = TRUE)) anova(fm3BW.lme, fm4BW.lme) } \keyword{models} nlme/man/plot.lme.Rd0000644000176200001440000001154612222553014014004 0ustar liggesusers% File nlme/man/plot.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{plot.lme} \title{Plot an lme or nls object} \alias{plot.lme} \alias{plot.nls} \usage{ \method{plot}{lme}(x, form, abline, id, idLabels, idResType, grid, \dots) \method{plot}{nls}(x, form, abline, id, idLabels, idResType, grid, \dots) } \arguments{ \item{x}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model, or from \code{nls}, representing an fitted nonlinear least squares model.} \item{form}{an optional formula specifying the desired type of plot. Any variable present in the original data frame used to obtain \code{x} can be referenced. In addition, \code{x} itself can be referenced in the formula using the symbol \code{"."}. Conditional expressions on the right of a \code{|} operator can be used to define separate panels in a Trellis display. Default is \code{resid(., type = "p") ~ fitted(.) }, corresponding to a plot of the standardized residuals versus fitted values, both evaluated at the innermost level of nesting.} \item{abline}{an optional numeric value, or numeric vector of length two. If given as a single value, a horizontal line will be added to the plot at that coordinate; else, if given as a vector, its values are used as the intercept and slope for a line added to the plot. If missing, no lines are added to the plot.} \item{id}{an optional numeric value, or one-sided formula. If given as a value, it is used as a significance level for a two-sided outlier test for the standardized, or normalized residuals. Observations with absolute standardized (normalized) residuals greater than the \eqn{1 - value/2} quantile of the standard normal distribution are identified in the plot using \code{idLabels}. If given as a one-sided formula, its right hand side must evaluate to a logical, integer, or character vector which is used to identify observations in the plot. If missing, no observations are identified.} \item{idLabels}{an optional vector, or one-sided formula. If given as a vector, it is converted to character and used to label the observations identified according to \code{id}. If given as a one-sided formula, its right hand side must evaluate to a vector which is converted to character and used to label the identified observations. Default is the innermost grouping factor.} \item{idResType}{an optional character string specifying the type of residuals to be used in identifying outliers, when \code{id} is a numeric value. If \code{"pearson"}, the standardized residuals (raw residuals divided by the corresponding standard errors) are used; else, if \code{"normalized"}, the normalized residuals (standardized residuals pre-multiplied by the inverse square-root factor of the estimated error correlation matrix) are used. Partial matching of arguments is used, so only the first character needs to be provided. Defaults to \code{"pearson"}.} \item{grid}{an optional logical value indicating whether a grid should be added to plot. Default depends on the type of Trellis plot used: if \code{xyplot} defaults to \code{TRUE}, else defaults to \code{FALSE}.} \item{\dots}{optional arguments passed to the Trellis plot function.} } \description{ Diagnostic plots for the linear mixed-effects fit are obtained. The \code{form} argument gives considerable flexibility in the type of plot specification. A conditioning expression (on the right side of a \code{|} operator) always implies that different panels are used for each level of the conditioning factor, according to a Trellis display. If \code{form} is a one-sided formula, histograms of the variable on the right hand side of the formula, before a \code{|} operator, are displayed (the Trellis function \code{histogram} is used). If \code{form} is two-sided and both its left and right hand side variables are numeric, scatter plots are displayed (the Trellis function \code{xyplot} is used). Finally, if \code{form} is two-sided and its left had side variable is a factor, box-plots of the right hand side variable by the levels of the left hand side variable are displayed (the Trellis function \code{bwplot} is used). } \value{ a diagnostic Trellis plot. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{xyplot}}, \code{\link{bwplot}}, \code{\link{histogram}}} \examples{ fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject) # standardized residuals versus fitted values by gender plot(fm1, resid(., type = "p") ~ fitted(.) | Sex, abline = 0) # box-plots of residuals by Subject plot(fm1, Subject ~ resid(.)) # observed versus fitted values by Subject plot(fm1, distance ~ fitted(.) | Subject, abline = c(0,1)) } \keyword{models} \keyword{hplot} nlme/man/Dim.Rd0000644000176200001440000000215612222553014012760 0ustar liggesusers% File nlme/man/Dim.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Dim} \title{Extract Dimensions from an Object} \usage{ Dim(object, \dots) } \alias{Dim} \alias{Dim.default} \arguments{ \item{object}{any object for which dimensions can be extracted.} \item{\dots}{some methods for this generic function require additional arguments.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include: \code{"\link{corSpatial}"}, \code{"\link{corStruct}"}, \code{"pdCompSymm"}, \code{"pdDiag"}, \code{"pdIdent"}, \code{"pdMat"}, and \code{"pdSymm"}. } \value{ will depend on the method function used; see the appropriate documentation. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ If \code{dim} allowed more than one argument, there would be no need for this generic function. } \seealso{ \code{\link{Dim.pdMat}}, \code{\link{Dim.corStruct}} } \examples{ ## see the method function documentation } \keyword{models} nlme/man/needUpdate.modelStruct.Rd0000644000176200001440000000222412222553014016625 0ustar liggesusers% File nlme/man/needUpdate.modelStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{needUpdate.modelStruct} \title{Check if a modelStruct Object Needs Updating} \usage{ \method{needUpdate}{modelStruct}(object) } \alias{needUpdate.modelStruct} \alias{needUpdate.corStruct} \alias{needUpdate.reStruct} \arguments{ \item{object}{an object inheriting from class \code{"modelStruct"}, representing a list of model components, such as \code{corStruct} and \code{varFunc} objects.} } \description{ This method function checks if any of the elements of \code{object} needs to be updated. Updating of objects usually takes place in iterative algorithms in which auxiliary quantities associated with the object, and not being optimized over, may change. } \value{ a logical value indicating whether any element of \code{object} needs to be updated. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{needUpdate}} } \examples{ lms1 <- lmeStruct(reStruct = reStruct(pdDiag(diag(2), ~age)), varStruct = varPower(form = ~age)) needUpdate(lms1) } \keyword{models} nlme/man/comparePred.Rd0000644000176200001440000000640312222553014014507 0ustar liggesusers% File nlme/man/comparePred.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{comparePred} \title{Compare Predictions} \usage{ comparePred(object1, object2, primary, minimum, maximum, length.out, level, \dots) } \alias{comparePred} \alias{comparePred.gls} \alias{comparePred.lme} \alias{comparePred.lmList} \arguments{ \item{object1,object2}{fitted model objects, from which predictions can be extracted using the \code{predict} method.} \item{primary}{an optional one-sided formula specifying the primary covariate to be used to generate the augmented predictions. By default, if a covariate can be extracted from the data used to generate the objects (using \code{getCovariate}), it will be used as \code{primary}.} \item{minimum}{an optional lower limit for the primary covariate. Defaults to \code{min(primary)}, after \code{primary} is evaluated in the \code{data} used in fitting \code{object1}.} \item{maximum}{an optional upper limit for the primary covariate. Defaults to \code{max(primary)}, after \code{primary} is evaluated in the \code{data} used in fitting \code{object1}.} \item{length.out}{an optional integer with the number of primary covariate values at which to evaluate the predictions. Defaults to 51.} \item{level}{an optional integer specifying the desired prediction level. Levels increase from outermost to innermost grouping, with level 0 representing the population (fixed effects) predictions. Only one level can be specified. Defaults to the innermost level.} \item{\dots}{some methods for the generic may require additional arguments.} } \description{ Predicted values are obtained at the specified values of \code{primary} for each object. If either \code{object1} or \code{object2} have a grouping structure (i.e. \code{getGroups(object)} is not \code{NULL}), predicted values are obtained for each group. When both objects determine groups, the group levels must be the same. If other covariates besides \code{primary} are used in the prediction model, their group-wise averages (numeric covariates) or most frequent values (categorical covariates) are used to obtain the predicted values. The original observations are also included in the returned object. } \value{ a data frame with four columns representing, respectively, the values of the primary covariate, the groups (if \code{object} does not have a grouping structure, all elements will be \code{1}), the predicted or observed values, and the type of value in the third column: the objects' names are used to classify the predicted values and \code{original} is used for the observed values. The returned object inherits from classes \code{comparePred} and \code{augPred}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include: \code{gls}, \code{lme}, and \code{lmList}. } \seealso{\code{\link{augPred}}, \code{\link{getGroups}}} \examples{ fm1 <- lme(distance ~ age * Sex, data = Orthodont, random = ~ age) fm2 <- update(fm1, distance ~ age) comparePred(fm1, fm2, length.out = 2) } \keyword{models} nlme/man/lme.Rd0000644000176200001440000002041113421666360013031 0ustar liggesusers% File nlme/man/lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{lme} \title{Linear Mixed-Effects Models} \usage{ lme(fixed, data, random, correlation, weights, subset, method, na.action, control, contrasts = NULL, keep.data = TRUE) \method{update}{lme}(object, fixed., \dots, evaluate = TRUE) } \alias{lme} \alias{lme.formula} \alias{update.lme} \arguments{ \item{object}{an object inheriting from class \code{lme}, representing a fitted linear mixed-effects model.} \item{fixed}{a two-sided linear formula object describing the fixed-effects part of the model, with the response on the left of a \code{~} operator and the terms, separated by \code{+} operators, on the right, an \code{"\link{lmList}"} object, or a \code{"\link{groupedData}"} object. There is limited support for formulae such as \code{resp ~ 1} and \code{resp ~ 0}, and less prior to version \samp{3.1-112}. } \item{fixed.}{Changes to the fixed-effects formula -- see \code{\link{update.formula}} for details.} \item{data}{an optional data frame containing the variables named in \code{fixed}, \code{random}, \code{correlation}, \code{weights}, and \code{subset}. By default the variables are taken from the environment from which \code{lme} is called.} \item{random}{optionally, any of the following: (i) a one-sided formula of the form \code{~ x1 + ... + xn | g1/.../gm}, with \code{x1 + ... + xn} specifying the model for the random effects and \code{g1/.../gm} the grouping structure (\code{m} may be equal to 1, in which case no \code{/} is required). The random effects formula will be repeated for all levels of grouping, in the case of multiple levels of grouping; (ii) a list of one-sided formulas of the form \code{~ x1 + ... + xn | g}, with possibly different random effects models for each grouping level. The order of nesting will be assumed the same as the order of the elements in the list; (iii) a one-sided formula of the form \code{~ x1 + ... + xn}, or a \code{\link{pdMat}} object with a formula (i.e. a non-\code{NULL} value for \code{formula(object)}), or a list of such formulas or \code{\link{pdMat}} objects. In this case, the grouping structure formula will be derived from the data used to fit the linear mixed-effects model, which should inherit from class \code{"\link{groupedData}"}; (iv) a named list of formulas or \code{\link{pdMat}} objects as in (iii), with the grouping factors as names. The order of nesting will be assumed the same as the order of the order of the elements in the list; (v) an \code{\link{reStruct}} object. See the documentation on \code{pdClasses} for a description of the available \code{\link{pdMat}} classes. Defaults to a formula consisting of the right hand side of \code{fixed}.} \item{correlation}{an optional \code{\link{corStruct}} object describing the within-group correlation structure. See the documentation of \code{\link{corClasses}} for a description of the available \code{corStruct} classes. Defaults to \code{NULL}, corresponding to no within-group correlations.} \item{weights}{an optional \code{\link{varFunc}} object or one-sided formula describing the within-group heteroscedasticity structure. If given as a formula, it is used as the argument to \code{\link{varFixed}}, corresponding to fixed variance weights. See the documentation on \code{\link{varClasses}} for a description of the available \code{\link{varFunc}} classes. Defaults to \code{NULL}, corresponding to homoscedastic within-group errors.} \item{subset}{an optional expression indicating the subset of the rows of \code{data} that should be used in the fit. This can be a logical vector, or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.} \item{method}{a character string. If \code{"REML"} the model is fit by maximizing the restricted log-likelihood. If \code{"ML"} the log-likelihood is maximized. Defaults to \code{"REML"}.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{\link{na.fail}}) causes \code{lme} to print an error message and terminate if there are any incomplete observations.} \item{control}{a list of control values for the estimation algorithm to replace the default values returned by the function \code{\link{lmeControl}}. Defaults to an empty list.} \item{contrasts}{an optional list. See the \code{contrasts.arg} of \code{\link{model.matrix.default}}.} \item{keep.data}{logical: should the \code{data} argument (if supplied and a data frame) be saved as part of the model object?} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} \item{evaluate}{If \code{TRUE} evaluate the new call else return the call.} } \description{ This generic function fits a linear mixed-effects model in the formulation described in Laird and Ware (1982) but allowing for nested random effects. The within-group errors are allowed to be correlated and/or have unequal variances. The methods \code{\link{lme.lmList}} and \code{\link{lme.groupedData}} are documented separately. } \value{ An object of class \code{"lme"} representing the linear mixed-effects model fit. Generic functions such as \code{print}, \code{plot} and \code{summary} have methods to show the results of the fit. See \code{\link{lmeObject}} for the components of the fit. The functions \code{\link{resid}}, \code{\link{coef}}, \code{\link{fitted}}, \code{\link{fixed.effects}}, and \code{\link{random.effects}} can be used to extract some of its components. } \note{ The function does not do any scaling internally: the optimization will work best when the response is scaled so its variance is of the order of one. } \references{ The computational methods follow the general framework of Lindstrom and Bates (1988). The model formulation is described in Laird and Ware (1982). The variance-covariance parametrizations are described in Pinheiro and Bates (1996). The different correlation structures available for the \code{correlation} argument are described in Box, Jenkins and Reinsel (1994), Littell \emph{et al} (1996), and Venables and Ripley (2002). The use of variance functions for linear and nonlinear mixed effects models is presented in detail in Davidian and Giltinan (1995). Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden--Day. Davidian, M. and Giltinan, D.M. (1995) "Nonlinear Mixed Effects Models for Repeated Measurement Data", Chapman and Hall. Laird, N.M. and Ware, J.H. (1982) "Random-Effects Models for Longitudinal Data", Biometrics, 38, 963--974. Lindstrom, M.J. and Bates, D.M. (1988) "Newton-Raphson and EM Algorithms for Linear Mixed-Effects Models for Repeated-Measures Data", Journal of the American Statistical Association, 83, 1014--1022. Littell, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996) "SAS Systems for Mixed Models", SAS Institute. Pinheiro, J.C. and Bates., D.M. (1996) "Unconstrained Parametrizations for Variance-Covariance Matrices", Statistics and Computing, 6, 289--296. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corClasses}}, \code{\link{lme.lmList}}, \code{\link{lme.groupedData}}, \code{\link{lmeControl}}, \code{\link{lmeObject}}, \code{\link{lmeStruct}}, \code{\link{lmList}}, \code{\link{pdClasses}}, \code{\link{plot.lme}}, \code{\link{predict.lme}}, \code{\link{qqnorm.lme}}, \code{\link{residuals.lme}}, \code{\link{reStruct}}, \code{\link{simulate.lme}}, \code{\link{summary.lme}}, \code{\link{varClasses}}, \code{\link{varFunc}} } \examples{ fm1 <- lme(distance ~ age, data = Orthodont) # random is ~ age fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) summary(fm1) summary(fm2) } \keyword{models} nlme/man/summary.pdMat.Rd0000644000176200001440000000403712222553014015010 0ustar liggesusers% File nlme/man/summary.pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{summary.pdMat} \title{Summarize a pdMat Object} \usage{ \method{summary}{pdMat}(object, structName, noCorrelation, \dots) } \alias{summary.pdMat} \alias{summary.pdBlocked} \alias{summary.pdCompSymm} \alias{summary.pdDiag} \alias{summary.pdIdent} \alias{summary.pdNatural} \alias{summary.pdSymm} \alias{summary.pdLogChol} \arguments{ \item{object}{an object inheriting from class \code{"\link{pdMat}"}, representing a positive definite matrix.} \item{structName}{an optional character string with a description of the \code{pdMat} class. Default depends on the method function: \code{"Blocked"} for \code{pdBlocked}, \code{"Compound Symmetry"} for \code{pdCompSymm}, \code{"Diagonal"} for \code{pdDiag}, \code{"Multiple of an Identity"} for \code{pdIdent}, \code{"General Positive-Definite, Natural Parametrization"} for \code{pdNatural}, \code{"General Positive-Definite"} for \code{pdSymm}, and \code{data.class(object)} for \code{pdMat}.} \item{noCorrelation}{an optional logical value indicating whether correlations are to be printed in \code{print.summary.pdMat}. Default depends on the method function: \code{FALSE} for \code{pdDiag} and \code{pdIdent}, and \code{TRUE} for all other classes.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ Attributes \code{structName} and \code{noCorrelation}, with the values of the corresponding arguments to the method function, are appended to \code{object} and its class is changed to \code{summary.pdMat}. } \value{ an object similar to \code{object}, with additional attributes \code{structName} and \code{noCorrelation}, inheriting from class \code{summary.pdMat}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{print.summary.pdMat}}, \code{\link{pdMat}}} \examples{ summary(pdSymm(diag(4))) } \keyword{models} nlme/man/residuals.lmList.Rd0000644000176200001440000000421212222553014015500 0ustar liggesusers% File nlme/man/residuals.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{residuals.lmList} \title{Extract lmList Residuals} \usage{ \method{residuals}{lmList}(object, type, subset, asList, \dots) } \alias{residuals.lmList} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmList}"}, representing a list of \code{lm} objects with a common model. } \item{subset}{an optional character or integer vector naming the \code{lm} components of \code{object} from which the residuals are to be extracted. Default is \code{NULL}, in which case all components are used. } \item{type}{an optional character string specifying the type of residuals to be extracted. Options include \code{"response"} for the "raw" residuals (observed - fitted), \code{"pearson"} for the standardized residuals (raw residuals divided by the estimated residual standard error) using different standard errors for each \code{lm} fit, and \code{"pooled.pearson"} for the standardized residuals using a pooled estimate of the residual standard error. Partial matching of arguments is used, so only the first character needs to be provided. Defaults to \code{"response"}. } \item{asList}{an optional logical value. If \code{TRUE}, the returned object is a list with the residuals split by groups; else the returned value is a vector. Defaults to \code{FALSE}. } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The residuals are extracted from each \code{lm} component of \code{object} and arranged into a list with as many components as \code{object}, or combined into a single vector. } \value{ a list with components given by the residuals of each \code{lm} component of \code{object}, or a vector with the residuals for all \code{lm} components of \code{object}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}}, \code{\link{fitted.lmList}}} \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) residuals(fm1) } \keyword{models} nlme/man/varExp.Rd0000644000176200001440000000703112222553014013511 0ustar liggesusers% File nlme/man/varExp.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{varExp} \title{Exponential Variance Function} \usage{ varExp(value, form, fixed) } \alias{varExp} \arguments{ \item{value}{an optional numeric vector, or list of numeric values, with the variance function coefficients. \code{Value} must have length one, unless a grouping factor is specified in \code{form}. If \code{value} has length greater than one, it must have names which identify its elements to the levels of the grouping factor defined in \code{form}. If a grouping factor is present in \code{form} and \code{value} has length one, its value will be assigned to all grouping levels. Default is \code{numeric(0)}, which results in a vector of zeros of appropriate length being assigned to the coefficients when \code{object} is initialized (corresponding to constant variance equal to one).} \item{form}{an optional one-sided formula of the form \code{~ v}, or \code{~ v | g}, specifying a variance covariate \code{v} and, optionally, a grouping factor \code{g} for the coefficients. The variance covariate must evaluate to a numeric vector and may involve expressions using \code{"."}, representing a fitted model object from which fitted values (\code{fitted(.)}) and residuals (\code{resid(.)}) can be extracted (this allows the variance covariate to be updated during the optimization of an object function). When a grouping factor is present in \code{form}, a different coefficient value is used for each of its levels. Several grouping variables may be simultaneously specified, separated by the \code{*} operator, like in \code{~ v | g1 * g2 * g3}. In this case, the levels of each grouping variable are pasted together and the resulting factor is used to group the observations. Defaults to \code{~ fitted(.)} representing a variance covariate given by the fitted values of a fitted model object and no grouping factor. } \item{fixed}{an optional numeric vector, or list of numeric values, specifying the values at which some or all of the coefficients in the variance function should be fixed. If a grouping factor is specified in \code{form}, \code{fixed} must have names identifying which coefficients are to be fixed. Coefficients included in \code{fixed} are not allowed to vary during the optimization of an objective function. Defaults to \code{NULL}, corresponding to no fixed coefficients.} } \description{ This function is a constructor for the \code{varExp} class, representing an exponential variance function structure. Letting \eqn{v} denote the variance covariate and \eqn{\sigma^2(v)}{s2(v)} denote the variance function evaluated at \eqn{v}, the exponential variance function is defined as \eqn{\sigma^2(v) = \exp(2\theta v)}{s2(v) = exp(2* t * v)}, where \eqn{\theta}{t} is the variance function coefficient. When a grouping factor is present, a different \eqn{\theta}{t} is used for each factor level. } \value{ a \code{varExp} object representing an exponential variance function structure, also inheriting from class \code{varFunc}. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{varClasses}}, \code{\link{varWeights.varFunc}}, \code{\link{coef.varExp}}} \examples{ vf1 <- varExp(0.2, form = ~age|Sex) } \keyword{models} nlme/man/corGaus.Rd0000644000176200001440000001014512222553014013647 0ustar liggesusers% File nlme/man/corGaus.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{corGaus} \title{Gaussian Correlation Structure} \usage{ corGaus(value, form, nugget, metric, fixed) } \alias{corGaus} \arguments{ \item{value}{an optional vector with the parameter values in constrained form. If \code{nugget} is \code{FALSE}, \code{value} can have only one element, corresponding to the "range" of the Gaussian correlation structure, which must be greater than zero. If \code{nugget} is \code{TRUE}, meaning that a nugget effect is present, \code{value} can contain one or two elements, the first being the "range" and the second the "nugget effect" (one minus the correlation between two observations taken arbitrarily close together); the first must be greater than zero and the second must be between zero and one. Defaults to \code{numeric(0)}, which results in a range of 90\% of the minimum distance and a nugget effect of 0.1 being assigned to the parameters when \code{object} is initialized.} \item{form}{a one sided formula of the form \code{~ S1+...+Sp}, or \code{~ S1+...+Sp | g}, specifying spatial covariates \code{S1} through \code{Sp} and, optionally, a grouping factor \code{g}. When a grouping factor is present in \code{form}, the correlation structure is assumed to apply only to observations within the same grouping level; observations with different grouping levels are assumed to be uncorrelated. Defaults to \code{~ 1}, which corresponds to using the order of the observations in the data as a covariate, and no groups.} \item{nugget}{an optional logical value indicating whether a nugget effect is present. Defaults to \code{FALSE}.} \item{metric}{an optional character string specifying the distance metric to be used. The currently available options are \code{"euclidean"} for the root sum-of-squares of distances; \code{"maximum"} for the maximum difference; and \code{"manhattan"} for the sum of the absolute differences. Partial matching of arguments is used, so only the first three characters need to be provided. Defaults to \code{"euclidean"}.} \item{fixed}{an optional logical value indicating whether the coefficients should be allowed to vary in the optimization, or kept fixed at their initial value. Defaults to \code{FALSE}, in which case the coefficients are allowed to vary.} } \description{ This function is a constructor for the \code{corGaus} class, representing a Gaussian spatial correlation structure. Letting \eqn{d} denote the range and \eqn{n} denote the nugget effect, the correlation between two observations a distance \eqn{r} apart is \eqn{\exp(-(r/d)^2)}{exp(-(r/d)^2)} when no nugget effect is present and \eqn{(1-n) \exp(-(r/d)^2)}{(1-n)*exp(-(r/d)^2)} when a nugget effect is assumed. Objects created using this constructor must later be initialized using the appropriate ` \code{Initialize} method. } \value{ an object of class \code{corGaus}, also inheriting from class \code{corSpatial}, representing a Gaussian spatial correlation structure. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. Littel, Milliken, Stroup, and Wolfinger (1996) "SAS Systems for Mixed Models", SAS Institute. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{Initialize.corStruct}}, \code{\link{summary.corStruct}}, \code{\link{dist}} } \examples{ sp1 <- corGaus(form = ~ x + y + z) # example lme(..., corGaus ...) # Pinheiro and Bates, pp. 222-249 fm1BW.lme <- lme(weight ~ Time * Diet, BodyWeight, random = ~ Time) # p. 223 fm2BW.lme <- update(fm1BW.lme, weights = varPower()) # p 246 fm3BW.lme <- update(fm2BW.lme, correlation = corExp(form = ~ Time)) # p. 249 fm8BW.lme <- update(fm3BW.lme, correlation = corGaus(form = ~ Time)) } \keyword{models} nlme/man/MathAchieve.Rd0000644000176200001440000000226512222456762014442 0ustar liggesusers% File nlme/man/MathAchieve.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{MathAchieve} \alias{MathAchieve} \title{Mathematics achievement scores} \description{ The \code{MathAchieve} data frame has 7185 rows and 6 columns. } \format{ This data frame contains the following columns: \describe{ \item{School}{ an ordered factor identifying the school that the student attends } \item{Minority}{ a factor with levels \code{No} \code{Yes} indicating if the student is a member of a minority racial group. } \item{Sex}{ a factor with levels \code{Male} \code{Female} } \item{SES}{ a numeric vector of socio-economic status. } \item{MathAch}{ a numeric vector of mathematics achievement scores. } \item{MEANSES}{ a numeric vector of the mean SES for the school. } } } \details{ Each row in this data frame contains the data for one student. } %\source{} \examples{ summary(MathAchieve) } \keyword{datasets} nlme/man/recalc.Rd0000644000176200001440000000273412222553014013502 0ustar liggesusers% File nlme/man/recalc.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{recalc} \title{Recalculate Condensed Linear Model Object} \usage{ recalc(object, conLin, \dots) } \alias{recalc} \arguments{ \item{object}{any object which induces a recalculation of the condensed linear model object \code{conLin}.} \item{conLin}{a condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying model.} \item{\dots}{some methods for this generic can take additional arguments.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include: \code{corStruct}, \code{modelStruct}, \code{reStruct}, and \code{varFunc}. } \value{ the recalculated condensed linear model object. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{This function is only used inside model fitting functions, such as \code{lme} and \code{gls}, that require recalculation of a condensed linear model object.} \seealso{\code{\link{recalc.corStruct}}, \code{\link{recalc.modelStruct}}, \code{\link{recalc.reStruct}}, \code{\link{recalc.varFunc}}} \examples{ ## see the method function documentation } \keyword{models} nlme/man/summary.lme.Rd0000644000176200001440000000602513330762523014527 0ustar liggesusers% File nlme/man/summary.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{summary.lme} \title{Summarize an lme Object} \alias{summary.lme} %\alias{coef.summary.lme} \alias{print.summary.lme} \usage{ \method{summary}{lme}(object, adjustSigma, verbose, \dots) \method{print}{summary.lme}(x, verbose = FALSE, \dots) } \arguments{ \item{object}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model.} \item{adjustSigma}{an optional logical value. If \code{TRUE} and the estimation method used to obtain \code{object} was maximum likelihood, the residual standard error is multiplied by \eqn{\sqrt{n_{obs}/(n_{obs} - n_{par})}}{sqrt(nobs/(nobs - npar))}, converting it to a REML-like estimate. This argument is only used when a single fitted object is passed to the function. Default is \code{TRUE}.} \item{verbose}{an optional logical value used to control the amount of output in the \code{print.summary.lme} method. Defaults to \code{FALSE}.} \item{\dots}{additional optional arguments passed to methods, mainly for the \code{\link{print}} method.} \item{x}{a \code{"summary.lme"} object.} !} \description{ Additional information about the linear mixed-effects fit represented by \code{object} is extracted and included as components of \code{object}. The returned object has a \code{\link{print}} and a \code{\link{coef}} method, the latter returning the coefficient's \code{tTtable}. } \value{ an object inheriting from class \code{summary.lme} with all components included in \code{object} (see \code{\link{lmeObject}} for a full description of the components) plus the following components: \item{corFixed}{approximate correlation matrix for the fixed effects estimates.} \item{tTable}{a matrix with columns named \code{Value}, \code{Std. Error}, \code{DF}, \code{t-value}, and \code{p-value} representing respectively the fixed effects estimates, their approximate standard errors, the denominator degrees of freedom, the ratios between the estimates and their standard errors, and the associated p-value from a t distribution. Rows correspond to the different fixed effects.} \item{residuals}{if more than five observations are used in the \code{lme} fit, a vector with the minimum, first quartile, median, third quartile, and maximum of the innermost grouping level residuals distribution; else the innermost grouping level residuals.} \item{AIC}{the Akaike Information Criterion corresponding to \code{object}.} \item{BIC}{the Bayesian Information Criterion corresponding to \code{object}.} } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{AIC}}, \code{\link{BIC}}, \code{\link{lme}}. } \examples{ fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject) (s1 <- summary(fm1)) \donttest{coef(s1) # the (coef | Std.E | t | P-v ) matrix} \dontshow{stopifnot(is.matrix(coef(s1)))} } \keyword{models} nlme/man/Dim.corStruct.Rd0000644000176200001440000000274112222553014014747 0ustar liggesusers% File nlme/man/Dim.corStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Dim.corStruct} \title{Dimensions of a corStruct Object} \usage{ \method{Dim}{corStruct}(object, groups, \dots) } \alias{Dim.corStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{corStruct}"}, representing a correlation structure.} \item{groups}{an optional factor defining the grouping of the observations; observations within a group are correlated and observations in different groups are uncorrelated.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ if \code{groups} is missing, it returns the \code{Dim} attribute of \code{object}; otherwise, calculates the dimensions associated with the grouping factor. } \value{ a list with components: \item{N}{length of \code{groups}} \item{M}{number of groups} \item{maxLen}{maximum number of observations in a group} \item{sumLenSq}{sum of the squares of the number of observations per group} \item{len}{an integer vector with the number of observations per group} \item{start}{an integer vector with the starting position for the observations in each group, beginning from zero} } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{Dim}}, \code{\link{Dim.corSpatial}}} \examples{ Dim(corAR1(), getGroups(Orthodont)) } \keyword{models} nlme/man/getVarCov.Rd0000644000176200001440000000413512222456762014162 0ustar liggesusers% File nlme/man/getVarCov.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getVarCov} \alias{getVarCov} \alias{getVarCov.lme} \alias{getVarCov.gls} \alias{print.VarCov} \title{Extract variance-covariance matrix} \description{ Extract the variance-covariance matrix from a fitted model, such as a mixed-effects model. } \usage{ getVarCov(obj, \dots) \method{getVarCov}{lme}(obj, individuals, type = c("random.effects", "conditional", "marginal"), \dots) \method{getVarCov}{gls}(obj, individual = 1, \dots) } \arguments{ \item{obj}{A fitted model. Methods are available for models fit by \code{\link{lme}} and by \code{\link{gls}}} \item{individuals}{For models fit by \code{\link{lme}} a vector of levels of the grouping factor can be specified for the conditional or marginal variance-covariance matrices.} \item{individual}{For models fit by \code{\link{gls}} the only type of variance-covariance matrix provided is the marginal variance-covariance of the responses by group. The optional argument \code{individual} specifies the group of responses.} \item{type}{For models fit by \code{\link{lme}} the \code{type} argument specifies the type of variance-covariance matrix, either \code{"random.effects"} for the random-effects variance-covariance (the default), or \code{"conditional"} for the conditional. variance-covariance of the responses or \code{"marginal"} for the the marginal variance-covariance of the responses.} \item{\dots}{Optional arguments for some methods, as described above} } \value{ A variance-covariance matrix or a list of variance-covariance matrices. } \author{Mary Lindstrom \email{lindstro@biostat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{gls}}} \examples{ fm1 <- lme(distance ~ age, data = Orthodont, subset = Sex == "Female") getVarCov(fm1) getVarCov(fm1, individual = "F01", type = "marginal") getVarCov(fm1, type = "conditional") fm2 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) getVarCov(fm2) } \keyword{models} nlme/man/gls.Rd0000644000176200001440000001300312223243346013032 0ustar liggesusers% File nlme/man/gls.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{gls} \title{Fit Linear Model Using Generalized Least Squares} \alias{gls} \alias{update.gls} \usage{ gls(model, data, correlation, weights, subset, method, na.action, control, verbose) \method{update}{gls}(object, model., \dots, evaluate = TRUE) } \arguments{ \item{object}{an object inheriting from class \code{"gls"}, representing a generalized least squares fitted linear model.} \item{model}{a two-sided linear formula object describing the model, with the response on the left of a \code{~} operator and the terms, separated by \code{+} operators, on the right.} \item{model.}{Changes to the model -- see \code{\link{update.formula}} for details.} \item{data}{an optional data frame containing the variables named in \code{model}, \code{correlation}, \code{weights}, and \code{subset}. By default the variables are taken from the environment from which \code{gls} is called.} \item{correlation}{an optional \code{\link{corStruct}} object describing the within-group correlation structure. See the documentation of \code{\link{corClasses}} for a description of the available \code{corStruct} classes. If a grouping variable is to be used, it must be specified in the \code{form} argument to the \code{corStruct} constructor. Defaults to \code{NULL}, corresponding to uncorrelated errors.} \item{weights}{an optional \code{\link{varFunc}} object or one-sided formula describing the within-group heteroscedasticity structure. If given as a formula, it is used as the argument to \code{\link{varFixed}}, corresponding to fixed variance weights. See the documentation on \code{\link{varClasses}} for a description of the available \code{\link{varFunc}} classes. Defaults to \code{NULL}, corresponding to homoscedastic errors.} \item{subset}{an optional expression indicating which subset of the rows of \code{data} should be used in the fit. This can be a logical vector, or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.} \item{method}{a character string. If \code{"REML"} the model is fit by maximizing the restricted log-likelihood. If \code{"ML"} the log-likelihood is maximized. Defaults to \code{"REML"}.} \item{na.action}{a function that indicates what should happen when the data contain \code{NA}s. The default action (\code{\link{na.fail}}) causes \code{gls} to print an error message and terminate if there are any incomplete observations.} \item{control}{a list of control values for the estimation algorithm to replace the default values returned by the function \code{\link{glsControl}}. Defaults to an empty list.} \item{verbose}{an optional logical value. If \code{TRUE} information on the evolution of the iterative algorithm is printed. Default is \code{FALSE}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} \item{evaluate}{If \code{TRUE} evaluate the new call else return the call.} } \description{ This function fits a linear model using generalized least squares. The errors are allowed to be correlated and/or have unequal variances. } \value{ an object of class \code{"gls"} representing the linear model fit. Generic functions such as \code{print}, \code{plot}, and \code{summary} have methods to show the results of the fit. See \code{\link{glsObject}} for the components of the fit. The functions \code{\link{resid}}, \code{\link{coef}} and \code{\link{fitted}}, can be used to extract some of its components. } \references{ The different correlation structures available for the \code{correlation} argument are described in Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994), Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996), and Venables, W.N. and Ripley, B.D. (2002). The use of variance functions for linear and nonlinear models is presented in detail in Carroll, R.J. and Ruppert, D. (1988) and Davidian, M. and Giltinan, D.M. (1995). Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden-Day. Carroll, R.J. and Ruppert, D. (1988) "Transformation and Weighting in Regression", Chapman and Hall. Davidian, M. and Giltinan, D.M. (1995) "Nonlinear Mixed Effects Models for Repeated Measurement Data", Chapman and Hall. Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996) "SAS Systems for Mixed Models", SAS Institute. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. pp. 100, 461. Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corClasses}}, \code{\link{glsControl}}, \code{\link{glsObject}}, \code{\link{glsStruct}}, \code{\link{plot.gls}}, \code{\link{predict.gls}}, \code{\link{qqnorm.gls}}, \code{\link{residuals.gls}}, \code{\link{summary.gls}}, \code{\link{varClasses}}, \code{\link{varFunc}} } \examples{ # AR(1) errors within each Mare fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) # variance increases as a power of the absolute fitted values fm2 <- update(fm1, weights = varPower()) } \keyword{models} nlme/man/Initialize.Rd0000644000176200001440000000263512222553014014352 0ustar liggesusers% File nlme/man/Initialize.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Initialize} \title{Initialize Object} \usage{ Initialize(object, data, \dots) } \alias{Initialize} \arguments{ \item{object}{any object requiring initialization, e.g. "plug-in" structures such as \code{corStruct} and \code{varFunc} objects. } \item{data}{a data frame to be used in the initialization procedure.} \item{\dots}{some methods for this generic function require additional arguments.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include: \code{corStruct}, \code{lmeStruct}, \code{reStruct}, and \code{varFunc}. } \value{ an initialized object with the same class as \code{object}. Changes introduced by the initialization procedure will depend on the method function used; see the appropriate documentation. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{Initialize.corStruct}}, \code{\link{Initialize.lmeStruct}}, \code{\link{Initialize.glsStruct}}, \code{\link{Initialize.varFunc}}, \code{\link{isInitialized}} } \examples{ ## see the method function documentation } \keyword{models} nlme/man/Relaxin.Rd0000644000176200001440000000144012222456762013660 0ustar liggesusers% File nlme/man/Relaxin.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Relaxin} \alias{Relaxin} \title{Assay for Relaxin} \description{ The \code{Relaxin} data frame has 198 rows and 3 columns. } \format{ This data frame contains the following columns: \describe{ \item{Run}{ an ordered factor with levels \code{5} < \code{8} < \code{9} < \code{3} < \code{4} < \code{2} < \code{7} < \code{1} < \code{6} } \item{conc}{ a numeric vector } \item{cAMP}{ a numeric vector } } } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } %\examples{} \keyword{datasets} nlme/man/summary.lmList.Rd0000644000176200001440000000770412222553014015213 0ustar liggesusers% File nlme/man/summary.lmList.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{summary.lmList} \title{Summarize an lmList Object} \usage{ \method{summary}{lmList}(object, pool, \dots) } \alias{summary.lmList} \arguments{ \item{object}{an object inheriting from class \code{"\link{lmList}"}, representing a list of \code{lm} fitted objects. } \item{pool}{an optional logical value indicating whether a pooled estimate of the residual standard error should be used. Default is \code{attr(object, "pool")}. } \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The \code{summary.lm} method is applied to each \code{lm} component of \code{object} to produce summary information on the individual fits, which is organized into a list of summary statistics. The returned object is suitable for printing with the \code{print.summary.lmList} method. } \value{ a list with summary statistics obtained by applying \code{summary.lm} to the elements of \code{object}, inheriting from class \code{summary.lmList}. The components of \code{value} are: \item{call}{a list containing an image of the \code{lmList} call that produced \code{object}. } \item{coefficients}{a three dimensional array with summary information on the \code{lm} coefficients. The first dimension corresponds to the names of the \code{object} components, the second dimension is given by \code{"Value"}, \code{"Std. Error"}, \code{"t value"}, and \code{"Pr(>|t|)"}, corresponding, respectively, to the coefficient estimates and their associated standard errors, t-values, and p-values. The third dimension is given by the coefficients names. } \item{correlation}{a three dimensional array with the correlations between the individual \code{lm} coefficient estimates. The first dimension corresponds to the names of the \code{object} components. The third dimension is given by the coefficients names. For each coefficient, the rows of the associated array give the correlations between that coefficient and the remaining coefficients, by \code{lm} component. } \item{cov.unscaled}{a three dimensional array with the unscaled variances/covariances for the individual \code{lm} coefficient estimates (giving the estimated variance/covariance for the coefficients, when multiplied by the estimated residual errors). The first dimension corresponds to the names of the \code{object} components. The third dimension is given by the coefficients names. For each coefficient, the rows of the associated array give the unscaled covariances between that coefficient and the remaining coefficients, by \code{lm} component. } \item{df}{an array with the number of degrees of freedom for the model and for residuals, for each \code{lm} component. } \item{df.residual}{the total number of degrees of freedom for residuals, corresponding to the sum of residuals df of all \code{lm} components. } \item{fstatistics}{an array with the F test statistics and corresponding degrees of freedom, for each \code{lm} component. } \item{pool}{the value of the \code{pool} argument to the function. } \item{r.squared}{a vector with the multiple R-squared statistics for each \code{lm} component. } \item{residuals}{a list with components given by the residuals from individual \code{lm} fits. } \item{RSE}{the pooled estimate of the residual standard error.} \item{sigma}{a vector with the residual standard error estimates for the individual \code{lm} fits. } \item{terms}{the terms object used in fitting the individual \code{lm} components. } } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lmList}}, \code{\link{summary}} } \examples{ fm1 <- lmList(distance ~ age | Subject, Orthodont) summary(fm1) } \keyword{models} nlme/man/residuals.nlmeStruct.Rd0000644000176200001440000000452712222553014016405 0ustar liggesusers% File nlme/man/residuals.nlmeStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{residuals.nlmeStruct} \title{Calculate nlmeStruct Residuals} \usage{ \method{residuals}{nlmeStruct}(object, level, conLin, \dots) } \alias{residuals.nlmeStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{nlmeStruct}"}, representing a list of mixed-effects model components, such as \code{reStruct}, \code{corStruct}, and \code{varFunc} objects.} \item{level}{an optional integer vector giving the level(s) of grouping to be used in extracting the residuals from \code{object}. Level values increase from outermost to innermost grouping, with level zero corresponding to the population fitted values. Defaults to the highest or innermost level of grouping.} \item{conLin}{an optional condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying nlme model. Defaults to \code{attr(object, "conLin")}.} \item{\dots}{optional arguments to the residuals generic. Not used.} } \description{ The residuals at level \eqn{i} are obtained by subtracting the fitted values at that level from the response vector. The fitted values at level \eqn{i} are obtained by adding together the contributions from the estimated fixed effects and the estimated random effects at levels less or equal to \eqn{i} and evaluating the model function at the resulting estimated parameters. } \value{ if a single level of grouping is specified in \code{level}, the returned value is a vector with the residuals at the desired level; else, when multiple grouping levels are specified in \code{level}, the returned object is a matrix with columns given by the residuals at different levels. } \references{ Bates, D.M. and Pinheiro, J.C. (1998) "Computational methods for multilevel models" available in PostScript or PDF formats at http://nlme.stat.wisc.edu } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ This method function is primarily used within the \code{nlme} function. } \seealso{\code{\link{nlme}}, \code{\link{fitted.nlmeStruct}} } \keyword{models} nlme/man/allCoef.Rd0000644000176200001440000000207112222553014013610 0ustar liggesusers% File nlme/man/allCoef.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{allCoef} \title{Extract Coefficients from a Set of Objects} \usage{ allCoef(\dots, extract) } \alias{allCoef} \arguments{ \item{\dots}{objects to which \code{extract} will be applied. Generally these will be model components, such as \code{corStruct} and \code{varFunc} objects.} \item{extract}{an optional extractor function. Defaults to \code{coef}.} } \description{ The extractor function is applied to each object in \code{\dots}, with the result being converted to a vector. A \code{map} attribute is included to indicate which pieces of the returned vector correspond to the original objects in \code{dots}. } \value{ a vector with all elements, generally coefficients, obtained by applying \code{extract} to the objects in \code{\dots}. } \author{José' Pinheiro and Douglas Bates} \seealso{\code{\link{lmeStruct}},\code{\link{nlmeStruct}}} \examples{ cs1 <- corAR1(0.1) vf1 <- varPower(0.5) allCoef(cs1, vf1) } \keyword{models} nlme/man/Phenobarb.Rd0000644000176200001440000000460512222456762014164 0ustar liggesusers% File nlme/man/Phenobarb.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Phenobarb} \alias{Phenobarb} \title{Phenobarbitol Kinetics} \description{ The \code{Phenobarb} data frame has 744 rows and 7 columns. } \format{ This data frame contains the following columns: \describe{ \item{Subject}{ an ordered factor identifying the infant. } \item{Wt}{ a numeric vector giving the birth weight of the infant (kg). } \item{Apgar}{ an ordered factor giving the 5-minute Apgar score for the infant. This is an indication of health of the newborn infant. } \item{ApgarInd}{ a factor indicating whether the 5-minute Apgar score is \code{< 5} or \code{>= 5}. } \item{time}{ a numeric vector giving the time when the sample is drawn or drug administered (hr). } \item{dose}{ a numeric vector giving the dose of drug administered (\eqn{u}{\mu}g/kg). } \item{conc}{ a numeric vector giving the phenobarbital concentration in the serum (\eqn{u}{\mu}g/L). } } } \details{ Data from a pharmacokinetics study of phenobarbital in neonatal infants. During the first few days of life the infants receive multiple doses of phenobarbital for prevention of seizures. At irregular intervals blood samples are drawn and serum phenobarbital concentrations are determined. The data were originally given in Grasela and Donn(1985) and are analyzed in Boeckmann, Sheiner and Beal (1994), in Davidian and Giltinan (1995), and in Littell et al. (1996). } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.23) Davidian, M. and Giltinan, D. M. (1995), \emph{Nonlinear Models for Repeated Measurement Data}, Chapman and Hall, London. (section 6.6) Grasela and Donn (1985), Neonatal population pharmacokinetics of phenobarbital derived from routine clinical data, \emph{Developmental Pharmacology and Therapeutics}, \bold{8}, 374-383. Boeckmann, A. J., Sheiner, L. B., and Beal, S. L. (1994), \emph{NONMEM Users Guide: Part V}, University of California, San Francisco. Littell, R. C., Milliken, G. A., Stroup, W. W. and Wolfinger, R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute, Cary, NC. } %\examples{} \keyword{datasets} nlme/man/as.matrix.corStruct.Rd0000644000176200001440000000237112222553014016143 0ustar liggesusers% File nlme/man/as.matrix.corStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{as.matrix.corStruct} \title{Matrix of a corStruct Object} \usage{ \method{as.matrix}{corStruct}(x, \dots) } \alias{as.matrix.corStruct} \arguments{ \item{x}{an object inheriting from class \code{"\link{corStruct}"}, representing a correlation structure.} \item{\dots}{further arguments passed from other methods.} } \description{ This method function extracts the correlation matrix, or list of correlation matrices, associated with \code{object}. } \value{ If the correlation structure includes a grouping factor, the returned value will be a list with components given by the correlation matrices for each group. Otherwise, the returned value will be a matrix representing the correlation structure associated with \code{object}. } \references{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{corClasses}}, \code{\link{corMatrix}}} \examples{ cst1 <- corAR1(form = ~1|Subject) cst1 <- Initialize(cst1, data = Orthodont) as.matrix(cst1) } \keyword{models} nlme/man/recalc.modelStruct.Rd0000644000176200001440000000312212222553014015776 0ustar liggesusers% File nlme/man/recalc.modelStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{recalc.modelStruct} %\title{Recalculate Condensed Linear Model for a \code{modelStruct} Object} \title{Recalculate for a modelStruct Object} \usage{ \method{recalc}{modelStruct}(object, conLin, \dots) } \alias{recalc.modelStruct} \arguments{ \item{object}{an object inheriting from class \code{"modelStruct"}, representing a list of model components, such as \code{corStruct} and \code{varFunc} objects.} \item{conLin}{an optional condensed linear model object, consisting of a list with components \code{"Xy"}, corresponding to a regression matrix (\code{X}) combined with a response vector (\code{y}), and \code{"logLik"}, corresponding to the log-likelihood of the underlying model. Defaults to \code{attr(object, "conLin")}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function recalculates the condensed linear model object using each element of \code{object} sequentially from last to first. } \value{ the recalculated condensed linear model object. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{This method function is generally only used inside model fitting functions, such as \code{lme} and \code{gls}, that allow model components, such as correlated error terms and variance functions. } \seealso{\code{\link{recalc.corStruct}}, \code{\link{recalc.reStruct}}, \code{\link{recalc.varFunc}}} \keyword{models} nlme/man/getCovariate.corStruct.Rd0000644000176200001440000000305512222553014016652 0ustar liggesusers% File nlme/man/getCovariate.corStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{getCovariate.corStruct} \title{Extract corStruct Object Covariate} \usage{ \method{getCovariate}{corStruct}(object, form, data) } \alias{getCovariate.corStruct} \alias{getCovariate.corSpatial} \arguments{ \item{object}{an object inheriting from class \code{corStruct} representing a correlation structure.} \item{form}{this argument is included to make the method function compatible with the generic. It will be assigned the value of \code{formula(object)} and should not be modified.} \item{data}{an optional data frame in which to evaluate the variables defined in \code{form}, in case \code{object} is not initialized and the covariate needs to be evaluated.} } \description{ This method function extracts the covariate(s) associated with \code{object}. } \value{ when the correlation structure does not include a grouping factor, the returned value will be a vector or a matrix with the covariate(s) associated with \code{object}. If a grouping factor is present, the returned value will be a list of vectors or matrices with the covariate(s) corresponding to each grouping level. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{getCovariate}}} \examples{ cs1 <- corAR1(form = ~ 1 | Subject) getCovariate(cs1, data = Orthodont) } \keyword{models} nlme/man/Variogram.corSpher.Rd0000644000176200001440000000373612222553014015767 0ustar liggesusers% File nlme/man/Variogram.corSpher.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Variogram.corSpher} \title{Calculate Semi-variogram for a corSpher Object} \usage{ \method{Variogram}{corSpher}(object, distance, sig2, length.out, \dots) } \alias{Variogram.corSpher} \arguments{ \item{object}{an object inheriting from class \code{"\link{corSpher}"}, representing an Spherical spatial correlation structure.} \item{distance}{an optional numeric vector with the distances at which the semi-variogram is to be calculated. Defaults to \code{NULL}, in which case a sequence of length \code{length.out} between the minimum and maximum values of \code{getCovariate(object)} is used.} \item{sig2}{an optional numeric value representing the process variance. Defaults to \code{1}.} \item{length.out}{an optional integer specifying the length of the sequence of distances to be used for calculating the semi-variogram, when \code{distance = NULL}. Defaults to \code{50}.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function calculates the semi-variogram values corresponding to the Spherical correlation model, using the estimated coefficients corresponding to \code{object}, at the distances defined by \code{distance}. } \value{ a data frame with columns \code{variog} and \code{dist} representing, respectively, the semi-variogram values and the corresponding distances. The returned value inherits from class \code{Variogram}. } \references{ Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{ \code{\link{corSpher}}, \code{\link{plot.Variogram}}, \code{\link{Variogram}} } \examples{ cs1 <- corSpher(15, form = ~ Time | Rat) cs1 <- Initialize(cs1, BodyWeight) Variogram(cs1)[1:10,] } \keyword{models} nlme/man/predict.lme.Rd0000644000176200001440000000623412627572005014470 0ustar liggesusers% File nlme/man/predict.lme.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{predict.lme} \title{Predictions from an lme Object} \usage{ \method{predict}{lme}(object, newdata, level = Q, asList = FALSE, na.action = na.fail, \dots) } \alias{predict.lme} \arguments{ \item{object}{an object inheriting from class \code{"\link{lme}"}, representing a fitted linear mixed-effects model.} \item{newdata}{an optional data frame to be used for obtaining the predictions. All variables used in the fixed and random effects models, as well as the grouping factors, must be present in the data frame. If missing, the fitted values are returned.} \item{level}{an optional integer vector giving the level(s) of grouping to be used in obtaining the predictions. Level values increase from outermost to innermost grouping, with level zero corresponding to the population predictions. Defaults to the highest or innermost level of grouping.} \item{asList}{an optional logical value. If \code{TRUE} and a single value is given in \code{level}, the returned object is a list with the predictions split by groups; else the returned value is either a vector or a data frame, according to the length of \code{level}. } \item{na.action}{a function that indicates what should happen when \code{newdata} contains \code{NA}s. The default action (\code{na.fail}) causes the function to print an error message and terminate if there are any incomplete observations.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ The predictions at level \eqn{i} are obtained by adding together the population predictions (based only on the fixed effects estimates) and the estimated contributions of the random effects to the predictions at grouping levels less or equal to \eqn{i}. The resulting values estimate the best linear unbiased predictions (BLUPs) at level \eqn{i}. If group values not included in the original grouping factors are present in \code{newdata}, the corresponding predictions will be set to \code{NA} for levels greater or equal to the level at which the unknown groups occur. } \value{ if a single level of grouping is specified in \code{level}, the returned value is either a list with the predictions split by groups (\code{asList = TRUE}) or a vector with the predictions (\code{asList = FALSE}); else, when multiple grouping levels are specified in \code{level}, the returned object is a data frame with columns given by the predictions at different levels and the grouping factors. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \seealso{\code{\link{lme}}, \code{\link{fitted.lme}}} \examples{ fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject) newOrth <- data.frame(Sex = c("Male","Male","Female","Female","Male","Male"), age = c(15, 20, 10, 12, 2, 4), Subject = c("M01","M01","F30","F30","M04","M04")) ## The 'Orthodont' data has *no* 'F30', so predict NA at level 1 : predict(fm1, newOrth, level = 0:1) } \keyword{models} nlme/man/gnlsControl.Rd0000644000176200001440000000664613054772245014600 0ustar liggesusers% File nlme/man/gnlsControl.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{gnlsControl} \alias{gnlsControl} \title{Control Values for gnls Fit} \usage{ gnlsControl(maxIter = 50, nlsMaxIter = 7, msMaxIter = 50, minScale = 0.001, tolerance = 1e-6, nlsTol = 0.001, msTol = 1e-7, returnObject = FALSE, msVerbose = FALSE, apVar = TRUE, .relStep =, opt = c("nlminb", "optim"), optimMethod = "BFGS", minAbsParApVar = 0.05, sigma = NULL) } \arguments{ \item{maxIter}{maximum number of iterations for the \code{gnls} optimization algorithm. Default is 50.} \item{nlsMaxIter}{maximum number of iterations for the \code{nls} optimization step \emph{inside} the \code{gnls} optimization. Default is 7.} \item{msMaxIter}{maximum number of iterations for the \code{ms} optimization step inside the \code{gnls} optimization. Default is 50.} \item{minScale}{minimum factor by which to shrink the default step size in an attempt to decrease the sum of squares in the \code{nls} step. Default 0.001.} \item{tolerance}{tolerance for the convergence criterion in the \code{gnls} algorithm. Default is 1e-6.} \item{nlsTol}{tolerance for the convergence criterion in \code{nls} step. Default is 1e-3.} \item{msTol}{tolerance for the convergence criterion of the first outer iteration when \code{optim} is used. Default is 1e-7.} \item{returnObject}{a logical value indicating whether the fitted object should be returned with a \code{\link{warning}} (instead of an error via \code{\link{stop}()}) when the maximum number of iterations is reached without convergence of the algorithm.} \item{msVerbose}{a logical value passed as the \code{trace} argument to the optimizer chosen by \code{opt}; see documentation on that. Default is \code{FALSE}.} \item{apVar}{a logical value indicating whether the approximate covariance matrix of the variance-covariance parameters should be calculated. Default is \code{TRUE}.} \item{.relStep}{relative step for numerical derivatives calculations. Default is \code{.Machine$double.eps^(1/3)} (about 6e-6).} \item{opt}{the optimizer to be used, either \code{"\link{nlminb}"} (the current default) or \code{"\link{optim}"} (the previous default).} \item{optimMethod}{character - the optimization method to be used with the \code{\link{optim}} optimizer. The default is \code{"BFGS"}. An alternative is \code{"L-BFGS-B"}.} \item{minAbsParApVar}{numeric value - minimum absolute parameter value in the approximate variance calculation. The default is \code{0.05}.} \item{sigma}{optionally a positive number to fix the residual error at. If \code{NULL}, as by default, or \code{0}, sigma is estimated.} } \description{ The values supplied in the function call replace the defaults and a list with all possible arguments is returned. The returned list is used as the \code{control} argument to the \code{gnls} function. } \value{ a list with components for each of the possible arguments. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}; the \code{sigma} option: Siem Heisterkamp and Bert van Willigen.} \seealso{\code{\link{gnls}}} \examples{ # decrease the maximum number iterations in the ms call and # request that information on the evolution of the ms iterations be printed gnlsControl(msMaxIter = 20, msVerbose = TRUE) } \keyword{models} nlme/man/fixed.effects.Rd0000644000176200001440000000173212222553014014763 0ustar liggesusers% File nlme/man/fixed.effects.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{fixed.effects} \title{Extract Fixed Effects} \usage{ fixed.effects(object, \dots) fixef(object, \dots) } \alias{fixed.effects} \alias{fixef} \arguments{ \item{object}{any fitted model object from which fixed effects estimates can be extracted.} \item{\dots}{some methods for this generic function require additional arguments.} } \description{ This function is generic; method functions can be written to handle specific classes of objects. Classes which already have methods for this function include \code{lmList} and \code{lme}. } \value{ will depend on the method function used; see the appropriate documentation. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \seealso{\code{\link{fixef.lmList}}} \examples{ ## see the method function documentation } \keyword{models} nlme/man/Oxboys.Rd0000644000176200001440000000217512222456762013547 0ustar liggesusers% File nlme/man/Oxboys.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Oxboys} \alias{Oxboys} \title{Heights of Boys in Oxford} \description{ The \code{Oxboys} data frame has 234 rows and 4 columns. } \format{ This data frame contains the following columns: \describe{ \item{Subject}{ an ordered factor giving a unique identifier for each boy in the experiment } \item{age}{ a numeric vector giving the standardized age (dimensionless) } \item{height}{ a numeric vector giving the height of the boy (cm) } \item{Occasion}{ an ordered factor - the result of converting \code{age} from a continuous variable to a count so these slightly unbalanced data can be analyzed as balanced. } } } \details{ These data are described in Goldstein (1987) as data on the height of a selection of boys from Oxford, England versus a standardized age. } \source{ Pinheiro, J. C. and Bates, D. M. (2000), \emph{Mixed-Effects Models in S and S-PLUS}, Springer, New York. (Appendix A.19) } %\examples{} \keyword{datasets} nlme/man/Names.pdMat.Rd0000644000176200001440000000310112222553014014345 0ustar liggesusers% File nlme/man/Names.pdMat.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{Names.pdMat} \title{Names of a pdMat Object} \usage{ \method{Names}{pdMat}(object, \dots) \method{Names}{pdMat}(object, \dots) <- value } \alias{Names.pdMat} \alias{Names<-.pdMat} \arguments{ \item{object}{an object inheriting from class \code{"\link{pdMat}"}, representing a positive-definite matrix.} \item{value}{a character vector with the replacement values for the column and row names of the matrix represented by \code{object}. It must have length equal to the dimension of the matrix represented by \code{object} and, if names have been previously assigned to \code{object}, it must correspond to a permutation of the original names.} \item{\dots}{some methods for this generic require additional arguments. None are used in this method.} } \description{ This method function returns the fist element of the \code{Dimnames} attribute of \code{object}, which contains the column names of the matrix represented by \code{object}. } \value{ if \code{object} has a \code{Dimnames} attribute then the first element of this attribute is returned; otherwise \code{NULL}. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \section{SIDE EFFECTS}{ On the left side of an assignment, sets the \code{Dimnames} attribute of \code{object} to \code{list(value, value)}. } \seealso{\code{\link{Names}}, \code{\link{Names.pdBlocked}}} \examples{ pd1 <- pdSymm(~age, data = Orthodont) Names(pd1) } \keyword{models} nlme/man/pdFactor.reStruct.Rd0000644000176200001440000000260512222553014015622 0ustar liggesusers% File nlme/man/pdFactor.reStruct.Rd % Part of the nlme package for R % Distributed under GPL 2 or later: see nlme/LICENCE.note \name{pdFactor.reStruct} \title{Extract Square-Root Factor from Components of an reStruct Object} \usage{ \method{pdFactor}{reStruct}(object) } \alias{pdFactor.reStruct} \arguments{ \item{object}{an object inheriting from class \code{"\link{reStruct}"}, representing a random effects structure and consisting of a list of \code{pdMat} objects.} } \description{ This method function extracts square-root factors of the positive-definite matrices corresponding to the \code{pdMat} elements of \code{object}. } \value{ a vector with square-root factors of the positive-definite matrices corresponding to the elements of \code{object} stacked column-wise. } \references{ Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. } \author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}} \note{ This function is used intensively in optimization algorithms and its value is returned as a vector for efficiency reasons. The \code{pdMatrix} function can be used to obtain square-root factors in matrix form. } \seealso{\code{\link{pdFactor}}, \code{\link{pdMatrix.reStruct}}, \code{\link{pdFactor.pdMat}}} \examples{ rs1 <- reStruct(pdSymm(diag(3), ~age+Sex, data = Orthodont)) pdFactor(rs1) } \keyword{models} nlme/TODO0000644000176200001440000000345013041567247011710 0ustar liggesusers -*- org -*- * Priority 1-2 (urgent - important) ** TODO REML <-> ML 'Std.Error's for fixed effecs in summary(n?lme()) are the *same* but should not, Both S+ nlme [note from Siem Heisterkamp] and e.g. lme4 do differ. ** DONE svn ci -m'patch from Siem Heisterkamp ['apVar' for "fixed sigma"] + changes to make intervals(.) working' *** svn-diffB R/gls.R R/gnls.R R/lme.R R/newFunc.R R/nlme.R man/glsControl.Rd man/gnlsControl.Rd man/gnlsObject.Rd man/intervals.lmList.Rd man/intervals.lme.Rd man/lmeControl.Rd man/lmeObject.Rd man/nlmeControl.Rd man/nlmeObject.Rd tests/sigma-fixed-etc.R ** DONE svn ci -m'fix qqnorm.lme() bug - undetected because of "wrong" \dontrun{}' *** svn-diffB R/lme.R man/qqnorm.lme.Rd * Priority 3-4 (project for ...) ** TODO stats::summary.lm , stats::print.summary.lm by default do *NOT* compute and print the correlation matrix. *** stats:::summary.lm (object, correlation = FALSE, symbolic.cor = FALSE, ...) *** stats:::print.summary.lm (x, digits = max(3L, getOption("digits") - 3L), symbolic.cor = x$symbolic.cor, signif.stars = getOption("show.signif.stars"), ...) *** 'nlme' should at least *allow* to not compute and print so people would use summary(.) much more often probably ! MM thinks the default should even *change* not to print the correlation ** TODO Bug 16703 -- corFactor/corMatrix use O(n^2) storage - sparseMatrix would help *** https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16703 ** TODO Bug 16806 - nlme getVarCov() fails for corSpatial fits for individuals with a single observation only *** https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16806 ** TODO methods extractAIC.lme & extractAIC.gls should be here rather than in MASS, because extractAIC() and step() are in stats * Priority 5 (nice to have) nlme/DESCRIPTION0000644000176200001440000000310213616760516012722 0ustar liggesusersPackage: nlme Version: 3.1-144 Date: 2020-02-02 Priority: recommended Title: Linear and Nonlinear Mixed Effects Models Authors@R: c(person("José", "Pinheiro", role = "aut", comment = "S version"), person("Douglas", "Bates", role = "aut", comment = "up to 2007"), person("Saikat", "DebRoy", role = "ctb", comment = "up to 2002"), person("Deepayan", "Sarkar", role = "ctb", comment = "up to 2005"), person("EISPACK authors", role = "ctb", comment = "src/rs.f"), person("Siem", "Heisterkamp", role = "ctb", comment = "Author fixed sigma"), person("Bert", "Van Willigen",role = "ctb", comment = "Programmer fixed sigma"), person("R-core", email = "R-core@R-project.org", role = c("aut", "cre"))) Description: Fit and compare Gaussian linear and nonlinear mixed-effects models. Depends: R (>= 3.4.0) Imports: graphics, stats, utils, lattice Suggests: Hmisc, MASS LazyData: yes ByteCompile: yes Encoding: UTF-8 License: GPL (>= 2) | file LICENCE BugReports: https://bugs.r-project.org URL: https://svn.r-project.org/R-packages/trunk/nlme NeedsCompilation: yes Packaged: 2020-02-02 15:05:16 UTC; hornik Author: José Pinheiro [aut] (S version), Douglas Bates [aut] (up to 2007), Saikat DebRoy [ctb] (up to 2002), Deepayan Sarkar [ctb] (up to 2005), EISPACK authors [ctb] (src/rs.f), Siem Heisterkamp [ctb] (Author fixed sigma), Bert Van Willigen [ctb] (Programmer fixed sigma), R-core [aut, cre] Maintainer: R-core Repository: CRAN Date/Publication: 2020-02-06 09:50:06 UTC nlme/tests/0000755000176200001440000000000013573672302012357 5ustar liggesusersnlme/tests/anova.gls.R0000644000176200001440000000376013222717070014371 0ustar liggesusers## Example of scoping problem. ## Originally from a report by Markus Jantti: ## https://stat.ethz.ch/pipermail/r-help/2005-November/081382.html library(nlme) data(Ovary) ## stolen from example(anova.gls) # AR(1) errors within each Mare ## tolerance increased for flang (was 6e-6) fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare)) (int1 <- intervals(fm1)) stopifnot( all.equal(int1$corStruct["Phi",], c(lower=0.66842829, est.=0.753207889, upper=0.81866619), tol = 1e-5)# 7e-6 needed for flan , all.equal(as.vector(int1$sigma), c(3.9747061, 4.61617157, 5.361161), tol = 1e-5) ) # variance changes with a power of the absolute fitted values? fm2 <- update(fm1, weights = varPower()) (a12 <- anova(fm1, fm2)) stopifnot(identical(a12, anova(fm1, fm2, type = "seq")))# latter had failed ## now define a little function dummy <- function(obj) anova(obj[[1]], obj[[2]]) (d12 <- dummy(list(fm1, fm2))) ## last failed < 3.1-66 rownames(d12) <- rownames(a12) stopifnot(all.equal(a12, d12, tol = 1e-15), all.equal(a12[2,"p-value"], 0.111752516, tol = 1e-5) ) ## PR#13567 fm1Orth.gls <- gls(distance ~ Sex * I(age - 11), Orthodont, correlation = corSymm(form = ~ 1 | Subject), weights = varIdent(form = ~ 1 | age)) (aOr <- anova(fm1Orth.gls, Terms = "Sex")) stopifnot(all.equal(aOr[,"F-value"], 9.4030752449, aOr[,"p-value"], 0.0027608643857)) ## anova.gls(.) -- REML & ML (a1 <- anova(fm1)) (a1m <- anova(fm1, type="marginal")) ## fm1M <- update(fm1, method = "ML") (a1M <- anova(fm1M)) (a1Mm <- anova(fm1M, type = "marginal")) stopifnot( all.equal(a1M[,"F-value"], c(378.774471, 19.1105834, 1.71334909), tolerance = 1e-7) , all.equal(summary(fm1M)$tTable[,"t-value"] ^ 2, as.matrix(a1Mm)[,"F-value"], tolerance = 1e-14) , all.equal(summary(fm1 )$tTable[,"t-value"] ^ 2, as.matrix(a1m )[,"F-value"], tolerance = 1e-14) ) nlme/tests/deviance.R0000644000176200001440000000231413041567247014261 0ustar liggesuserslibrary(nlme) ## ==> ~/R/Pkgs/MASS_CRAN/tests/lme.R : tests stepAIC() for *both* lme and gls library(MASS) ## deviance.lme() and extractAIC.lme() : set.seed(321) # to be sure a <- data.frame( resp=rnorm(250), cov1=rnorm(250), cov2=rnorm(250), group=rep(letters[1:10],25) ) mod1 <- lme(resp~cov1, a, ~cov1|group, method="ML") mod2 <- stepAIC(mod1, scope = list(upper=~(cov1+cov2)^2, lower=~1) ) stopifnot(all.equal(logLik(mod1), logLik(mod2)), all.equal( coef(mod1), coef(mod2)), all.equal(logLik(mod2), structure(-344.190316608, class = "logLik", nall = 250L, nobs = 250, df = 6))) ## deviance.gls() and extractAIC.gls() : data(beav2, package = "MASS") set.seed(123) beav <- beav2; beav$dummy <- rnorm(nrow(beav)) beav.gls <- gls(temp ~ activ + dummy, data = beav, corr = corAR1(0.8), method = "ML") stopifnot(all.equal(sigma(beav.gls), 0.2516395, tol = 1e-6), all.equal(coef(beav.gls), c("(Intercept)" = 37.191057, activ = 0.61602059, dummy =0.006842112))) st.beav <- stepAIC(beav.gls) stopifnot(all.equal(coef(st.beav), c("(Intercept)" = 37.1919453124, "activ" = 0.614177660082)), all.equal(sigma(st.beav), 0.2527856, tol = 1e-6)) nlme/tests/lme.R0000644000176200001440000001056113422625274013261 0ustar liggesuserslibrary(nlme) options(digits = 6)# <==> less platform dependency in print() output if(!dev.interactive(orNone=TRUE)) pdf("test_lme.pdf") fm1 <- lmList(Oxboys) fm1 fm2 <- lme(fm1) fm2 vc2 <- VarCorr(fm2) stopifnot( all.equal(fixef(fm2), c("(Intercept)" = 149.371753, age = 6.52546866), tol=1e-8), all.equal(as.numeric(vc2[,"StdDev"]), c(8.081077, 1.680717, 0.659889), tol=4e-7)) # bug report from Arne.Mueller@sanofi-aventis.com mod <- distance ~ age + Sex fm3 <- lme(mod, Orthodont, random = ~ 1) pm3 <- predict(fm3, Orthodont) stopifnot(all.equal(mean(pm3), 24.023148148), all.equal( sd(pm3), 2.4802195115), all.equal(quantile(pm3), c("0%" = 17.0817792, "25%" = 22.3481813, "50%" = 23.9271016, "75%" = 25.5740014, "100%"= 30.8662241))) ## bug report and fix from Dimitris Rizopoulos and Spencer Graves: ## when 'returnObject = TRUE', do not stop() but give warning() on non-convergence: tools::assertWarning( fm1 <- lme(distance ~ age, data = Orthodont, control = lmeControl(msMaxIter = 1, returnObject = TRUE)) ) ## "typo" in 'random=' -- giving 27-dim. vector random effect: ## PR#17524 B.Tyner: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17524 try(lme(distance ~ 1, data=Orthodont, random = ~ Subject)) tools::assertError(lme(distance ~ age, data=Orthodont, random = ~ Subject)) ## seg.faults in nlme <= 3.1-137 (2018) because of integer overflow ## The previous warning is now an *error* (unless new lmeControl(allow.n.lt.q=TRUE)) ## based on bug report on R-help (p3.1 <- predict(fm3, Orthodont[1,])) # failed in 3.1-88 stopifnot(all.equal(pm3[1], p3.1, check.attributes=FALSE, tolerance = 1e-14)) ## Intervals failed in a patch proposal (Nov.2015): (fm4 <- lme(distance ~ age, Orthodont, random = ~ age | Subject)) i4 <- intervals(fm4) ## from dput(signif(i4$reStruct$Subject, 8)) ## R-devel 2016-01-11; 64-bit : reSS <- data.frame(lower = c(0.9485605, 0.10250901, -0.93825047), est. = c(2.3270341, 0.22642779, -0.60933286), upper = c(5.7087424, 0.50014674, 0.29816857)) ## R-devel 2016-01-11; 32-bit : ## reSS <- data.frame(lower = c(0.94962127,0.10262181, -0.93804767), ## est. = c(2.3270339, 0.22642779, -0.60933284), ## upper = c(5.7023648, 0.49959695, 0.29662651)) rownames(reSS) <- rownames(i4$reStruct$Subject) sm4 <- summary(fm4) stopifnot( all.equal(fixef(fm4), c("(Intercept)" = 16.761111, age = 0.66018519)), identical(fixef(fm4), sm4$tTable[,"Value"]), all.equal(sm4$tTable[,"Std.Error"], c("(Intercept)" = 0.77524603, age = 0.071253264), tol=6e-8), all.equal(i4$reStruct$Subject[,"est."], reSS[,"est."], tol= 1e-7) ## (lower, upper) cannot be very accurate for these : ==> tol = *e-4 ,## "interestingly" 32-bit values changed from 3.2.3 to R-devel(3.3.0): all.equal(i4$reStruct$Subject[,c(1,3)], reSS[,c(1,3)], tol = .005) , all.equal(as.vector(i4$sigma), ## lower est. upper c(1.0849772, 1.3100397, 1.5817881), tol=8e-4) , all.equal(as.vector(i4$fixed), as.vector(rbind(c(15.218322, 16.761111, 18.3039), c(0.51838667, 0.66018519, 0.8019837))), tol = 1e-6) ) ## wrong results from getData: ss2 <- readRDS("ss2.rds") m1 <- lme(PV1MATH ~ ESCS + Age +time , random = ~ time|SCHOOLID, data = ss2, weights = varIdent(form=~1|time), corr = corCompSymm(form=~1|SCHOOLID/StIDStd), na.action = na.omit) plot(m1, resid(.) ~ WEALTH) m2 <- lme(PV1MATH ~ ESCS + Age +time , random = ~ time|SCHOOLID, data = ss2, weights = varIdent(form=~1|time), corr = corCompSymm(form=~1|SCHOOLID/StIDStd), na.action = na.omit) plot(m2, resid(.) ~ WEALTH) ## Variogram() failing in the case of 1-observation groups (PR#17192): BW <- subset(BodyWeight, ! (Rat=="1" & Time > 1)) if(interactive()) print( xtabs(~ Rat + Time, data = BW) )# Rat '1' only at Time == 1 fm2 <- lme(fixed = weight ~ Time * Diet, random = ~ 1 | Rat, data = BW) Vfm2 <- Variogram(fm2, form = ~ Time | Rat) stopifnot(is.data.frame(Vfm2), identical(dim(Vfm2), c(19L, 3L)), all.equal(unlist(Vfm2[10,]), c(variog = 1.08575384191148, dist = 22, n.pairs = 15)) ) ## failed in nlme from 3.1-122 till 3.1-128 nlme/tests/updateLme.R0000644000176200001440000000341012710164373014414 0ustar liggesuserslibrary(nlme) ## Example 1 --- was ./update.R --- data(petrol, package = 'MASS') Petrol <- petrol Petrol[, 2:5] <- scale(Petrol[, 2:5], scale = FALSE) pet3.lme <- lme(Y ~ SG + VP + V10 + EP, random = ~ 1 | No, data = Petrol, method="ML") upet3 <- update(pet3.lme, Y ~ SG + VP + V10) upet3 vc3 <- VarCorr(upet3) upet2 <- lme(Y ~ SG + VP + V10, random = ~ 1 | No, data = Petrol, method = "ML") stopifnot( all.equal(upet3, upet2, tol = 1e-15) , all.equal(fixef(upet3), c("(Intercept)" = 19.659375, SG = 0.125045632, VP = 2.27818601, V10 = 0.0672413592), tol = 1e-8)# 1e-9 , all.equal(as.numeric(vc3[,"StdDev"]), c(0.00029397, 9.69657845), tol=1e-6) ) ## Example 2 --- data(Assay) as1 <- lme(logDens~sample*dilut, data=Assay, random=pdBlocked(list( pdIdent(~1), pdIdent(~sample-1), pdIdent(~dilut-1)))) as1s <- update(as1, random=pdCompSymm(~sample-1)) (an.1s <- anova(as1, as1s)) # non significant stopifnot( all.equal(drop(data.matrix(an.1s[2,-1])), c(Model = 2, df = 33, AIC = -10.958851, BIC = 35.280663, logLik = 38.479425, Test = 2, L.Ratio = 0.11370211, `p-value` = 0.73596807), tol=8e-8)) as1S <- update(as1, . ~ sample+dilut) # dropping FE interaction tools::assertWarning(anova(as1, as1S))# REML not ok for different FE. as1M <- update(as1, method = "ML") as1SM <- update(as1S, method = "ML") (anM <- anova(as1M, as1SM)) # anova() OK: comparing MLE fits ## ==> significant: P ~= 0.0054 stopifnot( all.equal(drop(data.matrix(anM[2,])[,-(1:2)]), c(df = 14, AIC = -169.588248, BIC = -140.267424, logLik = 98.7941241, Test = 2, L.Ratio = 39.7345188, `p-value` = 0.0053958561), tol = 8e-8) ) nlme/tests/deparse.R0000644000176200001440000002044713241753016014126 0ustar liggesusers## Tests to make sure that the deparse(as.vector(x)) construction is not ## tripping us up again. library(nlme) options(digits = 7) data(Loblolly) fm1 <- nlme(height ~ SSasymp(age, Asym, R0, lrc), data = Loblolly, fixed = Asym + R0 + lrc ~ 1, random = Asym ~ 1, start = c(Asym = 103, R0 = -8.5, lrc = -3.3)) fm1 vcV <- VarCorr(fm1)[,"Variance"] stopifnot( all.equal(fixef(fm1), c(Asym = 101.4496, R0 = -8.6273307, lrc = -3.2337507)) , all.equal(as.numeric(vcV), c(13.3271856, 0.5167634), tol = 1e-6) ) model <- height ~ SSasymp(age, Asym, R0, lrc) fixed <- Asym + R0 + lrc ~ 1 random <- Asym ~ 1 start <- c(Asym = 103, R0 = -8.5, lrc = -3.3) fm2 <- nlme(model, data = Loblolly, fixed = fixed, random = random, start = start) fm2 ## equal apart from 'call' : fm2$call <- fm1$call ## BUT with macOS's Accelerate: ## Component "apVar": Mean relative difference: 7.07812e-05 stopifnot(all.equal(fm1, fm2, tolerance = 1e-15)) ## deparse can give multiple lines ## example from https://stat.ethz.ch/pipermail/r-help/2006-February/086648.html "mydata2" <- structure(list(Tps = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 14, 14, 14, 14, 14, 17, 17, 17, 17, 17, 20, 20, 20, 20, 25, 28, 29, 50, 50, 50, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 14, 14, 14, 14, 14, 17, 17, 17, 17, 17, 20, 20, 20, 20, 25, 28, 29, 50, 50, 50, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 14, 14, 14, 14, 14, 17, 17, 17, 17, 17, 20, 20, 20, 20, 25, 28, 29, 50, 50, 50, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136), Conc = c(0, 0, 0, 0, 0, 0, 0, 0.807852503274902, 0.204371494701886, 0.579222129993907, 0.989062273721619, 0, 1.11728297897571, 1.41057428121324, 0.888883702851307, 1.259907624008, 1.45753269675829, 1.07077516747401, 0.843279379, 0, 0.763110069196737, 1.11297791434297, 1.10087763997637, 0.946929594501016, 1.33112168, 0.654041755, 0.694167499, 1.289548703, 1.117139864, 0.807196192, 0.720221376552025, 0.560082823, 0.476583438, 2.590855204, 0.51510972, 1.072946887, 0.537999938614396, 0.886684225905255, 0.630178116793598, 1.31534758842196, 1.33333958571746, 0.922032210748255, 0.429930193046174, 1.35881467717335, 0.790045927902363, 1.22484702570724, 0.808104508207897, 1.31185966817903, 1.51837686425553, 1.74105163638734, 1.80365598487402, 1.13240352674377, 1.50086243061644, 2.06355364280445, 0.439350890906039, 1.54692793444949, 1.78758216051046, 1.09043400023239, 0.811328376840514, 0.459192443530981, 0.695333473157298, 0.387995007681174, 0.784627063444921, 1.02282256375842, 0.382687104107726, 0.554290634950242, 0.130420456296453, 0.324194753224919, 0.31106140274139, 0.513473505828888, 0.878620320248701, 1.18404358659996, 0.136926837896477, 0, 0, 0.835588760032974, 0.558617235576616, 1.21002805866839, 0.769381068031404, 1.04514254228094, 0.373251847173678, 0.389005898972802, 0.183141006154896, 0.223596336820146, 0.315526423315647, 0.0930349732768131, 0.169959185212759, 0.161878841748425, 0, 0.0483041009105874, 0, 0, 0, 0.0777005553478052, 0, 0.153175826795441, 0.0428171049833677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26.564295705327, 5.5893744508169, 7.22612934071834, 36.6563989567777, 0, 28.8967184437329, 28.4030370337251, 28.0886043901352, 26.1230935842208, 28.8895673910072, 42.6814210131968, 32.3555695551062, 0.76883326657205, 34.6159136622156, 38.329242204291, 56.4476583636484, 26.6249506083603, 31.3001451026823, 23.7339071829084, 23.3702284599355, 36.669903715038, 44.7377244306005, 31.2079335923023, 32.8613384312272, 29.4259634309146, 45.6112405959009, 48.1231689836687, 55.0037961570027, 32.9822316456421, 20.0382768189682, 26.0986380308655, 28.8915584506145, 28.7949023823068, 30.0278417498425, 58.8089779973569, 20.3602570111197, 29.6269605259023, 28.4404986724604, 30.2165182590977, 19.9204461889074, 31.1019196559556, 30.3847467747055, 36.8726911479995, 51.0618036275519, 23.5408013442579, 36.6948355347593, 27.4753860809429, 24.1341667099646, 27.5411488989643, 35.9021799354022, 19.7417897046158, 31.1403887303244, 46.1743622734049, 34.8235854891765, 22.1714704189293, 33.6805966894274, 35.2814908686112, 42.9767437212852, 38.1264997164547, 5.3651357974451, 42.8990434918385, 25.4908883698364, 25.99649502, 36.4958105490917, 40.8004126550705, 5.36867162116895, 0.00898476265269363, 0, 27.6810997945798, 28.7918300045713, 45.7577183830352, 35.9276318604787, 34.9717618087238, 29.620354272564, 24.6537513599869, 13.5363982464958, 25.8289073574818, 12.0090406245759, 4.753436805, 11.849214652228, 8.41410147611612, 0, 1.80855352862552, 1.1987530031681, 1.01148025243171, 0.495675369574172, 1.62701127228732, 0, 16.6288242287241, 1.23656061354912, 0.323708776035328, 0, 0.566916625204436, 0, 0, 0, 0, 0, 0, 0, 2.53578781871283, 3.50083667130797, 0, 0.98049572179098, 0, 3.57129673217304, 2.77298867949388, 2.12302645642669, 4.11923869203499, 4.69069462193674, 2.8698666062651, 2.05079837323067, 0.0602771574448942, 5.96454350250626, 2.26267114439802, 3.06911285674854, 2.04233129537404, 2.62181873844029, 1.51813653072598, 1.46193772981073, 2.69864635755833, 3.44016493913122, 2.50834832469627, 3.48170744166168, 1.00637581555435, 1.67065398473081, 4.18855363095027, 3.39649762611015, 1.72804613460423, 1.40053679329531, 2.37032387724109, 3.19332545080983, 2.49474373894248, 2.17800931288708, 2.7601484443213, 0.91266104095844, 1.93485048639199, 1.19692593420788, 1.79537330666258, 2.14020930767983, 3.0122526724942, 2.81112226980754, 3.54890724398174, 3.01022926452999, 2.38263226710738, 3.53569238341869, 3.47869329713911, 0.679333339820719, 2.4764260756438, 3.82615100065366, 2.20449890383871, 1.371303113329, 1.2427787019995, 1.73319133880954, 0.391268883238408, 1.73610193837913, 2.68494324646718, 1.77065393606844, 1.45079980147062, 0.763775702906329, 0.98566725668627, 0.37838763208699, 0.841811919286804, 1.46436462204795, 1.98409602726, 0.507005887891038, 0.465515668274195, 0, 1.873365675227, 1.69023864630648, 2.65530855919137, 2.34392199908302, 1.61917643594837, 1.05165934333345, 0.564642823436471, 0.121621029620328, 0.515007625737071, 0.524345809084086, 0.130898614090571, 0.332427740242623, 0.110214989555118, 0, 0.128642193589, 0.119407067173878, 0.128926224027295, 0.0622331866694357, 0.215645168287442, 0, 0.859343941945178, 0.0500810300696456, 0, 0, 0.0628746592609754), Organ = structure(rep(c(1L,3L,2L), each=100), .Label = c("Carc", "TD", "Foie"), class = c("ordered", "factor"))), row.names = as.character(1:300), class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), formula = quote(Conc ~ Tps | Organ), FUN = function (x) max(x, na.rm = TRUE), order.groups = TRUE) mydata2$Dose <- 100 mymod3 <- nlsList(Conc+1 ~ Dose * exp(lKe+lKa-lCl) * (exp(-exp(lKe)*Tps)-exp(-exp(lKa)*Tps)) /(exp(lKa)-exp(lKe)) | Organ, data=mydata2, start= c(lKe=-2.77, lKa=-1.41, lCl=-1.13)) mymod3 (sm3 <- summary(mymod3)) stopifnot( all.equal(coef(sm3), array(c(-5.0742843, -3.0284227, -2.9006161, 2.9998357, 1.7851301, 0.26206915, -1.6915208, -1.6964717, -11.068132, 4.263934e-43, 1.4546246e-17, 4.9468128e-09, -0.18001926, -0.67150218, -1.3685062, 2.9213761, 1.6846644, 0.22295774, -0.061621391, -0.39859699, -6.1379624, 0.37741845, 0.015884023, 0.0005718832, -1.1485352, 0.086542979, -2.2452234, 2.769282, 1.177223, 0.13378181, -0.41474113, 0.073514514, -16.782726, 3.9250025e-08, 0.65176229, 4.8777767e-16), dim = c(3L, 4L, 3L), dimnames = list(c("Carc", "TD", "Foie"), c("Estimate", "Std. Error", "t value", "Pr(>|t|)"), c("lKe", "lKa", "lCl"))), tolerance = 1e-7) ) nlme/tests/coef.Rout.save0000644000176200001440000000501513207270767015107 0ustar liggesusers R Under development (unstable) (2017-11-28 r73785) -- "Unsuffered Consequences" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin17.2.0 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## tests of fix for PR#9831 > library(nlme) > val <- c("10"=1.10,"14"=1.14) > vf <- varIdent(value=val, form=~1|age, fixed=c("12"=1.12)) > vfi <- Initialize(vf,Orthodont) > vfi Variance function structure of class varIdent representing 8 10 14 12 1.00 1.10 1.14 1.12 > str(vfi) 'varIdent' Named num [1:2] 0.0953 0.131 - attr(*, "names")= chr [1:2] "10" "14" - attr(*, "groupNames")= chr [1:4] "8" "10" "14" "12" - attr(*, "fixed")= Named num 0.113 ..- attr(*, "names")= chr "12" - attr(*, "formula")=Class 'formula' language ~1 | age .. ..- attr(*, ".Environment")= - attr(*, "groups")= chr [1:108] "8" "10" "12" "14" ... - attr(*, "whichFix")= logi [1:3] FALSE FALSE TRUE - attr(*, "weights")= Named num [1:108] 1 0.909 0.893 0.877 1 ... ..- attr(*, "names")= chr [1:108] "8" "10" "12" "14" ... - attr(*, "logLik")= num -9.17 > stopifnot( + all.equal(coef(vfi), c(0.0953101798043, 0.131028262406)), + all.equal(coef(vfi, unconstrained = FALSE, allCoef = TRUE), + c("8" = 1, "10" = 1.1, "14" = 1.14, "12" = 1.12))) > > vfiCopy <- vfi # copy of an initialized object > length(vfiCopy) # length is 2 [1] 2 > coef(vfiCopy) <- c(11,12) # error in 3.1-84 > stopifnot(identical(coef(vfiCopy), c(11,12))) > > ## error in 3.1-84 > (gls. <- gls(distance ~ age, weights = vfi, data=Orthodont)) Generalized least squares fit by REML Model: distance ~ age Data: Orthodont Log-restricted-likelihood: -253.4207 Coefficients: (Intercept) age 16.746600 0.659796 Variance function: Structure: Different standard deviations per stratum Formula: ~1 | age Parameter estimates: 8 10 14 12 1.000000 0.872009 1.121849 1.120000 Degrees of freedom: 108 total; 106 residual Residual standard error: 2.453257 > > proc.time() user system elapsed 0.246 0.040 0.272 nlme/tests/nlme2.R0000644000176200001440000001517213517067576013536 0ustar liggesuserslibrary(nlme) is64bit <- .Machine$sizeof.pointer == 8 options(digits = 10)# <- see more, as we have *no* *.Rout.save file here ## https://stat.ethz.ch/pipermail/r-help/2014-September/422123.html nfm <- nlme(circumference ~ SSlogis(age, Asym, xmid, scal), data = Orange, fixed = Asym + xmid + scal ~ 1) (sO <- summary(nfm)) vc <- VarCorr(nfm, rdig = 5)# def. 3 storage.mode(vc) <- "double" # -> (correct) NA warning cfO <- sO$tTable if(FALSE) dput(signif(cfO[,c("Std.Error", "t-value")], 8)) if(FALSE) dput(signif(as.numeric(vc[,"StdDev"]), 8)) cfO.Ts <- list( stdE.T = cbind( b64nx = ## R-devel 2016-01-11, 2017-09-18; [lynne]: c(14.052671, 34.587947, 30.497593, 13.669776, 21.036087, 11.692943) , b32nx = ## R-devel 2016-01-11, 2017-09-18 [florence, Fedora 24 Linux]: c(14.053663, 34.589821, 30.49412, 13.668653, 21.034544, 11.693889) , b32Win1 = ## R-devel 2017-09-17, i386-w64-mingw32/i386, ## Windows Server 2008 R2 x64 (build 7601) Service Pack 1 c(14.053047, 34.588589, 30.4963, 13.669349, 21.035542, 11.693282) , b32Win = ## R-devel 2017-09-18, Tomas K (Win.10) c(14.051902, 34.579819, 30.499807, 13.670797, 21.041722, 11.692694) ), stdDev = cbind( b64nx = ## R-devel 2016-01-11; [lynne]: c(27.051312, 24.258159, 36.597078, 7.321525) , b32nx = ## R-devel 2017-09-18; [florence, Fedora 24 Linux]: c(27.053964, 24.275286, 36.58682, 7.3213653) , b32Win = ## R-devel 2017-09-17, i386-w64-mingw32/i386, W.Server 2008 R2.. c(27.05234, 24.264936, 36.593554, 7.3214448) ## for now ) ) ## Average number of decimal digits agreement : lapply(cfO.Ts, function(cc) round(-log10(apply(cc - rowMeans(cc), 1, sd)), 2)) ## $ stdE.T: num [1:6] 3.13 2.34 2.62 3.05 2.49 3.29 ## $ stdDev: num [1:4] 2.87 2.06 2.28 4.1 ## Pairwise distances (formatted, easier to read off): round(dist(1000 * t(cfO.Ts[["stdE.T"]])), 1) ## b64nx b32nx b32Win1 ## b32nx 4.6 ## b32Win1 1.7 2.9 ## b32Win 10.2 13.9 11.5 round(dist(1000 * t(cfO.Ts[["stdDev"]])), 1) ## b64nx b32nx ## b32nx 20.1 ## b32Win 7.7 12.5 cName <- (if(is64bit) "b64nx" else if(.Platform$OS.type == "Windows") { if(grepl("Server 2008 R2", win.version(), fixed=TRUE)) "b32Win1" else "b32Win" } else "b32nx" ## 32-bit, non-Windows ) cfO.T <- array(cfO.Ts[["stdE.T"]][, cName], dim = 3:2, dimnames = list(c("Asym", "xmid", "scal"), c("Std.Error", "t-value"))) vcSD <- setNames(cfO.Ts[["stdDev"]][, switch(cName, b64nx=, b32nx=, b32Win=cName, b32Win1 = "b32Win")], c("Asym", "xmid", "scal", "Residual")) stopifnot( identical(cfO[,"Value"], fixef(nfm)), all.equal(cfO[,c("Std.Error", "t-value")], cfO.T, tol = 3e-4) , cfO[,"DF"] == 28, all.equal(vc[,"Variance"], vc[,"StdDev"]^2, tol= 5e-7) , all.equal(vc[,"StdDev"], vcSD, tol = 6e-4) # 3.5e-4 (R 3.0.3, 32b) , all.equal(unname(vc[2:3, 3:4]), # "Corr" rbind(c(-0.3273, NA), c(-0.9920, 0.4430)), tol = 2e-3)# ~ 2e-4 / 8e-4 ) ## Confirm predict(*, newdata=.) works (n <- nrow(Orange)) # 35 set.seed(17) newOr <- within(Orange[sample(n, 64, replace=TRUE), ], age <- round(jitter(age, amount = 50))) fit.v <- predict(nfm, newdata = newOr) resiv <- newOr$circumference - fit.v res.T <- c(48, 115, 74, 15, 44, -94, 47, -51, 20, -52, -16, 12, -135, -85, 136, 100, 24, 181, -88, -102, -26, 52, -148, 8, -83, 73, -27, -34, 91, 42, 34, -8, 0, 83, 84, -90, -123, 94, -157, -11, 56, -164, -28, 72, 15, 148, 95, -122, 169, 84, -19, -124, 45, -66, -10, 119, -110, -43, 12, 94, -108, 45, 48, 46) if(!all((res10 <- round(10 * as.vector(resiv))) == res.T)) { iD <- which(res10 != res.T) cat("Differing rounded residuals, at indices", paste(iD, collapse=", "), "; with values:\n") print(cbind(resiv, res10, res.T)[iD,]) } ## -> indices 14 [64-bit] or 27 [32-bit], respectively ## [Bug 16715] New: nlme: unable to use predict and augPredict .. ## Date: 17 Feb 2016 -- part 2 -- predict(): ## ## Comment 4 daveauty@gmail.com 2016-03-08 -- modified by MM -- ## simulate density data then fit Michaelis-Menten equation of density as ## function of ring age. TreeIDs grouped by SP (spacing) set.seed(1) df <- data.frame(SP = rep(LETTERS[1:5], 60), expand.grid(TreeID = factor(1:12), age = seq(2, 50, 2)), stringsAsFactors = TRUE) df[,"dens"] <- with(df, (runif(1,10,20)*age)/(runif(1,9,10)+age)) + rnorm(25, 0, 1) str(df) ## 'data.frame': 300 obs. of 4 variables: ## $ SP : Factor w/ 5 levels "A","B","C","D",..: 1 2 3 4 5 1 2 3 4 5 ... ## $ TreeID: Factor w/ 12 levels "1","2","3","4",..: 1 2 3 4 5 6 7 8 9 10 ... ## $ age : num 2 2 2 2 2 2 2 2 2 2 ... ## $ dens : num 2.41 1.39 3.82 2.56 1.41 ... ## mixed-effects model fit1 <- nlme(dens ~ a*age/(b+age), fixed = a+b ~ 1, random= a ~ 1|TreeID, start = c(a=15, b=5), data=df) summary(fit1) fit1R <- update(fit1, method = "REML") ## allow fixed effects parameters to vary by 'SP': fit2 <- update(fit1, fixed = list(a ~ SP, b ~ SP), start = c(a = rep(14, 5), b = rep(4, 5))) summary(fit2) ## make new data for predictions newdat <- expand.grid(SP = LETTERS[1:5], age = seq(1, 50, 1)) n.pred1 <- predict(fit1, newdat, level=0) # works fine n.pred2 <- predict(fit2, newdat, level=0) ## in nlme 3.1-124, throws the error: ## Error in eval(expr, envir, enclos) : object 'SP' not found ## New data with never-yet observed levels of a random effect -- PR#16614 : set.seed(47) newD <- expand.grid(SP = LETTERS[2:4], age = runif(16, 1,50), TreeID = sample(c(sample(1:12, 7), 100:102))) n1prD0 <- predict(fit1, newD, level=0) n2prD0 <- predict(fit2, newD, level=0) n1prD1 <- predict(fit1, newD, level=1) # failed in nlme <= 3.1-126 n2prD1 <- predict(fit2, newD, level=1) # ditto (n1prD01 <- predict(fit1, newD, level=0:1))# " (n2prD01 <- predict(fit2, newD, level=0:1))# " ## consistency : stopifnot( identical(is.na(n1prD1), is.na(n2prD1)), identical(sort(unique(newD[is.na(n2prD1), "TreeID"])), 100:102), sort(unique( newD[is.na(n2prD1), "TreeID"] )) %in% 100:102 , all.equal(as.vector(n1prD0), n1prD01[,"predict.fixed"], tolerance= 1e-15), all.equal(as.vector(n2prD0), n2prD01[,"predict.fixed"], tolerance= 1e-15), all.equal(as.vector(n1prD1), n1prD01[,"predict.TreeID"],tolerance= 1e-15), all.equal(as.vector(n2prD1), n2prD01[,"predict.TreeID"],tolerance= 1e-15)) nlme/tests/gnls-ch8.R0000644000176200001440000000340513337716345014133 0ustar liggesusers## Really just one section from ../inst/scripts/ch08.R : library(nlme) (fm1Lis <- nlsList(rate ~ SSasympOff(pressure, Asym, lrc, c0) | QB, data = Dialyzer)) (iLis <- intervals(fm1Lis)) ## TODO: stopifnot(all.equal(..)) ? fm1Dial.gnls <- gnls(rate ~ SSasympOff(pressure, Asym, lrc, c0), data = Dialyzer, params = list(Asym + lrc ~ QB, c0 ~ 1), start = c(53.6, 8.6, 0.51, -0.26, 0.225)) summary(fm1Dial.gnls) ## Modified Data (==> rename it !) ---------------------------------- DialyzerM <- Dialyzer DialyzerM$QBcontr <- 2 * (Dialyzer$QB == 300) - 1 fm1Dial.nls <- nls(rate ~ SSasympOff(pressure, Asym.Int + Asym.QB * QBcontr, lrc.Int + lrc.QB * QBcontr, c0), data = DialyzerM, start = c(Asym.Int = 53.6, Asym.QB = 8.6, lrc.Int = 0.51, lrc.QB = -0.26, c0 = 0.225)) summary(fm1Dial.nls) logLik(fm1Dial.nls) plot(fm1Dial.gnls, resid(.) ~ pressure, abline = 0) fm2Dial.gnls <- update(fm1Dial.gnls, weights = varPower(form = ~ pressure)) anova(fm1Dial.gnls, fm2Dial.gnls) ACF(fm2Dial.gnls, form = ~ 1 | Subject) plot(ACF(fm2Dial.gnls, form = ~ 1 | Subject), alpha = 0.05) fm3Dial.gnls <- update(fm2Dial.gnls, corr = corAR1(0.716, form = ~ 1 | Subject)) fm3Dial.gnls (im3 <- intervals(fm3Dial.gnls)) (a23 <- anova(fm2Dial.gnls, fm3Dial.gnls)) anoC <- cbind(fm2Dial.gnls = c(df=7, AIC= 748.4749, BIC= 769.0664, logLik=-367.2375, L.Ratio=NA, "p-value"=NA), fm3Dial.gnls= c(8, 661.0424, 684.5756, -322.5212, 89.4325, 3.e-21)) # NB: exact p-value irrelevant stopifnot( all.equal(anoC, t(data.matrix(a23)[,rownames(anoC)]), tol = 7e-7) ) nlme/tests/data.frame.R0000644000176200001440000000102413336503465014501 0ustar liggesusersstopifnot(!any("package:nlme" == search())) # nlme *not* attached ll <- LETTERS[1:10] subs <- rep(ll, rep(3,10)) set.seed(101)# make reproducible resp <- rnorm(30) ## 'nlme' not in search() : (gd <- nlme::groupedData(resp ~ 1|subs)) ## failed in nlme < 3.1-129 (or previous to 2017-01-17) stopifnot(inherits(gd, "groupedData"), identical(dim(gd), c(30L, 2L)), inherits(gs <- gd[,"subs"], "ordered"), identical(sort(levels(gs)), ll), identical(sort.list(levels(gs)), c(5L, 9L, 8L, 4L, 10L, 2L, 1L, 6L, 7L, 3L))) nlme/tests/nlme.R0000644000176200001440000000365313560216032013432 0ustar liggesuserslibrary(nlme) fm1 <- nlsList(SSasymp, Loblolly) fm1 system.time(cnL1 <- confint(fm1)) # 0.48 sec stopifnot( all.equal(as.matrix(coef(fm1)), array(c(94.1282, 94.9406, 89.8849, 110.699, 111.003, 109.986, 101.056, 127.134, 101.087, 95.6669, 95.5563, 113.514, 105.718, 99.1719, -8.25075, -7.75749, -8.75902, -8.16943, -8.46261, -8.55854, -8.44363, -7.67936, -8.50234, -9.07824, -9.66503, -7.59562, -8.90608, -9.91665, -3.21758, -3.22932, -3.08622, -3.39034, -3.39757, -3.36252, -3.23282, -3.57533, -3.21402, -3.11638, -3.09227, -3.35282, -3.22296, -3.08484), dim = c(14L, 3L), dimnames = list(c("329", "327", "325", "307", "331", "311", "315", "321", "319", "301", "323", "309", "303", "305"), c("Asym", "R0", "lrc"))), tol = 1e-5) , all.equal(pooledSD(fm1), structure(0.70039649, df = 42), tol = 1e-5) , 84 == sum(vapply(lapply(fm1, fitted), length, 1L)) # total deg.freedom , ## confint() : is.list(cnL1), identical(names(cnL1), names(fm1)), vapply(cnL1, is.matrix, NA), vapply(cnL1, dim, c(NA,0L)) == 3:2, identical(unname(sapply(cnL1, dim)), matrix(3:2, 2, length(fm1))), sapply(cnL1, is.finite) ) fm2 <- nlme(fm1, random = Asym ~ 1) fm2 stopifnot( all.equal(fixef(fm2), c(Asym = 101.4483, R0 = -8.6274937, lrc = -3.2337304), tol = 4e-7) , all.equal(logLik(fm2), structure(-114.743, class = "logLik", nall = 84, nobs = 84, df = 5), tol = 4e-6) , all.equal(sigma(fm2), 0.71886244, tol = 1e-6) ) pm2.0 <- predict(fm2, Loblolly, level=0)## failed in nlme 3.1-123 stopifnot(all.equal(head(pm2.0), c(3.64694, 11.0597, 27.2258, 40.5006, 51.4012, 60.3522), tol = 1e-5)) # 4e-7 {64b nb-mm4} nlme/tests/missing.R0000644000176200001440000000132412627572005014151 0ustar liggesuserslibrary(nlme) op <- options(digits = 3) # reduce rounding differences Ovary[c(1,272), 2] <- NA fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, correlation = corAR1(form = ~ 1 | Mare), na.action=na.exclude) fitted(fm1) residuals(fm1) summary(fm1) Orthodont[100:102, 2] <- NA fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1, na.action=na.exclude) fitted(fm2, 0:1) fitted(fm2) residuals(fm2, 0:1) round(residuals(fm2), 2) summary(fm2) Soybean[1:5, "Time"] <- NA fm3 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal), Soybean, weights = varPower(), na.action=na.exclude) fitted(fm3) residuals(fm3) summary(fm3) options(op)# revert when this file is source()d nlme/tests/lme.Rout.save0000644000176200001440000001613313422625274014747 0ustar liggesusers R version 3.5.2 Patched (2019-01-14 r75994) -- "Eggshell Igloo" Copyright (C) 2019 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(nlme) > > options(digits = 6)# <==> less platform dependency in print() output > if(!dev.interactive(orNone=TRUE)) pdf("test_lme.pdf") > > fm1 <- lmList(Oxboys) > fm1 Call: Model: height ~ age | Subject Data: Oxboys Coefficients: (Intercept) age 10 130.262 3.72291 26 137.993 5.58878 25 139.210 4.02408 9 138.137 6.00906 2 142.858 5.44018 6 146.791 3.96317 7 146.128 4.99005 17 142.978 8.61178 16 147.545 4.54520 15 144.276 7.12426 8 148.293 6.46471 20 151.471 4.37447 1 148.120 7.17815 18 151.180 5.95779 5 151.429 6.24613 23 151.065 7.18512 11 150.047 8.50608 21 150.521 7.49779 3 155.651 4.77467 24 153.140 6.76470 22 154.567 8.08751 12 156.811 7.01547 13 156.071 8.49381 14 159.474 8.67089 19 164.576 9.06562 4 165.072 9.36056 Degrees of freedom: 234 total; 182 residual Residual standard error: 0.659888 > fm2 <- lme(fm1) > fm2 Linear mixed-effects model fit by REML Data: Oxboys Log-restricted-likelihood: -362.045 Fixed: height ~ age (Intercept) age 149.37175 6.52547 Random effects: Formula: ~age | Subject Structure: General positive-definite, Log-Cholesky parametrization StdDev Corr (Intercept) 8.081077 (Intr) age 1.680717 0.641 Residual 0.659889 Number of Observations: 234 Number of Groups: 26 > vc2 <- VarCorr(fm2) > stopifnot( + all.equal(fixef(fm2), c("(Intercept)" = 149.371753, + age = 6.52546866), tol=1e-8), + all.equal(as.numeric(vc2[,"StdDev"]), + c(8.081077, 1.680717, 0.659889), tol=4e-7)) > > # bug report from Arne.Mueller@sanofi-aventis.com > mod <- distance ~ age + Sex > fm3 <- lme(mod, Orthodont, random = ~ 1) > pm3 <- predict(fm3, Orthodont) > stopifnot(all.equal(mean(pm3), 24.023148148), + all.equal( sd(pm3), 2.4802195115), + all.equal(quantile(pm3), c("0%" = 17.0817792, "25%" = 22.3481813, + "50%" = 23.9271016, "75%" = 25.5740014, + "100%"= 30.8662241))) > > > ## bug report and fix from Dimitris Rizopoulos and Spencer Graves: > ## when 'returnObject = TRUE', do not stop() but give warning() on non-convergence: > tools::assertWarning( + fm1 <- lme(distance ~ age, data = Orthodont, + control = lmeControl(msMaxIter = 1, returnObject = TRUE)) + ) > > ## "typo" in 'random=' -- giving 27-dim. vector random effect: > ## PR#17524 B.Tyner: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17524 > try(lme(distance ~ 1, data=Orthodont, random = ~ Subject)) Error in lme.formula(distance ~ 1, data = Orthodont, random = ~Subject) : fewer observations than random effects in all level 1 groups > tools::assertError(lme(distance ~ age, data=Orthodont, random = ~ Subject)) > ## seg.faults in nlme <= 3.1-137 (2018) because of integer overflow > ## The previous warning is now an *error* (unless new lmeControl(allow.n.lt.q=TRUE)) > > > ## based on bug report on R-help > (p3.1 <- predict(fm3, Orthodont[1,])) M01 25.3924 attr(,"label") [1] "Predicted values (mm)" > # failed in 3.1-88 > stopifnot(all.equal(pm3[1], p3.1, + check.attributes=FALSE, tolerance = 1e-14)) > > ## Intervals failed in a patch proposal (Nov.2015): > (fm4 <- lme(distance ~ age, Orthodont, random = ~ age | Subject)) Linear mixed-effects model fit by REML Data: Orthodont Log-restricted-likelihood: -221.318 Fixed: distance ~ age (Intercept) age 16.761111 0.660185 Random effects: Formula: ~age | Subject Structure: General positive-definite, Log-Cholesky parametrization StdDev Corr (Intercept) 2.327034 (Intr) age 0.226428 -0.609 Residual 1.310040 Number of Observations: 108 Number of Groups: 27 > i4 <- intervals(fm4) > ## from dput(signif(i4$reStruct$Subject, 8)) > ## R-devel 2016-01-11; 64-bit : > reSS <- data.frame(lower = c(0.9485605, 0.10250901, -0.93825047), + est. = c(2.3270341, 0.22642779, -0.60933286), + upper = c(5.7087424, 0.50014674, 0.29816857)) > ## R-devel 2016-01-11; 32-bit : > ## reSS <- data.frame(lower = c(0.94962127,0.10262181, -0.93804767), > ## est. = c(2.3270339, 0.22642779, -0.60933284), > ## upper = c(5.7023648, 0.49959695, 0.29662651)) > rownames(reSS) <- rownames(i4$reStruct$Subject) > sm4 <- summary(fm4) > stopifnot( + all.equal(fixef(fm4), + c("(Intercept)" = 16.761111, age = 0.66018519)), + identical(fixef(fm4), sm4$tTable[,"Value"]), + all.equal(sm4$tTable[,"Std.Error"], + c("(Intercept)" = 0.77524603, age = 0.071253264), tol=6e-8), + all.equal(i4$reStruct$Subject[,"est."], reSS[,"est."], tol= 1e-7) + ## (lower, upper) cannot be very accurate for these : ==> tol = *e-4 + ,## "interestingly" 32-bit values changed from 3.2.3 to R-devel(3.3.0): + all.equal(i4$reStruct$Subject[,c(1,3)], reSS[,c(1,3)], tol = .005) + , + all.equal(as.vector(i4$sigma), + ## lower est. upper + c(1.0849772, 1.3100397, 1.5817881), tol=8e-4) + , + all.equal(as.vector(i4$fixed), + as.vector(rbind(c(15.218322, 16.761111, 18.3039), + c(0.51838667, 0.66018519, 0.8019837))), + tol = 1e-6) + ) > > > ## wrong results from getData: > ss2 <- readRDS("ss2.rds") > m1 <- lme(PV1MATH ~ ESCS + Age +time , + random = ~ time|SCHOOLID, + data = ss2, + weights = varIdent(form=~1|time), + corr = corCompSymm(form=~1|SCHOOLID/StIDStd), + na.action = na.omit) > plot(m1, resid(.) ~ WEALTH) > > m2 <- lme(PV1MATH ~ ESCS + Age +time , + random = ~ time|SCHOOLID, + data = ss2, + weights = varIdent(form=~1|time), + corr = corCompSymm(form=~1|SCHOOLID/StIDStd), + na.action = na.omit) > plot(m2, resid(.) ~ WEALTH) > > > ## Variogram() failing in the case of 1-observation groups (PR#17192): > BW <- subset(BodyWeight, ! (Rat=="1" & Time > 1)) > if(interactive()) + print( xtabs(~ Rat + Time, data = BW) )# Rat '1' only at Time == 1 > fm2 <- lme(fixed = weight ~ Time * Diet, random = ~ 1 | Rat, data = BW) > Vfm2 <- Variogram(fm2, form = ~ Time | Rat) > stopifnot(is.data.frame(Vfm2), + identical(dim(Vfm2), c(19L, 3L)), + all.equal(unlist(Vfm2[10,]), c(variog = 1.08575384191148, + dist = 22, n.pairs = 15)) + ) > ## failed in nlme from 3.1-122 till 3.1-128 > > proc.time() user system elapsed 1.376 0.138 1.653 nlme/tests/augPredmissing.R0000644000176200001440000000035710513125521015453 0ustar liggesuserslibrary(nlme) data(Orthodont) # add a column with an NA that is not used in the fit Orthodont$Others = runif(nrow(Orthodont)) is.na(Orthodont$Others[3]) = TRUE fm1 = lme(Orthodont, random = ~1) augPred(fm1, length.out = 2, level = c(0,1)) nlme/tests/predict.lme.R0000644000176200001440000001041513241753016014703 0ustar liggesusers## from PR#8905 library(nlme) data(Orthodont) fm <- lme(distance ~ poly(age, 3) + Sex, data = Orthodont, random = ~ 1) # data for predictions Newdata <- head(Orthodont) Newdata$Sex <- factor(Newdata$Sex, levels = levels(Orthodont$Sex)) (pr <- predict(fm, Newdata)) stopifnot(all.equal(c(pr), fitted(fm)[1:6])) ## https://stat.ethz.ch/pipermail/r-devel/2013-September/067600.html ## but with a different fix. m0 <- lme(distance ~ Sex, random = ~1|Subject, data = Orthodont) Fitted <- predict(m0, level = 0) Fitted.Newdata <- predict(m0, level = 0, newdata = Orthodont) stopifnot(sum(abs(Fitted - Fitted.Newdata)) == 0) Fitted <- predict(m0, level = 1) Fitted.Newdata <- predict(m0, level = 1, newdata = Orthodont) sum(abs(Fitted - Fitted.Newdata)) stopifnot(sum(abs(Fitted - Fitted.Newdata)) == 0) m1 <- lme(distance ~ 1, random = ~1|Subject, data = Orthodont) Fitted <- predict(m1, level = 0) Fitted.Newdata <- predict(m1, level = 0, newdata = Orthodont) stopifnot(sum(abs(Fitted - Fitted.Newdata)) == 0) Fitted <- predict(m1, level = 1) Fitted.Newdata <- predict(m1, level = 1, newdata = Orthodont) stopifnot(sum(abs(Fitted - Fitted.Newdata)) == 0) m2 <- lme(distance ~ 0, random = ~1|Subject, data = Orthodont) Fitted <- predict(m2, level = 0) Fitted.Newdata <- predict(m2, level = 0, newdata = Orthodont) stopifnot(sum(abs(Fitted - Fitted.Newdata)) == 0) Fitted <- predict(m2, level = 1) Fitted.Newdata <- predict(m2, level = 1, newdata = Orthodont) stopifnot(sum(abs(Fitted - Fitted.Newdata)) == 0) m3 <- lme(fixed = distance ~ age, data = Orthodont, random = ~ 1 | Subject) m4 <- update(m3, random = ~ age | Subject) m5 <- update(m4, fixed = distance ~ age * Sex) newD <- expand.grid(age = seq(7,15, by = .25), Sex = c("Male", "Female"), Subject = c("M01", "F01")) (n.age <- attr(newD, "out.attrs")$dim[["age"]]) # 33 str(p5 <- predict(m5, newdata = newD, asList = TRUE, level=0:1)) pp5 <- cbind(newD, p5[,-1]) stopifnot(identical(colnames(pp5), c("age", "Sex", "Subject", "predict.fixed", "predict.Subject"))) fixef(m5) # (Intercept) age SexF age:SexF p5Mf <- pp5[pp5$Sex == "Male", "predict.fixed"] p5MS <- subset(pp5, subset = Subject == "M01" & Sex == "Male", select = "predict.Subject", drop=TRUE) X.1 <- cbind(1, newD[1:n.age,"age"]) stopifnot(all.equal(p5Mf[ 1:n.age], p5Mf[-(1:n.age)], tol = 1e-15) , all.equal(p5Mf[ 1:n.age], c(X.1 %*% fixef(m5)[1:2]), tol = 1e-15) , all.equal(p5MS, c(X.1 %*% (fixef(m5)[1:2] + as.numeric(ranef(m5)["M01",]))), tole = 1e-15) ) ##--- simulate():--------- ## border cases ort.0 <- simulate(m3, method = character())# "nothing" stored ort.M <- simulate(m3, method = "ML", seed=47) ort.R <- simulate(m3, method = "REML", seed=47) stopifnot(identical(names(ort.0), "null"), identical(names(ort.M), "null"), identical(names(ort.R), "null"), identical(ort.0$null, list()), identical(names(ort.M$null), "ML"), identical(names(ort.R$null), "REML"), all.equal(loM <- ort.M$null$ML [,"logLik"], -215.437, tol = 2e-6) , all.equal(loR <- ort.R$null$REML[,"logLik"], -217.325, tol = 2e-6) ) system.time( orthS3 <- simulate.lme(list(fixed = distance ~ age, data = Orthodont, random = ~ 1 | Subject), nsim = 3, m2 = list(random = ~ age | Subject), seed = 47) ) ## the same, starting from two fitted models : ort.S3 <- simulate(m3, m2 = m4, nsim = 3, seed = 47) attr(ort.S3, "call") <- attr(orthS3, "call") ## was 1e-15, larger tolerance needed with ATLAS stopifnot(all.equal(orthS3, ort.S3, tolerance = 1e-10)) logL <- sapply(orthS3, function(E) sapply(E, function(M) M[,"logLik"]), simplify="array") stopifnot(is.array(logL), length(d <- dim(logL)) == 3, d == c(3,2,2), sapply(orthS3, function(E) sapply(E, function(M) M[,"info"])) == 0 , # typically even identical(), but not with ATLAS all.equal(logL[1,,"null"], c(ML = loM, REML = loR), tol = 1e-10) , all.equal(c(logL) + 230, c(14.563 , 2.86712, 1.00026, 12.6749, 1.1615,-0.602989, 16.2301, 2.95877, 2.12854, 14.3586, 1.2534, 0.582263), tol=8e-6) ) nlme/tests/gls.R0000644000176200001440000000217312627520616013271 0ustar liggesusers## reported by simon bond to R-help 2007-03-16 library(nlme) x <- rnorm(10, 0.1, 1) try(gls(x ~ 0)) # segfaulted in 3.1-79 ## PR#10364 # copied verbatim from Pinheiro & Bates 8.3.3 fm1Dial.gnls <- gnls(rate ~ SSasympOff(pressure, Asym, lrc, c0), data = Dialyzer, params = list(Asym + lrc ~ QB, c0 ~ 1), start = c(53.6, 8.6, 0.51, -0.26, 0.225)) (p1 <- predict(fm1Dial.gnls)) (p2 <- predict(fm1Dial.gnls, newdata = Dialyzer)) # failed, factor levels complaint # also, missed row names as names stopifnot(all.equal(as.vector(p1), as.vector(p2)), # 'label' differs identical(names(p1), names(p2))) ## PR#13418 fm1 <- gls(weight ~ Time * Diet, BodyWeight) (V10 <- Variogram(fm1, form = ~ Time | Rat)[1:10,]) ## failed in 3.1-89 stopifnot(all.equal(V10$variog, c(0.0072395216, 0.014584634, 0.014207936, 0.018442267, 0.011128505, 0.019910082, 0.027072311, 0.034140379, 0.028320657, 0.037525507)), V10$dist == c(1, 6, 7, 8, 13, 14, 15, 20, 21, 22), V10$n.pairs == 16*c(1, 1, 9, 1, 1, 8, 1, 1, 7, 1)) intervals(fm1) nlme/tests/getData.R0000644000176200001440000000034510513125521014040 0ustar liggesuserslibrary(nlme) fm1 <- lme(distance ~ age, Orthodont) str(o1 <- getData(fm1)) df <- Orthodont # note that the name conflicts with df in the stats fm2 <- lme(distance ~ age, df) str(o2 <- getData(fm2)) stopifnot(identical(o1, o2)) nlme/tests/varIdent.R0000644000176200001440000000040310643675704014257 0ustar liggesusers## test for PR#9765 library(nlme) Orth <- subset(Orthodont, Subject %in% c("M01","F01")) # Argument fixed in varIdent is ignored vf <- varIdent(form=~1|Sex,fixed=c(Female=0.5)) vf <- Initialize(vf, data=Orth) stopifnot(varWeights(vf) == rep(c(1,2), each=4)) nlme/tests/missing.Rout.save0000644000176200001440000011222613241753016015636 0ustar liggesusers R version 3.4.3 Patched (2018-02-11 r74243) -- "Kite-Eating Tree" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin17.4.0 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(nlme) > > op <- options(digits = 3) # reduce rounding differences > > Ovary[c(1,272), 2] <- NA > fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary, + correlation = corAR1(form = ~ 1 | Mare), na.action=na.exclude) > fitted(fm1) 1 2 3 4 5 6 7 8 9 10 11 12 13 NA 12.86 12.06 11.27 10.55 9.96 9.54 9.34 9.36 9.60 10.05 10.67 11.41 14 15 16 17 18 19 20 21 22 23 24 25 26 12.21 13.00 13.71 14.31 14.72 14.93 14.91 14.66 14.21 13.59 12.86 12.06 11.27 27 28 29 30 31 32 33 34 35 36 37 38 39 10.55 9.96 9.54 13.79 13.01 12.14 11.27 10.49 9.86 9.46 9.32 9.45 9.85 40 41 42 43 44 45 46 47 48 49 50 51 52 10.47 11.26 12.13 13.00 13.78 14.41 14.81 14.95 14.81 14.41 13.79 13.01 12.14 53 54 55 56 57 58 59 60 61 62 63 64 65 11.27 10.49 9.86 9.46 13.90 13.10 12.19 11.27 10.45 9.81 9.42 9.32 9.53 66 67 68 69 70 71 72 73 74 75 76 77 78 10.03 10.75 11.62 12.54 13.42 14.17 14.69 14.93 14.87 14.52 13.90 13.10 12.19 79 80 81 82 83 84 85 86 87 88 89 90 91 11.27 10.45 9.81 9.42 13.59 12.86 12.06 11.27 10.55 9.96 9.54 9.34 9.36 92 93 94 95 96 97 98 99 100 101 102 103 104 9.60 10.05 10.67 11.41 12.21 13.00 13.71 14.31 14.72 14.93 14.91 14.66 14.21 105 106 107 108 109 110 111 112 113 114 115 116 117 13.59 12.86 12.06 11.27 10.55 9.96 9.54 13.59 12.86 12.06 11.27 10.55 9.96 118 119 120 121 122 123 124 125 126 127 128 129 130 9.54 9.34 9.36 9.60 10.05 10.67 11.41 12.21 13.00 13.71 14.31 14.72 14.93 131 132 133 134 135 136 137 138 139 140 141 142 143 14.91 14.66 14.21 13.59 12.86 12.06 11.27 10.55 9.96 9.54 13.59 12.86 12.06 144 145 146 147 148 149 150 151 152 153 154 155 156 11.27 10.55 9.96 9.54 9.34 9.36 9.60 10.05 10.67 11.41 12.21 13.00 13.71 157 158 159 160 161 162 163 164 165 166 167 168 169 14.31 14.72 14.93 14.91 14.66 14.21 13.59 12.86 12.06 11.27 10.55 9.96 9.54 170 171 172 173 174 175 176 177 178 179 180 181 182 13.79 13.01 12.14 11.27 10.49 9.86 9.46 9.32 9.45 9.85 10.47 11.26 12.13 183 184 185 186 187 188 189 190 191 192 193 194 195 13.00 13.78 14.41 14.81 14.95 14.81 14.41 13.79 13.01 12.14 11.27 10.49 9.86 196 197 198 199 200 201 202 203 204 205 206 207 208 9.46 13.42 12.73 11.99 11.27 10.61 10.05 9.63 9.38 9.32 9.45 9.77 10.24 209 210 211 212 213 214 215 216 217 218 219 220 221 10.85 11.54 12.27 13.00 13.66 14.22 14.64 14.88 14.94 14.81 14.50 14.02 13.42 222 223 224 225 226 227 228 229 230 231 232 233 234 12.73 11.99 11.27 10.61 10.05 9.63 14.02 13.19 12.24 11.27 10.41 9.75 9.38 235 236 237 238 239 240 241 242 243 244 245 246 247 9.35 9.64 10.24 11.07 12.03 13.00 13.86 14.52 14.88 14.92 14.62 14.02 13.19 248 249 250 251 252 253 254 255 256 257 258 259 260 12.24 11.27 10.41 9.75 9.38 13.59 12.86 12.06 11.27 10.55 9.96 9.54 9.34 261 262 263 264 265 266 267 268 269 270 271 272 273 9.36 9.60 10.05 10.67 11.41 12.21 13.00 13.71 14.31 14.72 14.93 NA 14.66 274 275 276 277 278 279 280 281 282 283 284 285 286 14.21 13.59 12.86 12.06 11.27 10.55 9.96 9.54 13.79 13.01 12.14 11.27 10.49 287 288 289 290 291 292 293 294 295 296 297 298 299 9.86 9.46 9.32 9.45 9.85 10.47 11.26 12.13 13.00 13.78 14.41 14.81 14.95 300 301 302 303 304 305 306 307 308 14.81 14.41 13.79 13.01 12.14 11.27 10.49 9.86 9.46 attr(,"label") [1] "Fitted values" > residuals(fm1) 1 2 3 4 5 6 7 8 NA 2.1439 6.9394 4.7290 2.4488 0.0405 2.4560 4.6618 9 10 11 12 13 14 15 16 3.6412 10.3959 11.9456 4.3270 6.5900 4.7945 1.0049 4.2851 17 18 19 20 21 22 23 24 -0.3066 1.2779 2.0720 3.0927 3.3380 2.7883 0.4069 -0.8561 25 26 27 28 29 30 31 32 -0.0606 2.7290 -0.5512 1.0405 6.4560 -7.7936 -7.0102 -4.1410 33 34 35 36 37 38 39 40 -4.2710 5.5146 0.1390 3.5409 -0.3189 -2.4542 -3.8517 -2.4725 41 42 43 44 45 46 47 48 -3.2559 -6.1251 -4.9951 -6.7808 -5.4051 -8.8070 -10.9472 -9.8119 49 50 51 52 53 54 55 56 -6.4144 -2.7936 -0.0102 -2.1410 -5.2710 -3.4854 -3.8610 -4.4591 57 58 59 60 61 62 63 64 -0.9042 -2.0982 -2.1875 -5.2710 -2.4479 -3.8074 -0.4189 -0.3245 65 66 67 68 69 70 71 72 0.4655 -2.0261 3.2540 1.3838 1.4576 2.5757 5.8338 6.3122 73 74 75 76 77 78 79 80 10.0674 8.1260 4.4817 8.0958 2.9018 8.8125 7.7290 9.5521 81 82 83 84 85 86 87 88 7.1926 14.5811 -4.5931 -3.8561 -5.0606 -5.2710 -3.5512 -3.9595 89 90 91 92 93 94 95 96 -8.5440 -8.3382 -8.3588 -4.6041 -4.0544 -7.6730 -6.4100 -9.2055 97 98 99 100 101 102 103 104 -6.9951 -5.7149 -8.3066 -9.7221 -8.9280 -6.9073 -3.6620 -0.2117 105 106 107 108 109 110 111 112 -5.5931 -3.8561 -2.0606 -4.2710 -3.5512 -3.9595 1.4560 -3.5931 113 114 115 116 117 118 119 120 -0.8561 -0.0606 5.7290 -1.5512 0.0405 -6.5440 2.6618 3.6412 121 122 123 124 125 126 127 128 -0.6041 -6.0544 -3.6730 -7.4100 -0.2055 1.0049 -1.7149 0.6934 129 130 131 132 133 134 135 136 2.2779 0.0720 -1.9073 3.3380 4.7883 -0.5931 -3.8561 -0.0606 137 138 139 140 141 142 143 144 -3.2710 -0.5512 -4.9595 4.4560 2.4069 4.1439 0.9394 5.7290 145 146 147 148 149 150 151 152 4.4488 -0.9595 -1.5440 -4.3382 -0.3588 -1.6041 -2.0544 2.3270 153 154 155 156 157 158 159 160 2.5900 0.7945 1.0049 0.2851 -3.3066 2.2779 6.0720 6.0927 161 162 163 164 165 166 167 168 6.3380 5.7883 3.4069 5.1439 9.9394 -1.2710 0.4488 1.0405 169 170 171 172 173 174 175 176 2.4560 4.2064 -0.0102 1.8590 0.7290 0.5146 -1.8610 -4.4591 177 178 179 180 181 182 183 184 -1.3189 0.5458 1.1483 -0.4725 0.7441 -2.1251 -3.9951 -1.7808 185 186 187 188 189 190 191 192 -0.4051 1.1930 -1.9472 -3.8119 -1.4144 -0.7936 -2.0102 -1.1410 193 194 195 196 197 198 199 200 -3.2710 3.5146 -5.8610 -2.4591 -0.4177 -3.7259 3.0063 3.7290 201 202 203 204 205 206 207 208 1.3930 -2.0471 0.3708 -3.3821 -0.3224 -1.4542 0.2314 -4.2441 209 210 211 212 213 214 215 216 -2.8484 1.4598 -0.2724 -0.9951 1.3409 6.7809 10.3631 6.1159 217 218 219 220 221 222 223 224 6.0562 9.1881 5.5025 5.9780 4.5823 7.2741 8.0063 7.7290 225 226 227 228 229 230 231 232 1.3930 -3.0471 -1.6292 -4.0220 0.8054 -0.2392 -1.2710 -3.4068 233 234 235 236 237 238 239 240 2.2493 0.6179 -1.3452 0.3554 4.7559 3.9285 -0.0269 6.0049 241 242 243 244 245 246 247 248 1.1406 1.4846 0.1159 2.0791 -0.6215 1.9780 1.8054 -1.2392 249 250 251 252 253 254 255 256 -1.2710 -3.4067 -5.7507 -1.3821 -2.5931 3.1439 2.9394 0.7290 257 258 259 260 261 262 263 264 0.4488 -3.9595 1.4560 2.6618 1.6412 6.3959 4.9456 0.3270 265 266 267 268 269 270 271 272 -4.4100 1.7945 7.0049 8.2851 8.6934 6.2779 6.0720 NA 273 274 275 276 277 278 279 280 7.3380 7.7883 3.4069 4.1439 4.9394 5.7290 3.4488 2.0405 281 282 283 284 285 286 287 288 1.4560 -4.7936 -5.0102 -4.1410 -3.2710 -2.4854 -3.8610 -2.4591 289 290 291 292 293 294 295 296 -1.3189 0.5458 0.1483 3.5275 1.7441 -4.1251 -4.9951 -5.7808 297 298 299 300 301 302 303 304 -5.4051 1.1930 -2.9472 -4.8119 -2.4144 -1.7936 -4.0102 -6.1410 305 306 307 308 -2.2710 -3.4854 -4.8610 -4.4591 attr(,"std") [1] NA 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [16] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [31] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [46] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [61] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [76] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [91] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [106] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [121] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [136] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [151] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [166] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [181] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [196] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [211] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [226] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [241] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [256] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [271] 4.58 NA 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [286] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 [301] 4.58 4.58 4.58 4.58 4.58 4.58 4.58 4.58 attr(,"label") [1] "Residuals" > summary(fm1) Generalized least squares fit by REML Model: follicles ~ sin(2 * pi * Time) + cos(2 * pi * Time) Data: Ovary AIC BIC logLik 1560 1579 -775 Correlation Structure: AR(1) Formula: ~1 | Mare Parameter estimate(s): Phi 0.75 Coefficients: Value Std.Error t-value p-value (Intercept) 12.13 0.657 18.46 0.000 sin(2 * pi * Time) -2.68 0.644 -4.16 0.000 cos(2 * pi * Time) -0.86 0.690 -1.25 0.213 Correlation: (Intr) s(*p*T sin(2 * pi * Time) -0.007 cos(2 * pi * Time) -0.295 0.003 Standardized residuals: Min Q1 Med Q3 Max -2.3897 -0.7565 -0.0132 0.6396 3.1830 Residual standard error: 4.58 Degrees of freedom: 306 total; 303 residual > > Orthodont[100:102, 2] <- NA > fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1, + na.action=na.exclude) > fitted(fm2, 0:1) fixed Subject 1 23.0 25.4 2 24.3 26.7 3 25.6 28.0 4 27.0 29.4 5 23.0 21.6 6 24.3 22.9 7 25.6 24.3 8 27.0 25.6 9 23.0 22.3 10 24.3 23.7 11 25.6 25.0 12 27.0 26.4 13 23.0 24.4 14 24.3 25.7 15 25.6 27.1 16 27.0 28.4 17 23.0 21.3 18 24.3 22.6 19 25.6 23.9 20 27.0 25.3 21 23.0 24.2 22 24.3 25.5 23 25.6 26.9 24 27.0 28.2 25 23.0 21.9 26 24.3 23.2 27 25.6 24.6 28 27.0 25.9 29 23.0 22.0 30 24.3 23.4 31 25.6 24.7 32 27.0 26.0 33 23.0 23.1 34 24.3 24.4 35 25.6 25.8 36 27.0 27.1 37 23.0 26.9 38 24.3 28.2 39 25.6 29.5 40 27.0 30.9 41 23.0 21.8 42 24.3 23.1 43 25.6 24.5 44 27.0 25.8 45 23.0 22.3 46 24.3 23.7 47 25.6 25.0 48 27.0 26.4 49 23.0 22.3 50 24.3 23.7 51 25.6 25.0 52 27.0 26.4 53 23.0 22.9 54 24.3 24.2 55 25.6 25.6 56 27.0 26.9 57 23.0 23.7 58 24.3 25.1 59 25.6 26.4 60 27.0 27.8 61 23.0 21.3 62 24.3 22.6 63 25.6 23.9 64 27.0 25.3 65 20.7 19.5 66 22.0 20.9 67 23.4 22.2 68 24.7 23.6 69 20.7 20.9 70 22.0 22.3 71 23.4 23.6 72 24.7 25.0 73 20.7 21.6 74 22.0 22.9 75 23.4 24.3 76 24.7 25.6 77 20.7 22.6 78 22.0 23.9 79 23.4 25.2 80 24.7 26.6 81 20.7 20.6 82 22.0 22.0 83 23.4 23.3 84 24.7 24.6 85 20.7 19.3 86 22.0 20.7 87 23.4 22.0 88 24.7 23.4 89 20.7 20.9 90 22.0 22.3 91 23.4 23.6 92 24.7 25.0 93 20.7 21.3 94 22.0 22.6 95 23.4 24.0 96 24.7 25.3 97 20.7 19.8 98 22.0 21.2 99 23.4 22.5 100 NA NA 101 NA NA 102 NA NA 103 23.4 19.7 104 24.7 21.1 105 20.7 23.9 106 22.0 25.2 107 23.4 26.5 108 24.7 27.9 > fitted(fm2) M01 M01 M01 M01 M02 M02 M02 M02 M03 M03 M03 M03 M04 M04 M04 M04 25.4 26.7 28.0 29.4 21.6 22.9 24.3 25.6 22.3 23.7 25.0 26.4 24.4 25.7 27.1 28.4 M05 M05 M05 M05 M06 M06 M06 M06 M07 M07 M07 M07 M08 M08 M08 M08 21.3 22.6 23.9 25.3 24.2 25.5 26.9 28.2 21.9 23.2 24.6 25.9 22.0 23.4 24.7 26.0 M09 M09 M09 M09 M10 M10 M10 M10 M11 M11 M11 M11 M12 M12 M12 M12 23.1 24.4 25.8 27.1 26.9 28.2 29.5 30.9 21.8 23.1 24.5 25.8 22.3 23.7 25.0 26.4 M13 M13 M13 M13 M14 M14 M14 M14 M15 M15 M15 M15 M16 M16 M16 M16 22.3 23.7 25.0 26.4 22.9 24.2 25.6 26.9 23.7 25.1 26.4 27.8 21.3 22.6 23.9 25.3 F01 F01 F01 F01 F02 F02 F02 F02 F03 F03 F03 F03 F04 F04 F04 F04 19.5 20.9 22.2 23.6 20.9 22.3 23.6 25.0 21.6 22.9 24.3 25.6 22.6 23.9 25.2 26.6 F05 F05 F05 F05 F06 F06 F06 F06 F07 F07 F07 F07 F08 F08 F08 F08 20.6 22.0 23.3 24.6 19.3 20.7 22.0 23.4 20.9 22.3 23.6 25.0 21.3 22.6 24.0 25.3 F09 F09 F09 F10 F10 F11 F11 F11 F11 19.8 21.2 22.5 NA NA NA 19.7 21.1 23.9 25.2 26.5 27.9 attr(,"label") [1] "Fitted values (mm)" > residuals(fm2, 0:1) fixed Subject 1 3.0453 0.64827 2 0.7026 -1.69443 3 3.3599 0.96286 4 4.0172 1.62016 5 -1.4547 -0.08111 6 -1.7974 -0.42382 7 -2.6401 -1.26652 8 -0.4828 0.89078 9 0.0453 0.66476 10 -1.7974 -1.17794 11 -1.6401 -1.02064 12 0.5172 1.13665 13 2.5453 1.11786 14 3.2026 1.77515 15 0.8599 -0.56755 16 0.0172 -1.41025 17 -2.9547 -1.25792 18 -0.7974 0.89938 19 -3.1401 -1.44332 20 -0.9828 0.71397 21 1.5453 0.33332 22 1.2026 -0.00938 23 1.3599 0.14791 24 1.5172 0.30521 25 -0.9547 0.09569 26 -2.2974 -1.24701 27 -1.1401 -0.08972 28 -0.4828 0.56758 29 1.0453 1.98796 30 -2.7974 -1.85474 31 -1.1401 -0.19745 32 -1.4828 -0.54015 33 0.0453 -0.08936 34 -3.7974 -3.93206 35 5.3599 5.22523 36 -0.9828 -1.11747 37 4.5453 0.64002 38 3.7026 -0.20268 39 5.3599 1.45461 40 4.5172 0.61191 41 0.0453 1.20342 42 -1.2974 -0.13928 43 -2.1401 -0.98198 44 -1.9828 -0.82469 45 -1.4547 -0.83524 46 -0.7974 -0.17794 47 -1.6401 -1.02064 48 1.0172 1.63665 49 -5.9547 -5.33524 50 0.2026 0.82206 51 0.3599 0.97936 52 2.5172 3.13665 53 -0.4547 -0.37390 54 1.2026 1.28340 55 -0.1401 -0.05930 56 -0.9828 -0.90201 57 0.0453 -0.73575 58 0.2026 -0.57846 59 0.3599 -0.42116 60 3.0172 2.23614 61 -0.9547 0.74208 62 -2.7974 -1.10062 63 -2.1401 -0.44332 64 -1.9828 -0.28603 65 0.3135 1.45594 66 -2.0292 -0.88676 67 -1.8719 -0.72947 68 -1.7146 -0.57217 69 0.3135 0.05543 70 -0.5292 -0.78728 71 0.6281 0.37002 72 0.7854 0.52732 73 -0.1865 -1.09097 74 1.9708 1.06633 75 1.1281 0.22363 76 1.2854 0.38092 77 2.8135 0.93945 78 2.4708 0.59674 79 1.6281 -0.24596 80 1.7854 -0.08866 81 0.8135 0.87862 82 0.9708 1.03592 83 -0.8719 -0.80678 84 -1.2146 -1.14949 85 -0.6865 0.67141 86 -1.0292 0.32870 87 -2.3719 -1.01400 88 -2.2146 -0.85670 89 0.8135 0.55543 90 0.4708 0.21272 91 -0.3719 -0.62998 92 0.2854 0.02732 93 2.3135 1.73223 94 0.9708 0.38953 95 0.1281 -0.45318 96 -0.7146 -1.29588 97 -0.6865 0.16148 98 -1.0292 -0.18122 99 -1.3719 -0.52392 100 NA NA 101 NA NA 102 NA NA 103 -4.3719 -0.74222 104 -5.2146 -1.58492 105 3.8135 0.64666 106 2.9708 -0.19604 107 4.6281 1.46126 108 3.2854 0.11855 > round(residuals(fm2), 2) M01 M01 M01 M01 M02 M02 M02 M02 M03 M03 M03 M03 M04 0.65 -1.69 0.96 1.62 -0.08 -0.42 -1.27 0.89 0.66 -1.18 -1.02 1.14 1.12 M04 M04 M04 M05 M05 M05 M05 M06 M06 M06 M06 M07 M07 1.78 -0.57 -1.41 -1.26 0.90 -1.44 0.71 0.33 -0.01 0.15 0.31 0.10 -1.25 M07 M07 M08 M08 M08 M08 M09 M09 M09 M09 M10 M10 M10 -0.09 0.57 1.99 -1.85 -0.20 -0.54 -0.09 -3.93 5.23 -1.12 0.64 -0.20 1.45 M10 M11 M11 M11 M11 M12 M12 M12 M12 M13 M13 M13 M13 0.61 1.20 -0.14 -0.98 -0.82 -0.84 -0.18 -1.02 1.64 -5.34 0.82 0.98 3.14 M14 M14 M14 M14 M15 M15 M15 M15 M16 M16 M16 M16 F01 -0.37 1.28 -0.06 -0.90 -0.74 -0.58 -0.42 2.24 0.74 -1.10 -0.44 -0.29 1.46 F01 F01 F01 F02 F02 F02 F02 F03 F03 F03 F03 F04 F04 -0.89 -0.73 -0.57 0.06 -0.79 0.37 0.53 -1.09 1.07 0.22 0.38 0.94 0.60 F04 F04 F05 F05 F05 F05 F06 F06 F06 F06 F07 F07 F07 -0.25 -0.09 0.88 1.04 -0.81 -1.15 0.67 0.33 -1.01 -0.86 0.56 0.21 -0.63 F07 F08 F08 F08 F08 F09 F09 F09 F10 F10 0.03 1.73 0.39 -0.45 -1.30 0.16 -0.18 -0.52 NA NA NA -0.74 -1.58 F11 F11 F11 F11 0.65 -0.20 1.46 0.12 attr(,"label") [1] "Residuals (mm)" > summary(fm2) Linear mixed-effects model fit by REML Data: Orthodont AIC BIC logLik 437 450 -213 Random effects: Formula: ~1 | Subject (Intercept) Residual StdDev: 1.8 1.44 Fixed effects: distance ~ age + Sex Value Std.Error DF t-value p-value (Intercept) 17.58 0.850 77 20.68 0.0000 age 0.67 0.064 77 10.56 0.0000 SexFemale -2.27 0.762 25 -2.98 0.0064 Correlation: (Intr) age age -0.822 SexFemale -0.357 -0.006 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -3.7079 -0.5471 -0.0564 0.4666 3.6314 Number of Observations: 105 Number of Groups: 27 > > Soybean[1:5, "Time"] <- NA > fm3 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal), Soybean, + weights = varPower(), na.action=na.exclude) > fitted(fm3) 1 2 3 4 5 6 7 8 9 10 11 NA NA NA NA NA 7.047 10.958 14.082 15.894 16.756 0.120 12 13 14 15 16 17 18 19 20 21 22 0.298 0.726 1.708 3.724 7.047 10.958 15.894 16.756 0.120 0.298 0.726 23 24 25 26 27 28 29 30 31 32 33 1.708 3.724 7.047 10.958 14.082 15.894 16.756 0.120 0.298 0.726 1.708 34 35 36 37 38 39 40 41 42 43 44 3.724 7.047 10.958 14.082 15.894 16.756 0.120 0.298 0.726 1.708 3.724 45 46 47 48 49 50 51 52 53 54 55 7.047 10.958 15.894 0.120 0.298 0.726 1.708 3.724 7.047 10.958 14.082 56 57 58 59 60 61 62 63 64 65 66 15.894 16.756 0.120 0.298 0.726 1.708 3.724 7.047 10.958 15.894 16.756 67 68 69 70 71 72 73 74 75 76 77 0.120 0.298 0.726 1.708 3.724 7.047 10.958 14.082 15.894 16.756 0.120 78 79 80 81 82 83 84 85 86 87 88 0.298 0.726 1.708 3.724 7.047 10.958 14.082 15.894 16.756 0.120 0.298 89 90 91 92 93 94 95 96 97 98 99 0.726 1.708 3.724 7.047 10.958 14.082 15.894 16.756 0.120 0.298 0.726 100 101 102 103 104 105 106 107 108 109 110 1.708 3.724 7.047 10.958 14.082 15.894 16.756 0.120 0.298 0.726 1.708 111 112 113 114 115 116 117 118 119 120 121 3.724 7.047 10.958 14.082 15.894 16.756 0.120 0.298 0.726 1.708 3.724 122 123 124 125 126 127 128 129 130 131 132 7.047 10.958 14.082 15.894 16.756 0.120 0.298 0.726 1.708 3.724 7.047 133 134 135 136 137 138 139 140 141 142 143 10.958 14.082 15.894 16.756 0.120 0.298 0.726 1.708 3.724 7.047 10.958 144 145 146 147 148 149 150 151 152 153 154 14.082 15.894 16.756 0.120 0.298 0.726 1.708 3.724 7.047 10.958 14.082 155 156 157 158 159 160 161 162 163 164 165 15.894 16.756 0.120 0.262 0.640 1.517 3.355 10.419 15.706 17.127 0.120 166 167 168 169 170 171 172 173 174 175 176 0.262 0.640 1.517 3.355 10.419 15.706 17.127 0.120 0.262 0.640 1.517 177 178 179 180 181 182 183 184 185 186 187 3.355 10.419 15.706 17.127 0.120 0.262 0.640 1.517 3.355 10.419 15.706 188 189 190 191 192 193 194 195 196 197 198 17.127 0.120 0.262 0.640 1.517 3.355 10.419 15.706 17.127 0.120 0.262 199 200 201 202 203 204 205 206 207 208 209 0.640 1.517 3.355 10.419 15.706 17.127 0.120 0.262 0.640 1.517 3.355 210 211 212 213 214 215 216 217 218 219 220 10.419 15.706 17.127 0.120 0.262 0.640 1.517 3.355 10.419 15.706 17.127 221 222 223 224 225 226 227 228 229 230 231 0.120 0.262 0.640 1.517 3.355 10.419 15.706 17.127 0.120 0.262 0.640 232 233 234 235 236 237 238 239 240 241 242 1.517 3.355 10.419 15.706 17.127 0.120 0.262 0.640 1.517 3.355 10.419 243 244 245 246 247 248 249 250 251 252 253 15.706 17.127 0.120 0.262 0.640 1.517 3.355 10.419 15.706 17.127 0.120 254 255 256 257 258 259 260 261 262 263 264 0.262 0.640 1.517 3.355 10.419 15.706 17.127 0.120 0.262 0.640 1.517 265 266 267 268 269 270 271 272 273 274 275 3.355 10.419 15.706 17.127 0.120 0.262 0.640 1.517 3.355 10.419 15.706 276 277 278 279 280 281 282 283 284 285 286 17.127 0.120 0.262 0.640 1.517 3.355 10.419 15.706 17.127 0.137 0.385 287 288 289 290 291 292 293 294 295 296 297 0.932 2.157 4.121 8.166 14.418 16.897 0.137 0.385 0.932 2.157 4.121 298 299 300 301 302 303 304 305 306 307 308 8.166 14.418 16.897 0.137 0.385 0.932 2.157 4.121 8.166 14.418 16.897 309 310 311 312 313 314 315 316 317 318 319 0.137 0.385 0.932 2.157 4.121 8.166 14.418 16.897 0.137 0.385 0.932 320 321 322 323 324 325 326 327 328 329 330 2.157 4.121 8.166 14.418 16.897 0.137 0.385 0.932 2.157 4.121 8.166 331 332 333 334 335 336 337 338 339 340 341 14.418 16.897 0.137 0.385 0.932 2.157 4.121 8.166 14.418 16.897 0.137 342 343 344 345 346 347 348 349 350 351 352 0.385 0.932 2.157 4.121 8.166 14.418 16.897 0.137 0.385 0.932 2.157 353 354 355 356 357 358 359 360 361 362 363 4.121 8.166 14.418 16.897 0.137 0.385 0.932 2.157 4.121 8.166 14.418 364 365 366 367 368 369 370 371 372 373 374 16.897 0.137 0.385 0.932 2.157 4.121 8.166 14.418 16.897 0.137 0.385 375 376 377 378 379 380 381 382 383 384 385 0.932 2.157 4.121 8.166 14.418 16.897 0.137 0.385 0.932 2.157 4.121 386 387 388 389 390 391 392 393 394 395 396 8.166 14.418 16.897 0.137 0.385 0.932 2.157 4.121 8.166 14.418 16.897 397 398 399 400 401 402 403 404 405 406 407 0.137 0.385 0.932 2.157 4.121 8.166 14.418 16.897 0.137 0.385 0.932 408 409 410 411 412 2.157 4.121 8.166 14.418 16.897 attr(,"label") [1] "Fitted values (g)" > residuals(fm3) 1 2 3 4 5 6 7 8 NA NA NA NA NA -0.81724 -2.24772 -0.73203 9 10 11 12 13 14 15 16 0.44774 0.99485 -0.01627 -0.02870 0.05209 0.41153 -0.79366 -1.75724 17 18 19 20 21 22 23 24 -1.45772 1.07274 0.99072 -0.01227 -0.00670 -0.05891 0.34153 0.08634 25 26 27 28 29 30 31 32 -0.91724 -0.67772 3.99797 4.28854 5.05482 -0.01527 0.00130 0.11809 33 34 35 36 37 38 39 40 -0.38847 -1.48366 -2.36724 -2.13772 1.00797 -1.23396 -2.75138 -0.01927 41 42 43 44 45 46 47 48 -0.02470 0.12209 0.24153 1.04634 -1.03724 -1.04772 3.36834 -0.01427 49 50 51 52 53 54 55 56 0.03930 -0.02691 -0.17847 0.14634 -1.44724 -1.52772 -0.35203 1.48684 57 58 59 60 61 62 63 64 3.17632 -0.01827 -0.02270 0.04109 -0.25847 0.22634 -2.10724 -1.31772 65 66 67 68 69 70 71 72 1.98604 0.96822 -0.01727 -0.02470 0.01609 -0.29847 -0.71366 -1.78724 73 74 75 76 77 78 79 80 -1.14772 -1.23203 2.32021 2.92402 0.01073 0.04030 -0.02491 -0.04847 81 82 83 84 85 86 87 88 0.52634 2.19276 1.19228 2.69797 0.03104 0.51632 0.00773 0.10630 89 90 91 92 93 94 95 96 0.17109 0.07153 0.18634 0.35276 -0.88772 4.77797 1.11774 10.61402 97 98 99 100 101 102 103 104 0.01073 0.08130 0.40009 0.73153 0.16634 -0.13724 1.53228 1.58797 105 106 107 108 109 110 111 112 7.86934 4.73482 0.03373 0.05930 0.45509 0.12153 0.98634 3.66276 113 114 115 116 117 118 119 120 -1.04772 1.42797 -0.93606 5.04402 0.01873 0.03030 0.20609 0.28153 121 122 123 124 125 126 127 128 -0.26366 -0.02724 0.83228 1.74797 0.02687 0.68572 0.01873 0.09130 129 130 131 132 133 134 135 136 0.36809 0.42153 0.31634 0.57276 1.52228 3.84797 -1.47226 13.51572 137 138 139 140 141 142 143 144 0.02473 0.06830 0.07309 -0.09847 -0.21366 -0.25724 -1.00772 0.45797 145 146 147 148 149 150 151 152 3.38604 5.81675 0.00973 0.05730 0.36409 0.57153 0.21634 -2.08724 153 154 155 156 157 158 159 160 -0.03772 -0.06203 2.10024 5.61482 -0.07327 -0.12571 -0.36726 -0.53373 161 162 163 164 165 166 167 168 -1.55813 -6.30167 -4.66844 -6.72407 -0.08527 -0.14971 -0.37209 -0.46373 169 170 171 172 173 174 175 176 -1.63980 -3.69048 -5.39225 -6.03907 -0.07627 -0.11571 -0.27959 -0.74206 177 178 179 180 181 182 183 184 -1.71313 -6.67048 -4.83058 -1.09990 -0.07127 -0.16471 -0.41259 -0.68373 185 186 187 188 189 190 191 192 -2.00080 -4.43048 -5.12058 -6.21597 -0.08127 -0.14071 -0.36842 -0.85873 193 194 195 196 197 198 199 200 -0.96480 -4.93548 -5.76891 -8.23907 -0.09127 -0.16971 -0.38909 -0.97539 201 202 203 204 205 206 207 208 -2.29313 -5.58881 -9.43391 -8.54407 -0.07927 -0.11671 -0.23476 -0.75706 209 210 211 212 213 214 215 216 -1.86147 -4.17048 -4.59388 -8.24740 -0.08227 -0.13471 -0.29992 -0.52306 217 218 219 220 221 222 223 224 -1.07313 -1.91281 -6.73225 -5.49540 -0.05027 -0.05371 -0.03926 0.38461 225 226 227 228 229 230 231 232 -0.38980 -2.27548 -0.00558 2.76090 -0.05227 -0.00971 -0.05959 0.49694 233 234 235 236 237 238 239 240 -0.68147 -1.61881 -1.22058 5.51590 -0.04327 -0.03771 -0.29876 0.22294 241 242 243 244 245 246 247 248 1.16920 1.23789 4.61112 4.27460 -0.02127 -0.06371 -0.14892 -0.31206 249 250 251 252 253 254 255 256 -0.55480 -3.05548 -0.56391 0.05927 -0.05227 -0.02971 -0.20409 -0.07373 257 258 259 260 261 262 263 264 -0.09480 -2.21048 3.70112 -1.46573 -0.05727 -0.05271 0.10074 -0.24873 265 266 267 268 269 270 271 272 0.53520 -1.32681 -1.21558 1.96760 0.01273 0.04129 0.47691 0.66294 273 274 275 276 277 278 279 280 0.18187 2.74119 0.08442 -2.35240 -0.03927 -0.00671 0.12474 -0.42373 281 282 283 284 285 286 287 288 -0.30313 -2.31381 8.71842 1.79090 -0.02776 -0.00104 0.23005 0.18344 289 290 291 292 293 294 295 296 -1.25117 1.37221 -1.73490 1.73667 -0.04196 -0.04654 -0.17329 0.36344 297 298 299 300 301 302 303 304 -1.60284 -3.04945 -5.84320 -2.72333 -0.04896 0.22830 0.38338 0.86511 305 306 307 308 309 310 311 312 1.72883 -0.74945 -3.08650 -0.01333 -0.04824 0.21180 0.14338 0.91844 313 314 315 316 317 318 319 320 -0.16284 -2.13279 -3.98153 0.90664 -0.03566 -0.00954 0.99005 0.05011 321 322 323 324 325 326 327 328 0.64383 0.97388 1.42180 1.21164 -0.02720 0.09846 0.37505 1.79844 329 330 331 332 333 334 335 336 0.18383 -0.13445 1.66513 2.67664 -0.03402 0.02963 0.73171 -0.76656 337 338 339 340 341 342 343 344 -1.11950 -1.32112 1.79180 2.17664 -0.06027 -0.01304 -0.18662 0.09011 345 346 347 348 349 350 351 352 0.37383 -2.49112 1.72680 2.03504 0.01178 0.30213 0.64005 1.65677 353 354 355 356 357 358 359 360 0.69050 3.48721 2.95850 1.00004 0.01680 0.20930 0.26838 0.98844 361 362 363 364 365 366 367 368 -0.31784 -0.74945 -0.83820 3.96334 -0.01280 0.36546 0.52671 3.60177 369 370 371 372 373 374 375 376 1.87550 0.80555 2.65350 0.92004 0.04150 0.49596 0.45005 1.47178 377 378 379 380 381 382 383 384 1.07217 -2.97612 1.36180 4.64501 0.00218 0.07096 0.65171 1.89844 385 386 387 388 389 390 391 392 0.38883 -0.00445 4.29680 1.05834 0.02574 0.38880 0.04338 1.35511 393 394 395 396 397 398 399 400 0.38883 -0.38279 3.70013 -0.94999 -0.02653 0.07113 0.43838 -0.01156 401 402 403 404 405 406 407 408 1.70883 0.63721 -2.18320 0.88834 0.00904 0.17880 0.54671 0.44511 409 410 411 412 2.22216 -2.03445 1.99350 0.05004 attr(,"std") [1] NA NA NA NA NA 2.0514 3.0228 3.7679 4.1905 4.3895 [11] 0.0575 0.1274 0.2786 0.5909 1.1714 2.0514 3.0228 4.1905 4.3895 0.0575 [21] 0.1274 0.2786 0.5909 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 [31] 0.1274 0.2786 0.5909 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 [41] 0.1274 0.2786 0.5909 1.1714 2.0514 3.0228 4.1905 0.0575 0.1274 0.2786 [51] 0.5909 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 0.1274 0.2786 [61] 0.5909 1.1714 2.0514 3.0228 4.1905 4.3895 0.0575 0.1274 0.2786 0.5909 [71] 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 0.1274 0.2786 0.5909 [81] 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 0.1274 0.2786 0.5909 [91] 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 0.1274 0.2786 0.5909 [101] 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 0.1274 0.2786 0.5909 [111] 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 0.1274 0.2786 0.5909 [121] 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 0.1274 0.2786 0.5909 [131] 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 0.1274 0.2786 0.5909 [141] 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 0.1274 0.2786 0.5909 [151] 1.1714 2.0514 3.0228 3.7679 4.1905 4.3895 0.0575 0.1137 0.2495 0.5324 [161] 1.0689 2.8919 4.1469 4.4749 0.0575 0.1137 0.2495 0.5324 1.0689 2.8919 [171] 4.1469 4.4749 0.0575 0.1137 0.2495 0.5324 1.0689 2.8919 4.1469 4.4749 [181] 0.0575 0.1137 0.2495 0.5324 1.0689 2.8919 4.1469 4.4749 0.0575 0.1137 [191] 0.2495 0.5324 1.0689 2.8919 4.1469 4.4749 0.0575 0.1137 0.2495 0.5324 [201] 1.0689 2.8919 4.1469 4.4749 0.0575 0.1137 0.2495 0.5324 1.0689 2.8919 [211] 4.1469 4.4749 0.0575 0.1137 0.2495 0.5324 1.0689 2.8919 4.1469 4.4749 [221] 0.0575 0.1137 0.2495 0.5324 1.0689 2.8919 4.1469 4.4749 0.0575 0.1137 [231] 0.2495 0.5324 1.0689 2.8919 4.1469 4.4749 0.0575 0.1137 0.2495 0.5324 [241] 1.0689 2.8919 4.1469 4.4749 0.0575 0.1137 0.2495 0.5324 1.0689 2.8919 [251] 4.1469 4.4749 0.0575 0.1137 0.2495 0.5324 1.0689 2.8919 4.1469 4.4749 [261] 0.0575 0.1137 0.2495 0.5324 1.0689 2.8919 4.1469 4.4749 0.0575 0.1137 [271] 0.2495 0.5324 1.0689 2.8919 4.1469 4.4749 0.0575 0.1137 0.2495 0.5324 [281] 1.0689 2.8919 4.1469 4.4749 0.0644 0.1596 0.3469 0.7251 1.2806 2.3348 [291] 3.8468 4.4219 0.0644 0.1596 0.3469 0.7251 1.2806 2.3348 3.8468 4.4219 [301] 0.0644 0.1596 0.3469 0.7251 1.2806 2.3348 3.8468 4.4219 0.0644 0.1596 [311] 0.3469 0.7251 1.2806 2.3348 3.8468 4.4219 0.0644 0.1596 0.3469 0.7251 [321] 1.2806 2.3348 3.8468 4.4219 0.0644 0.1596 0.3469 0.7251 1.2806 2.3348 [331] 3.8468 4.4219 0.0644 0.1596 0.3469 0.7251 1.2806 2.3348 3.8468 4.4219 [341] 0.0644 0.1596 0.3469 0.7251 1.2806 2.3348 3.8468 4.4219 0.0644 0.1596 [351] 0.3469 0.7251 1.2806 2.3348 3.8468 4.4219 0.0644 0.1596 0.3469 0.7251 [361] 1.2806 2.3348 3.8468 4.4219 0.0644 0.1596 0.3469 0.7251 1.2806 2.3348 [371] 3.8468 4.4219 0.0644 0.1596 0.3469 0.7251 1.2806 2.3348 3.8468 4.4219 [381] 0.0644 0.1596 0.3469 0.7251 1.2806 2.3348 3.8468 4.4219 0.0644 0.1596 [391] 0.3469 0.7251 1.2806 2.3348 3.8468 4.4219 0.0644 0.1596 0.3469 0.7251 [401] 1.2806 2.3348 3.8468 4.4219 0.0644 0.1596 0.3469 0.7251 1.2806 2.3348 [411] 3.8468 4.4219 attr(,"label") [1] "Residuals (g)" > summary(fm3) Generalized nonlinear least squares fit Model: weight ~ SSlogis(Time, Asym, xmid, scal) Data: Soybean AIC BIC logLik 987 1007 -489 Variance function: Structure: Power of variance covariate Formula: ~fitted(.) Parameter estimates: power 0.878 Coefficients: Value Std.Error t-value p-value Asym 17.4 0.525 33.1 0 xmid 51.9 0.598 86.8 0 scal 7.6 0.142 54.0 0 Correlation: Asym xmid xmid 0.788 scal 0.488 0.842 Standardized residuals: Min Q1 Med Q3 Max -2.3066 -0.6545 -0.0019 0.5012 4.9676 Residual standard error: 0.369 Degrees of freedom: 407 total; 404 residual > > options(op)# revert when this file is source()d > > proc.time() user system elapsed 0.461 0.085 0.549 nlme/tests/ss2.rds0000644000176200001440000001127213023551175013575 0ustar liggesusers\{tTչ RQ@2s3^YgPl rˍ 6{&`}!^Z_H%ಊrXZAD^һ>3wB\qf͙w=l 遌@z{q#|?k7Tu<\;M3teg_}<[ggI\1vͣJNդe{xغ‹ÖX|z+ط˭Yo-o7+6eҷW[NJzoeS[Qn?;:SL+}j}J-@sk=Vֽ'ykϣz\u4o;wkgj|_ڛqwgcdud޿35 u\TeәKV<`=q ^gt9^]b/^' W78h\bUܠu6p){^'???n5ioyȘػ-+|},[ v3[-٧[8mKOȥce}얎]{3Gi5-MOrzqk[3^j罼^8n\>맷tOzhti[zubA:]1]g1ÞΫޕpԶh|>ӞZ_yh`ךFi}oo"_?8ީ9 g_>|ɐg[-r)닚w~}ׇ_~}}^}|ݮ^N@FFz+9HoEF{y>c['Ytyׇ_~}ׇ_ߧ>}p $Ӧ5CֈN]efkškdm a:Sî6vх}s)e/9Oȼ_#kGrk`b:0י*谔1[ɮ:Y{g` Ș #{abi?x FzFf< #kvo_r1{`d1#ّYd`ev61f{!6Y_0[3>F xY rY3 ދؼaP8_!_g.]~R>랒 >xvaYQ{>ֵzv+nx-MعFZ̔Պ~L/L9 )<)rRdy2 &*CuKχ%fMpTqII"A6g2S(.+C gL.r|+lTw!=TB?'aTB2_ (QFT8Rv5lQvl Bh6(Q2 i8u Qhl1I1pQh^XG`iGMEmPJ| ;#(GHT6`d:& Lm!,"ULj4"WQ·Ċ"l c]V8*6CXEiY$GvAÊt,Yѱ(ұ:; B`Vp(Cz VrW 4W #TjTĬ:6RWBDF&* Q !dID]w%,Ak!L"侉$Mx~(b Zu75/TAMlo$*)AWWT ѪBhUǴS֧}5LhEZuC#4 k c{MV q>AA̯?jg5Y!WU5<_%R1+>{uۣuUC 3p}&^Lߏ((ZPQ0B8F~*h\/Ŗ{&^8ߚaw S~;)Nw S߳S )P9y,Nnh]gƎ0pe59Y&n<~)K~n_Qًyqāњ^E@_Im|ǁq[)Wpqӣ0?񤐓ͨVEAnf7j_rf;?):J08?}570Z ~*V=]@ g{0 yCXz u'pu*2@_ +V W`G@?wh!w=_,+ lN;W!~qL@\]g]_;]q=ț3U@U r 0e<_O 9- bOw$FW/jاփ ϭ9X>L)%;I OjQXvT)ۗŵ |"?+A~]oЛU3H住 Nlb?+MW_!S]'v #j;0z̓ ~1[)s 7oN*@~xa:V͢b>B<;񅢮97~ s~?C\jB zAo?1EY(]!E !_m7? TJyHzh+cK W- CaQ-~N8}w_̏wS1"?C!*Cr#btm[ܰHb>BPU]Dy~lN]W/UYϊ9u žrG,6pjy/u)m4<4/]ywUGg߱ŧ|_Wg7O5NuJZAh9?XE!)ROkf]A_^: yьi'xzV`F'o]X0aʀi&jׁ~nXP6QG9X93K?h(O6GZP@'`@  `JĀM1)ZXŀNMוI, +Dh8HF<@hD(G$6W,QD Q$ ãS9A5$ў\yDݤ^D:QO,E*D))E5AHiE4*G7Acx zzaz|7B3LuJPR| numIter: ", t1.fix.REML.nlme$numIter, "\n") # 380 or so print(summary(t1.fix.REML.nlme)) print( anova(t1.fix.REML.nlme)) it1.fRn <- try( intervals(t1.fix.REML.nlme) ) ## cannot get .. Non-positive ... }# only if(doExtras()) cat("Time elapsed: ", (proc.time() - .pt)[1:3], "\n") ##=== example 5 mixed non-linear model page 358 nlme ======================= ## ## ex <- "ex5_nlme_page365"; .pt <- proc.time() cat("\n example ", ex,"\n") ## method <- "ML" sigma <- 1 cat("\nFixed sigma= ",sigma," estimation method ", method,"\n") t5.fix.ML.nlme <- nlme(circumference ~ SSlogis(age,Asym,xmid,scal), data = Orange, fixed = Asym + xmid + scal ~ 1, method = method, start = c(192,727,356), control = nlmeControl(sigma = sigma)) (sM5 <- summary(t5.fix.ML.nlme)) (aM5 <- anova (t5.fix.ML.nlme)) (t5.fix.ML.nlme$apVar) ## Non-positive definite [FIXME?] stopifnot( all.equal(fixef(t5.fix.ML.nlme), c(Asym= 192.79023, xmid= 726.36351, scal= 355.62941), tol= 1e-7) , all.equal(sM5$tTable[,"Std.Error"], c(Asym= 14.1688, xmid= 35.3425, scal=16.3637), tol = 5e-5) , all.equal(aM5[,"F-value"], c(4879.5, 208.534, 472.316), tol = 5e-5) ) ## REML method method <-"REML" cat("\nFixed sigma= ",sigma," estimation method ", method,"\n") t5.fix.REML.nlme <- update(t5.fix.ML.nlme, method = method, control = nlmeControl(sigma=sigma), verbose = interactive()) ## converges very quickly (when started from ML!) (sR5 <- summary(t5.fix.REML.nlme)) (aR5 <- anova (t5.fix.REML.nlme)) ( t5.fix.REML.nlme$apVar) ## Non-positive definite [FIXME?] stopifnot( ## ML and REML : fixed effects are very close all.equal(fixef(t5.fix.REML.nlme), fixef(t5.fix.ML.nlme), tol = 1e-6) , all.equal(sR5$tTable[,"Std.Error"], c(Asym= 13.548, xmid= 33.794, scal=15.6467), tol = 5e-5) , all.equal(aR5[,"F-value"], c(5336.29, 228.076, 516.594), tol = 5e-5) ) cat("Time elapsed: ", (proc.time() - .pt)[1:3], "\n") ##=== example 6 linear mixed model page 177 lme ML and REML ================ ## ex <- "ex6_lme_page177"; .pt <- proc.time() cat("\n example ", ex,"\n") ## method <- "ML" sigma <- 1 cat("\nFixed sigma= ",sigma," estimation method ", method,"\n") t6.fix.ML.lme <- lme(distance ~ I(age-11), data = Orthodont, weights = varIdent(form = ~1 | Sex), method = method, control = lmeControl(sigma = sigma)) (sM6 <- summary (t6.fix.ML.lme)) (aM6 <- anova (t6.fix.ML.lme)) (iM6 <- intervals(t6.fix.ML.lme)) stopifnot( all.equal(fixef(t6.fix.ML.lme), c("(Intercept)"= 24.009565, "I(age - 11)"= 0.64760432), tol= 1e-7) , all.equal(sM6$tTable[,"Std.Error"], c("(Intercept)"= 0.426561, "I(age - 11)"= 0.066832), tol = 5e-5) , all.equal(aM6[,"F-value"], c(3162.47, 93.8969), tol = 5e-5) , all.equal(iM6$varStruct["Female",], ## Win 32 c(lower = 0.51230063, ## 0.51226722 est. = 0.65065925, ## 0.65065925 upper = 0.82638482), ## 0.82643872 ## was tol = if(isSun) 4e-4 else 6e-5)#= 4.39e-5 tol = 4e-4) ## seen 5.35e-5 (Sparc Sol., no long double); later, 6e-5 was not ok ## Windows 64bit w/ OpenBLAS 0.2.18 gave 5.721e-05 (Avi A) ## Win-builder (i386) gave 9.584157e-05 ) ##------------- method <- "REML" sigma <- 1 cat("\nFixed sigma= ",sigma," estimation method ", method,"\n") t6.fix.REML.lme <- lme(distance ~I(age-11), data = Orthodont, weights = varIdent(form = ~1 | Sex), method = method, control = lmeControl(sigma = sigma)) (sR6 <- summary (t6.fix.REML.lme)) (aR6 <- anova (t6.fix.REML.lme)) (iR6 <- intervals(t6.fix.REML.lme)) stopifnot( all.equal(fixef(t6.fix.REML.lme), c("(Intercept)"= 24.010662, "I(age - 11)"= 0.64879966), tol= 1e-7) , all.equal(sR6$tTable[,"Std.Error"], c("(Intercept)"= 0.436365, "I(age - 11)"= 0.0687549), tol = 5e-5) , all.equal(aR6[,"F-value"], c(3019.86, 89.046), tol = 5e-5) , all.equal(iR6$varStruct["Female",], ## Win 32 c(lower = 0.51774671, ## 0.51778038 est. = 0.66087796, ## 0.66087807 upper = 0.8435779), ## 0.84352331 ## was tol = if(isSun) 4e-4 else 5e-5)# 4.37e-5 tol = 4e-4) # was 5.63e-5 without long doubles. ) cat("Time elapsed: ", (proc.time() - .pt)[1:3], "\n") ##=== example 7 linear mixed model page 172 lme ML and REML ================ ex <- "ex7_lme_page172"; .pt <- proc.time() cat("\n example ", ex,"\n") method <- "ML" sigma <- 1 cat("\nFixed sigma= ",sigma," estimation method ", method,"\n") set.seed(107) t7.fix.ML.lme <- lme( current ~ voltage + I(voltage^2), data = Wafer, random = list(Wafer = pdDiag(~voltage + I(voltage^2)), Site = pdDiag(~voltage + I(voltage^2)) ), method = method, control = lmeControl(sigma = 1, ## nlminb: false convergence on 32-bit msVerbose = TRUE, opt = "optim")) (ss7 <- summary(t7.fix.ML.lme)) (aa7 <- anova(t7.fix.ML.lme)) stopifnot( all.equal(fixef(t7.fix.ML.lme), c("(Intercept)" = -4.4611657, "voltage" = 5.9033709, "I(voltage^2)" = 1.1704027), tol = 1e-7) , all.equal(ss7$tTable[,"Std.Error"], c("(Intercept)" = 0.446086, "voltage" = 0.608571, "I(voltage^2)"= 0.187459), tol = 5e-5) , all.equal(aa7[,"F-value"], c(2634.2137, 8851.0513, 38.981463), tol = 5e-5) ) ##------------------------------------------------------ REML --- method <- "REML" cat("\nFixed sigma= ",sigma," estimation method ", method,"\n") ## This had 'false convergence' on Solaris using nlminb, and ## optim found a portable answer t7.fix.REML.lme <- lme( current ~ voltage + I(voltage^2), data = Wafer, random = list(Wafer = pdDiag(~voltage + I(voltage^2)), Site = pdDiag(~voltage + I(voltage^2)) ), control = lmeControl(sigma = 1, opt = "optim"), method = method) (sR7 <- summary(t7.fix.REML.lme)) (aR7 <- anova(t7.fix.REML.lme)) stopifnot( all.equal(fixef(t7.fix.REML.lme), fixef(t7.fix.ML.lme), ## should not change much from ML to REML ! tol = 1e-6) , all.equal(sR7$tTable[,"Std.Error"], c("(Intercept)" = 0.44441, "voltage" = 0.606321, "I(voltage^2)"= 0.186754), tol = 5e-5) , all.equal(aR7[,"F-value"], c(2584.9515, 8885.0, 39.2760), tol = 1e-6) ) cat("Time elapsed: ", (proc.time() - .pt)[1:3], "\n") ##=== example 8 mixed non-linear model page 364 nlme ======================= ## ex <- "ex8_nlme_page364"; .pt <- proc.time() ## cat("\n example ", ex,"\n") method <- "ML" sigma <- 1 cat("\nFixed sigma= ",sigma," estimation method ", method,"\n") set.seed(8^2) t8.fix.ML.nlme <- nlme(conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data = Theoph, fixed = lKe + lKa + lCl ~ 1, random = pdDiag(lKe + lKa + lCl ~ 1), method = method, start = c(-2.4,0.5,-3.3), control = nlmeControl(sigma = 1)) (sM8 <- summary(t8.fix.ML.nlme)) (aM8 <- anova (t8.fix.ML.nlme)) stopifnot( all.equal(fixef(t8.fix.ML.nlme), c(lKe = -2.4554999, lKa = 0.44870292, lCl = -3.2296957), tol = 1e-7) , all.equal(sM8$tTable[,"Std.Error"], c(lKe = 0.0739269, lKa = 0.197524, lCl = 0.0683049), tol = 5e-5) , all.equal(aM8[,"F-value"], c(10.9426, 17.4101, 2235.73), tol = 5e-5) ) ## REML method method <- "REML" cat("\nFixed sigma= ",sigma," estimation method ", method,"\n") t8.fix.REML.nlme <- update(t8.fix.ML.nlme, method = method) (sR8 <- summary(t8.fix.REML.nlme)) (aR8 <- anova (t8.fix.REML.nlme)) stopifnot( all.equal(fixef(t8.fix.REML.nlme), fixef(t8.fix.ML.nlme), ## should not change much from ML to REML ! tol = 1e-6) , all.equal(sR8$tTable[,"Std.Error"], c(lKe = 0.073082, lKa = 0.195266, lCl = 0.0675243), tol = 5e-5) , all.equal(aR8[,"F-value"], c(11.1971, 17.815, 2287.72), tol = 5e-5) ) cat("Time elapsed: ", (proc.time() - .pt)[1:3], "\n") ##=== example 9 mixed non-linear model page 365 nlme ======================= ## ex <- "ex9_nlme_page365"; .pt <- proc.time() ## cat("\n example ", ex,"\n") method <- "ML" sigma <- 1 cat("\nFixed sigma= ",sigma," estimation method ", method,"\n") set.seed(909) t9.fix.ML.nlme <- nlme(conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data = Theoph, fixed = lKe + lKa + lCl ~ 1, random = pdDiag( lKa + lCl ~ 1), method = method, start = c(-2.4,0.5,-3.3), control = nlmeControl(sigma = 1)) (sM9 <- summary(t9.fix.ML.nlme)) (aM9 <- anova (t9.fix.ML.nlme)) stopifnot( all.equal(fixef(t9.fix.ML.nlme), c(lKe = -2.4555745, lKa = 0.44894103, lCl = -3.2297273), tol = 1e-7) , all.equal(sM9$tTable[,"Std.Error"], c(lKe = 0.0739266, lKa = 0.197459, lCl = 0.0683082), tol = 5e-5) , all.equal(aM9[,"F-value"], c(10.9669, 17.4108, 2235.56), tol = 5e-5) ) ## REML method method <- "REML" cat("\nFixed sigma= ",sigma," estimation method ", method,"\n") t9.fix.REML.nlme <- update(t9.fix.ML.nlme, method = method) (sR9 <- summary(t9.fix.REML.nlme)) (aR9 <- anova (t9.fix.REML.nlme)) stopifnot( all.equal(fixef(t9.fix.REML.nlme), fixef(t9.fix.ML.nlme), ## should not change much from ML to REML ! tol = 1e-6) , all.equal(sR9$tTable[,"Std.Error"], c(lKe = 0.0730817, lKa = 0.195202, lCl = 0.0675275), tol = 5e-5) , all.equal(aR9[,"F-value"], c(11.2219, 17.8157, 2287.55), tol = 5e-5) ) cat("Time elapsed: ", (proc.time() - .pt)[1:3], "\n") nlme/tests/lmList.R0000644000176200001440000000200313331020316013721 0ustar liggesusers## PR#13788 library(nlme) packageDescription("nlme")# gets the .Library one even in R CMD checking < FIXME ! qm <- lmList(height ~ age | Subject, data = Oxboys) nd <- with(Oxboys, expand.grid(age = seq(min(age),max(age),length=50), Subject = levels(Subject)) ) ## failed in 3.1-92 res <- predict(qm, nd, se=TRUE) stopifnot(is.data.frame(res), dim(res) == c(1300, 3), identical(names(res), c("Subject", "fit", "se.fit"))) req <- ranef(qm) (p.req <- plot(req, xlab = "R.Eff.", ylab = "Subj")) # Fails (p.re2 <- plot(req, age ~ fitted(.))) iqm <- intervals(qm) stopifnot(is.array(iqm), dim(iqm) == c(26,3,2)) p.iq <- plot(iqm, ylab = "Subject [factor]") ## Error: formal argument "ylab" matched by multiple .. in 3.1.137 stopifnot(inherits(p.iq, "trellis"), inherits(p.req, "trellis"), identical( unclass(p.req)[c("xlab","ylab")], list(xlab = "R.Eff.", ylab = "Subj")), formula(p.iq) == (group ~ intervals | what)) p.iq nlme/tests/fitted.R0000644000176200001440000000062212306645031013751 0ustar liggesusers## PR#15678 library(nlme) set.seed(1) X1 <- gl(2,4) X2 <- gl(2,2,8) Y <- rnorm(8) mis.dat <- data.frame(Y = Y,X1 = X1,X2 = X2) mis.dat[3, "Y"] <- NA ## Fit model ----------------------- model <- lme(Y ~ 1, random = ~ 1 | X1/X2, data = mis.dat, na.action = na.omit) summary(model) labs <- with(na.omit(mis.dat), paste(X1, X2, sep = "/" )) fit <- fitted(model) stopifnot(identical(names(fit), labs)) nlme/tests/coef.R0000644000176200001440000000121012627520616013407 0ustar liggesusers## tests of fix for PR#9831 library(nlme) val <- c("10"=1.10,"14"=1.14) vf <- varIdent(value=val, form=~1|age, fixed=c("12"=1.12)) vfi <- Initialize(vf,Orthodont) vfi str(vfi) stopifnot( all.equal(coef(vfi), c(0.0953101798043, 0.131028262406)), all.equal(coef(vfi, unconstrained = FALSE, allCoef = TRUE), c("8" = 1, "10" = 1.1, "14" = 1.14, "12" = 1.12))) vfiCopy <- vfi # copy of an initialized object length(vfiCopy) # length is 2 coef(vfiCopy) <- c(11,12) # error in 3.1-84 stopifnot(identical(coef(vfiCopy), c(11,12))) ## error in 3.1-84 (gls. <- gls(distance ~ age, weights = vfi, data=Orthodont)) nlme/tests/augPred_lab.R0000644000176200001440000000563513573672302014720 0ustar liggesuserslibrary(nlme) if(require("Hmisc")) { T.aug <- Orthodont label(T.aug$age) <- 'anyL' foo <- augPred(lme(distance ~ age, random = ~1|Subject, data=T.aug)) ## failed in 3.1-72 } ## failed even if there is a variable with a class that is not being used. T.aug <- Orthodont T.aug$newage <- T.aug$age class(T.aug$newage) <- 'anyC' foo <- augPred(lme(distance ~ age, random = ~1|Subject, data=T.aug)) ## failed in 3.1-72 ## [Bug 16715] New: nlme: unable to use predict and augPredict functions in non linear mixed models ## Date: Wed, 17 Feb 2016 M1.lis <- nlsList( SSlogis, data=Soybean) ## prints "Error in qr.solve(QR.B, cc): singular matrix 'a' in solve" ## ==> MM: 2016-03-11 "fixed": now prints it as warning [you could suppress or catch] ## ==> one NA row '1989P8' in this: M1.lis ## Nonlinear Logistic Growth -- each of the 3 par. (Asym, xmid, scal) has RE term ## Model: weight ~ SSlogis(Time, Asym, xmid, scal) | Plot M1.nlme <- nlme( M1.lis ) summary(M1.nlme) ## R 3.2.2 (nlme 3.1-121) : ## Nonlinear mixed-effects model fit by maximum likelihood ## Model: weight ~ SSlogis(Time, Asym, xmid, scal) ## Data: Soybean ## AIC BIC logLik ## 1499.671 1539.881 -739.8354 ## Random effects: ## Formula: list(Asym ~ 1, xmid ~ 1, scal ~ 1) ## Level: Plot ## Structure: General positive-definite, Log-Cholesky parametrization ## StdDev Corr ## Asym 5.201186 Asym xmid ## xmid 4.197467 0.721 ## scal 1.404737 0.711 0.958 ## Residual 1.123461 ## Fixed effects: list(Asym ~ 1, xmid ~ 1, scal ~ 1) ## Value Std.Error DF t-value p-value ## Asym 19.25301 0.8031921 362 23.97062 0 ## xmid 55.01985 0.7272721 362 75.65235 0 ## scal 8.40333 0.3152893 362 26.65276 0 ## Correlation: ## Asym xmid ## xmid 0.724 ## scal 0.620 0.807 ## Standardized Within-Group Residuals: ## Min Q1 Med Q3 Max ## -6.08691772 -0.22160816 -0.03390491 0.29741145 4.84688248 ## Number of Observations: 412 ## Number of Groups: 48 M1.Fix <- fixef(M1.nlme) ## add fixed effect 'Variety' : M2.nlme <- update(M1.nlme, fixed = Asym + xmid + scal ~ Variety, start = c(M1.Fix[1], 1, M1.Fix[2], 1, M1.Fix[3], 1)) summary(M2.nlme) pred.m2 <- predict(M2.nlme, level = 0:1) stopifnot(is.data.frame(pred.m2), dim(pred.m2) == c(412, 3)) augp.m2 <- augPred(M2.nlme, level = 0:1) ## failed in nlme-3.1-124/5 stopifnot(is.data.frame(augp.m2), dim(augp.m2) == c(5308, 4) , all.equal(colMeans(augp.m2[,c("Time","weight")]), c(Time = 48.585908, weight =7.8599693), tolerance = 1e-6)# was 1e-7, 2e-9 but failed with ATLAS builds , identical(c(table(augp.m2[,".type"])), c(predict.fixed = 2448L, predict.Plot = 2448L, original = 412L)) , identical(c(table(as.vector(table(augp.m2[,".groups"])))), c("110" = 33L, "111" = 2L, "112" = 13L)) ) nlme/tests/nlme-stall.R0000644000176200001440000000526713336503465014564 0ustar liggesusers## Taken from https://stat.ethz.ch/pipermail/r-devel/2018-January/075459.html ## Hung with x86_64 Linux/gcc 7.3 but not i686 Linux nor x86_64 macOS ## in early 2018. Resolved by nlme 3.1-136. ## Optional since it used to hang, on one platform only AFAWK. ## gfortran with -fbounds-check detected a problem on one x86_64 ## Fedora 26 system (but not another) and on one of winbuilder's ## subarchs. if(!nzchar(Sys.getenv("TEST-NLME-STALL"))) q('no') dat <- data.frame( x = c(3.69, 3.69, 3.69, 3.69, 3.69, 3.69, 3.69, 3.69, 3.69, 3.69, 3.69, 3.69, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 1.61, 1.61, 1.61, 1.61, 1.61, 1.61, 1.61, 1.61, 1.61, 1.61, 1.61, 1.61, 0.92, 0.92, 0.92, 0.92, 0.92, 0.92, 0.92, 0.92, 0.92, 0.92, 0.92, 0.92, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, -0.47, -0.47, -0.47, -0.47, -0.47, -0.47, -0.47, -0.47, -0.47, -0.47, -0.47, -0.47, -1.86, -1.86, -1.86, -1.86, -1.86, -1.86, -1.86, -1.86, -1.86, -1.86, -1.86, -1.86), y = c(0.35, 0.69, 0.57, 1.48, 6.08, -0.34, 0.53, 1.66, 0.02, 4.4, 8.42, 3.3, 2.32, -2.3, 7.52, -2.12, 3.41, -4.76, 7.9, 5.04, 10.26, -1.42, 7.85, -1.88, 3.81, -2.59, 4.32, 5.7, 1.18, -1.74, 1.81, 6.16, 4.2, -0.39, 1.55, -1.4, 1.76, -4.14, -2.36, -0.24, 4.8, -7.07, 1.34, 1.98, 0.86, -3.96, -0.61, 2.68, -1.65, -2.06, 3.67, -0.19, 2.33, 3.78, 2.16, 0.35, -5.6, 1.32, 2.99, 4.21, -0.9, 4.32, -4.01, 2.03, 0.9, -0.74, -5.78, 5.76, 0.52, 1.37, -0.9, -4.06, -0.49, -2.39, -2.67, -0.71, -0.4, 2.55, 0.97, 1.96, 8.13, -5.93, 4.01, 0.79, -5.61, 0.29, 4.92, -2.89, -3.24, -3.06, -0.23, 0.71, 0.75, 4.6, 1.35, -3.35), f.block = rep(1:4, 24), id = paste0("a", rep(c(2,1,3), each = 4))) dd <- dat set.seed(33) dd$y <- dat$y + rnorm(nrow(dat), mean = 0, sd = 0.1) library(nlme) fpl.B.range <- function(lx,A,B,C,D) A/(1+exp(-B*(lx-C))) + D INIT <- c(A.a1=1, A.a2=0, A.a3=0, B = 1, B.a2=0, B.a3=0, C = 0, C.a2=0, C.a3=0, D = 1, D.a2=0, D.a3=0) ## Typically this will fail with a singularity, but it should not hang. try(nlme(y ~ fpl.B.range(x,A,B,C,D), data = dd, fixed = list(A ~ id, B ~ id, C ~ id, D ~ id), random = list(f.block = pdSymm(A+B+C+D ~ 1)), start = INIT, # control= nlmeControl(## NB: msMaxIter=200, ## gives singularity error at iter.55 # msVerbose=TRUE), #==> passed as 'trace' to nlminb() verbose = TRUE)) -> res ## it stalls, I need to kill the R process ## -- [on lynne Fedora 26 (4.14.11-200.fc26.x86_64), Jan.2018] ## in R 3.4.3 and R 3.4.3 patched with nlme 3.1.131 ## and R-devel with nlme 3.1.135 summary(warnings())# mostly "Singular precision matrix in level -1, block *" nlme/src/0000755000176200001440000000000013543314757012010 5ustar liggesusersnlme/src/nlmefit.c0000644000176200001440000011153113543314757013614 0ustar liggesusers/* Routines for calculation of the log-likelihood or restricted log-likelihood with mixed-effects models. Copyright (C) 2007-2019 The R Core Team Copyright (C) 1997-2005 Douglas M. Bates , Jose C. Pinheiro, Saikat DebRoy This file is part of the nlme package for R and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #include #include "nlmefit.h" #include "matrix.h" #include "pdMat.h" // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions static double *_sigma_; /* This to provide msmnh out-of-band the sigma. */ extern void F77_NAME(msmnh)(); static int ** setOffsets(int ** base, int * ngrp, int Qp2) { int i, **ptrVec = Calloc((size_t) Qp2, int *); for (i = 0; i < Qp2; i++) { ptrVec[i] = *base; *base += ngrp[i]; } return ptrVec; } dimPTR dims(int *pdims) { /* constructor for a dims object */ dimPTR value = Calloc((size_t) 1, struct dim_struct); int *base, Qp2, *ngrp; value->N = (int) pdims[0]; value->ZXrows = pdims[1]; value->ZXcols = pdims[2]; value->Q = pdims[3]; Qp2 = (value->Q) + 2; value->Srows = pdims[4]; value->q = pdims + 5; ngrp = value->ngrp = value->q + Qp2; value->DmOff = value->ngrp + Qp2; value->ncol = value->DmOff + Qp2; value->nrot = value->ncol + Qp2; base = value->nrot + Qp2; value->ZXoff = setOffsets(&base, ngrp, Qp2); value->ZXlen = setOffsets(&base, ngrp, Qp2); value->SToff = setOffsets(&base, ngrp, Qp2); value->DecOff = setOffsets(&base, ngrp, Qp2); value->DecLen = setOffsets(&base, ngrp, Qp2); return value; } SEXP getListElement(SEXP list, char *str) { SEXP elmt = R_NilValue, names = getAttrib(list, R_NamesSymbol); int i; for (i = 0; i < length(list); i++) if(strcmp(CHAR(STRING_ELT(names, i)), str) == 0) { elmt = VECTOR_ELT(list, i); break; } return elmt; } dimPTR /* create a dimensions object directly */ dimS(SEXP d) /* from an SEXP */ { int i, Qp2; SEXP tmp; dimPTR value = Calloc((size_t) 1, struct dim_struct); value->N = INTEGER(coerceVector(getListElement(d, "N"), INTSXP))[0]; value->ZXrows = INTEGER(coerceVector(getListElement(d, "ZXrows"), INTSXP))[0]; value->ZXcols = INTEGER(coerceVector(getListElement(d, "ZXcols"), INTSXP))[0]; value->Q = INTEGER(coerceVector(getListElement(d, "Q"), INTSXP))[0]; value->Srows = INTEGER(coerceVector(getListElement(d, "Srows"), INTSXP))[0]; Qp2 = value->Q + 2; value->q = INTEGER(coerceVector(getListElement(d, "q"), INTSXP)); value->ngrp = INTEGER(coerceVector(getListElement(d, "ngrp"), INTSXP)); value->DmOff = INTEGER(coerceVector(getListElement(d, "DmOff"), INTSXP)); value->ncol = INTEGER(coerceVector(getListElement(d, "ncol"), INTSXP)); value->nrot = INTEGER(coerceVector(getListElement(d, "nrot"), INTSXP)); value->ZXoff = Calloc(Qp2, int *); PROTECT(tmp = coerceVector(getListElement(d, "ZXoff"), VECSXP)); for (i = 0; i < Qp2; i++) { (value->ZXoff)[i] = INTEGER(coerceVector(VECTOR_ELT(tmp, i), INTSXP)); } UNPROTECT(1); value->ZXlen = Calloc(Qp2, int *); PROTECT(tmp = coerceVector(getListElement(d, "ZXlen"), VECSXP)); for (i = 0; i < Qp2; i++) { (value->ZXlen)[i] = INTEGER(coerceVector(VECTOR_ELT(tmp, i), INTSXP)); } UNPROTECT(1); value->SToff = Calloc(Qp2, int *); PROTECT(tmp = coerceVector(getListElement(d, "SToff"), VECSXP)); for (i = 0; i < Qp2; i++) { (value->SToff)[i] = INTEGER(coerceVector(VECTOR_ELT(tmp, i), INTSXP)); } UNPROTECT(1); value->DecOff = Calloc(Qp2, int *); PROTECT(tmp = coerceVector(getListElement(d, "DecOff"), VECSXP)); for (i = 0; i < Qp2; i++) { (value->DecOff)[i] = INTEGER(coerceVector(VECTOR_ELT(tmp, i), INTSXP)); } UNPROTECT(1); value->DecLen = Calloc(Qp2, int *); PROTECT(tmp = coerceVector(getListElement(d, "DecLen"), VECSXP)); for (i = 0; i < Qp2; i++) { (value->DecLen)[i] = INTEGER(coerceVector(VECTOR_ELT(tmp, i), INTSXP)); } UNPROTECT(1); return value; } void dimFree(dimPTR this) { Free(this->DecOff); Free(this->DecLen); Free(this->SToff); Free(this->ZXlen); Free(this->ZXoff); Free(this); } int count_DmHalf_pars( dimPTR dd, int *pdClass ) { int i, result; for ( i = 0, result = 0; i < dd->Q; i++ ) { switch( pdClass[ i ] ) { case 0: case 4: result += ( (dd->q)[ i ] * ( (dd->q)[ i ] + 1 ) ) / 2; break; case 1: result += (dd->q)[ i ]; break; case 2: result += 1; break; case 3: result += 2; } } return result; } double * generate_DmHalf( double *DmHalf, dimPTR dd, int *pdClass, double *pars ) { /* Expand parameters to DmHalf arrays */ int i, j, q, Q = dd->Q; double diag; for (i = 0; i < Q; i++) { q = (dd->q)[ i ]; switch (pdClass[i]) { case 0: /* default: unstructured */ matrixLog_pd( DmHalf + (dd->DmOff)[ i ], dd->q + i, pars ); pars += (q * (q + 1))/2; break; case 1: /* diagonal */ for (j = 0; j < q; j++) { DmHalf[ (dd->DmOff)[i] + j * (q + 1) ] = exp( *pars++ ); } break; case 2: /* multiple of identity */ diag = exp( *pars ); for (j = 0; j < q; j++) { DmHalf[ (dd->DmOff)[i] + j * (q + 1) ] = diag; } pars++; break; case 3: /* compound symmetry */ compSymm_pd( DmHalf + (dd->DmOff)[ i ], dd->q + i, pars ); pars += 2; break; case 4: /* unstructured with log-cholesky parametrization */ logChol_pd(DmHalf + (dd->DmOff)[ i ], dd->q + i, pars ); pars += (q * (q + 1))/2; break; } } return DmHalf; } #ifdef Debug static void print_mat( char *msg, double *x, int ldx, int nrow, int ncol ) { /* print matrix and message */ int i, j; printf( "%s\n", msg ); for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { printf( " %10.5g", x[i + j * ldx ] ); } printf( "\n" ); } printf( "\n" ); } #endif /* Debug */ static double * scale_mat(double *y, int ldy, double a, double *x, int ldx, int nrow, int ncol) { /* y <- a * x */ int i, j; double * ret = y; for (j = 0; j < ncol; j++) { for (i = 0; i < nrow; i++) { y[i] = a * x[i]; } y += ldy; x += ldx; } return ret; } static double * plus_equals_mat(double *y, int ldy, double *x, int ldx, int nrow, int ncol) { /* y <- y + x */ double * ret = y; int i, j; for (j = 0; j < ncol; j++) { for (i = 0; i < nrow; i++) { y[i] += x[i]; } y += ldy; x += ldx; } return ret; } static int /* backsolve and update */ backsolve(double *mat, int ldmat, int nupdate, int ncol, int nrot, int ny) { int i, j, ONE = 1, info; double *y = mat + (int) ((ncol + nrot - ny) * ldmat); mat = mat - (int) nupdate; for (i = 0; i < ny; i++) { /* usually ny = 1 but just in case ... */ F77_CALL(dtrsl) (mat + (int) nupdate, &ldmat, &ncol, y, &ONE, &info); if (info != 0) { return info; } for (j = 0; j < ncol; j++) { d_axpy(y - (int) nupdate, - y[j], mat + (int) (j * ldmat), nupdate); } y += (int) ldmat; } return info; } static int /* invert an upper-triangular matrix in place*/ invert_upper(double *mat, int ldmat, int ncol) { int i, j, ONE = 1, info = 0; double *b = Calloc((size_t) ncol, double); for (i = ncol; i > 1; i--) { for (j = 0; j < (i - 1); j++) { b[j] = 0.0; } b[((int) i) - 1] = 1.0; F77_CALL(dtrsl) (mat, &ldmat, &i, b, &ONE, &info); if (info != 0) { Free(b); return info; } Memcpy(mat + (i - 1) * ldmat, b, (int) i); } if (*mat == 0.0) { Free(b); return 1; } *mat = 1.0 / (*mat); Free(b); return 0; } static int /* invert a block in the virtual R array */ invert_block(double *mat, int ldmat, int nabove, int ncol, int nright) { double * tpblk = mat - (int) nabove; int info = invert_upper(mat, ldmat, ncol); if (info != 0) return info; if (nright > 0) { double *ntri = Calloc((size_t) (ncol * ncol), double), *rtblk = mat + ncol * ldmat; scale_mat(ntri, ncol, -1.0, mat, ldmat, ncol, ncol); mult_mat(rtblk, ldmat, ntri, ncol, ncol, ncol, rtblk, ldmat, nright); Free(ntri); if (nabove > 0) { double *tmp = Calloc((size_t)(nabove * nright), double); plus_equals_mat(rtblk - (size_t)nabove, ldmat, mult_mat(tmp, nabove, tpblk, ldmat, nabove, ncol, rtblk, ldmat, nright), nabove, nabove, nright); Free(tmp); } } if (nabove > 0) { mult_mat(tpblk, ldmat, tpblk, ldmat, nabove, ncol, mat, ldmat, ncol); } return 0; } void /* return the decomposition for ZXy */ mixed_decomp(double *ZXy, int *pdims) { dimPTR dd = dims(pdims); /* Create a dimensions structure */ internal_decomp(dd, ZXy); dimFree(dd); } void internal_decomp(dimPTR dd, double *ZXy) { /* decompose ZXy and re-write the dims */ int i, j, Qp2 = (dd->Q) + 2; double *dc; if ((dd->Srows) >= (dd->ZXrows)) /* decomposition is not worthwhile */ return; dc = Calloc((size_t) ((dd->Srows) * (dd->ZXcols)), double); for (i = 0; i < Qp2; i++) { for(j = 0; j < (dd->ngrp)[i]; j++) { QR_and_rotate(ZXy + (dd->ZXoff)[i][j], dd->ZXrows, (dd->ZXlen)[i][j], (dd->ncol)[i] + (dd->nrot)[i], DNULLP, 0, (dd->ncol)[i], DNULLP, dc + (dd->SToff)[i][j], dd->Srows); } } Memcpy(ZXy, dc, dd->Srows * dd->ZXcols); for (i = 0; i < Qp2; i++) { /* re-write the offsets and lengths */ for (j = 0; j < (dd->ngrp)[i]; j++) { (dd->ZXoff)[i][j] = (dd->DecOff)[i][j]; (dd->ZXlen)[i][j] = (dd->DecLen)[i][j]; } } dd->ZXrows = dd->Srows; /* and the total number of rows */ Free(dc); } double /* evaluate the log-likelihood pieces */ internal_loglik(dimPTR dd, double *ZXy, double *DmHalf, int *RML, double *dc, double *lRSS, // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Sol. double *sigma) { /* if dc is NULL, don't attempt storage */ int i, j, Q = dd->Q, Qp2 = Q + 2, qi, ldstr = (dc != DNULLP) ? (dd->Srows) : 0; double accum, *dmHlf, *lglk = Calloc( Qp2, double ); QRptr dmQR; for (i = 0; i < Qp2; i++) { qi = (dd->q)[i]; for (j = 0; j < (dd->ngrp)[i]; j++) { if (qi > QR_and_rotate(ZXy + (dd->ZXoff)[i][j], dd->ZXrows, (dd->ZXlen)[i][j], (dd->ncol)[i] + (dd->nrot)[i], DmHalf + (dd->DmOff)[i], qi, (dd->ncol)[i], lglk + i, dc + (dd->SToff)[i][j], ldstr)) { warning("Singular precision matrix in level %ld, block %ld", (long int) (i - (dd->Q)), j + 1); return -DBL_MAX; } } } for(i = 0, accum = 0; i < Q; i++) { qi = (dd->q)[i]; dmHlf = Calloc( (size_t) qi * qi, double ); dmQR = QR( copy_mat( dmHlf, qi, DmHalf + (dd->DmOff)[i], qi, qi, qi ), qi, qi, qi); accum += (dd->ngrp)[i] * QRlogAbsDet( dmQR ) - lglk[i]; QRfree( dmQR ); Free( dmHlf ); } // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions if (*sigma > 0) { // Fixed sigma double h = 0; if (*RML == 1) { h += (lglk[Q] - dd->ncol[Q]*lglk[Q+1]) - 1; } accum -= pow(exp(lglk[Q+1]),2)/(2*pow(*sigma,2)); accum -= (dd->N - dd->ncol[Q]) * log(*sigma); accum -= h; } else { // Free sigma accum -= *RML * lglk[Q] + (dd->N - *RML * dd->ncol[Q]) * lglk[Q + 1]; } if (lRSS != DNULLP) { *lRSS = lglk[Q+1]; } Free(lglk); return accum; } void internal_estimate(dimPTR dd, double *dc) { /* solve for Beta and b_i estimates */ int i, j, Qp1 = (dd->Q) + 1; for (i = (dd->Q); i >= 0; i--) { for (j = 0; j < (dd->ngrp)[i]; j++) { if (backsolve(dc + (dd->SToff)[i][j], dd->Srows, (dd->SToff)[i][j] - (dd->DecOff)[i][j], (dd->ncol)[i], (dd->nrot)[i], (dd->ncol)[Qp1]) != 0) { error(_("Singularity in backsolve at level %ld, block %ld"), (long int) (i - (dd->Q)), j + 1); } } } } static void internal_R_invert(dimPTR dd, double *dc) { /* Invert the virtual R matrix in place */ int i, j; for (i = (dd->Q); i >= 0; i--) { for (j = 0; j < (dd->ngrp)[i]; j++) { invert_block(dc + (dd->SToff)[i][j], dd->Srows, (dd->SToff)[i][j] - (dd->DecOff)[i][j], (dd->ncol)[i], (dd->nrot)[i] - 1); } } } static double cube_root_eps = 0.; static double * pt_prod( double *prod, double *a, double *b, size_t len ) { /* prod <- a * b */ int i; double *ret = prod; for (i = 0; i < len; i++) { *prod++ = *a++ * *b++; } return ret; } static void finite_diff_Hess(double (*func)(double*,double*), double *pars, int npar, double *vals, // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Sol. double *sigma) { /* use Koshal design for finite-differences */ double nT = 1 + npar + (npar * ((double) npar + 1)) / 2;// against integer overflow if((nT * nT) > (double) SIZE_MAX) error(_("Too many parameters for finite-difference Hessian; npar = %d, nTot = %g."), npar, nT); size_t nTot = (size_t) nT; double *ppt, *xpt, *dpt, *incr = Calloc( npar, double), *parray = Calloc( nTot * npar, double), /* array of parameters */ *div = Calloc( nTot, double), /* divisors */ *Xmat = Calloc( nTot * nTot, double); /* regressor matrix */ QRptr xQR; if (cube_root_eps == 0.0) cube_root_eps = exp( log( DOUBLE_EPS ) / 3.); div[ 0 ] = 1.0; ppt = parray + npar * ( 2 * npar + 1 ); /* location of first cross term */ xpt = Xmat + nTot * ( 2 * npar + 1 ); /* location of first cross column */ dpt = div + 2 * npar + 1; size_t np_i = npar; for (int i = 0; i < npar; i++, np_i++) { // np_i === npar + i size_t np1 = (size_t) npar + 1; incr[i] = (pars[ i ] != 0.0) ? cube_root_eps * pars[ i ] : cube_root_eps; div[ i + 1 ] = 1.0 / incr[ i ]; div[ np_i + 1 ] = 2.0 / ( incr[ i ] * incr[ i ] ); parray[ npar + i * np1 ] = 1.; parray[ np_i * np1 ] = -1.; for (int j = i + 1; j < npar; j++) { ppt[ i ] = ppt[ j ] = 1; ppt += npar; } for (size_t j = 0; j < nTot; j++) { Xmat[ j + (i + 1) * nTot ] = parray[ i + j * npar ]; } pt_prod( Xmat + (np_i + 1) * nTot, Xmat + (i + 1) * nTot, Xmat + (i + 1) * nTot, nTot ); for (int j = 0; j < i; j++) { pt_prod( xpt, Xmat + (i + 1) * nTot, Xmat + (j + 1) * nTot, nTot ); xpt += nTot; *dpt++ = 1.0 / ( incr[ i ] * incr[ j ] ); } } #ifdef Debug print_mat( "parray", parray, npar, npar, nTot ); #endif /* Debug */ vals[ 0 ] = (*func)( pars, sigma ); // 17-11-2015; Fixed sigma patch ... Xmat[ 0 ] = 1.0; for (size_t i = 1; i < nTot; i++) { Xmat[i] = 1.0; /* column of 1's for constant */ Memcpy( parray, pars, npar ); for (int j = 0; j < npar; j++) { parray[ j ] += parray[ j + i * npar ] * incr[ j ]; } vals[i] = (*func)( parray, sigma ); // 17-11-2015; Fixed sigma patch ... } #ifdef Debug print_mat( "Xmat", Xmat, nTot, nTot, nTot ); #endif /* Debug */ xQR = QR( Xmat, (int) nTot, (int) nTot, (int) nTot ); QRsolve( xQR, vals, (int) nTot, 1, vals, (int) nTot ); pt_prod( vals, vals, div, nTot ); /* re-arrange the Hessian terms */ xpt = vals + npar + 1; Memcpy( div, vals + npar + 1, nTot - ( npar + 1 ) ); dpt = div + npar; /* first off-diagonal */ for (int i = 0; i < npar; i++) { xpt[ i * ( npar + 1 ) ] = div[ i ]; /* diagonals */ for (int j = 0; j < i; j++) { xpt[ i + j * npar ] = xpt[ j + i * npar ] = *dpt++; } } QRfree( xQR ); Free( incr ); Free( parray ); Free( div ); Free( Xmat ); return; } /* objective function for optif9(), itself called from * nlme_increment() [../nlme.c] and mixed_combined() below */ void mixed_fcn(int n, double *pars, double *g, void *state) { statePTR st = (statePTR) state; double *zxcopy = Calloc(st->dd->ZXrows * st->dd->ZXcols, double), *Delta = Calloc(st->dd->DmOff[st->dd->Q], double); Memcpy(zxcopy, st->ZXy, st->dd->ZXrows * st->dd->ZXcols); *g = -internal_loglik(st->dd, zxcopy, generate_DmHalf(Delta, st->dd, st->pdClass, pars), st->RML, DNULLP, DNULLP, st->sigma);// 17-11-2015; Fixed sigma .. Free(Delta); Free(zxcopy); } void // gradient for optif9() of objective function mixed_fcn() see above mixed_grad(int n, double *pars, double *g, void *state) { statePTR st = (statePTR) state; double *zxcopy = Calloc(st->dd->ZXrows * st->dd->ZXcols, double), *Delta = Calloc(st->dd->DmOff[st->dd->Q], double), *dc = Calloc((size_t) ((st->dd->Srows) * (st->dd->ZXcols)), double), *DmHalf, sigmainv, *pt, *res; double sqrtDF = sqrt((double) (st->dd->N - *(st->RML)*(st->dd->ncol[st->dd->Q]))); int i, j, offset; DmHalf = generate_DmHalf(Delta, st->dd, st->pdClass, pars), Memcpy(zxcopy, st->ZXy, st->dd->ZXrows * st->dd->ZXcols); /* needed ? */ internal_loglik(st->dd, zxcopy, DmHalf, st->RML, dc, DNULLP, st->sigma);// Fixed sigma internal_estimate(st->dd, dc); internal_R_invert(st->dd, dc); // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions if (*st->sigma > 0) { sigmainv = 1.0/(*st->sigma); } else { sigmainv = *(dc + (size_t)((st->dd->Srows) * (st->dd->ZXcols)) - 1)/sqrtDF; if (sigmainv == 0) { error(_("Overfitted model!")); } else { sigmainv = 1.0/((sigmainv < 0.0) ? - sigmainv : sigmainv); } } offset = ((st->dd->ZXcols) - 1) * (st->dd->Srows); for (i = 0; i < (st->dd->Q); i++) { int ncol = (st->dd->q)[i], nright = (st->dd->nrot)[i] - (st->dd->nrot)[(st->dd->Q) - ( (*(st->RML)) ? 0 : 1 )]; int nrow = (ncol + nright + 1) * (st->dd->ngrp)[i]; QRptr qq; pt = res = Calloc((size_t) (ncol * nrow), double); for (j = 0; j < (st->dd->ngrp)[i]; j++) { copy_trans(pt, nrow, dc + (st->dd->SToff)[i][j], st->dd->Srows, ncol, ncol + nright); pt += ncol + nright; scale_mat(pt++, nrow, sigmainv, dc + offset + (st->dd->SToff)[i][j], 1, 1, ncol); } offset -= (st->dd->Srows) * ncol; qq = QR(res, nrow, nrow, ncol); QRstoreR(qq, res, ncol); QRfree(qq); switch (st->pdClass[i]) { case 0: /* unstructured with matrix-logarithm parametrization */ error(_("analytic gradient is not available with matrix logarithm")); break; case 1: /* diagonal */ for (j = 0; j < ncol; j++) { double tmp = DmHalf[ (st->dd->DmOff)[i] + j * (ncol + 1)]; *g++ = st->dd->ngrp[i] - tmp*tmp*d_sum_sqr(res + j * ncol, j + 1); } break; case 2: /* multiple of identity */ { double tmp = 0.0; for(j = 0; j < ncol; j++) { tmp += d_sum_sqr( res + j * nrow, j + 1 ); } *g = tmp; tmp = DmHalf[ (st->dd->DmOff)[i] + j * (ncol + 1)]; *g *= tmp * tmp; *g = ncol*st->dd->ngrp[i] - *g; g++; break; } case 3: /* compound symmetry */ { error(_("analytic gradient is not available with compound symmetry")); break; } case 4: /* unstructured with log-cholesky parametrization */ { int j1; double *col_j = Calloc(ncol, double); for (j1 = 0; j1 < ncol; j1++) { int i1; for(i1 = 0; i1 < j1; i1++) col_j[i1] = d_dot_prod(res + i1*ncol, 1, res + j1*ncol, 1, 1+i1); for(i1 = j1; i1 < ncol; i1++) col_j[i1] = d_dot_prod(res + i1*ncol, 1, res + j1*ncol, 1, 1+j1); for (i1 = 0; i1 <= j1; i1++) { int k1; double sum = 0.0; for (k1 = i1; k1 < ncol; k1++) { sum += DmHalf[(st->dd->DmOff)[i] + i1*ncol + k1] * col_j[k1]; } if (i1 == j1) *g++ = st->dd->ngrp[i] - sum*DmHalf[(st->dd->DmOff)[i] + i1*(ncol + 1)]; else *g++ = -sum; } } break; } } Free(res); } Free(dc); Free(Delta); Free(zxcopy); } /* In gcc we can use nested function definitions but not for other compilers */ static double *zxcopy, *zxcopy2, *Delta, *values; static dimPTR dd; static int *setngs, *pdC; size_t zxdim; static double logLik_fun( double *pars, double *sigma) // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions { /* defined for finite differences */ Memcpy( zxcopy2, zxcopy, zxdim ); return internal_loglik(dd, zxcopy2, generate_DmHalf( Delta, dd, pdC, pars ), setngs, DNULLP, DNULLP, sigma ); // 17-11-2015; Fixed sigma ... } static double negLogLik_fun( double *pars, double *sigma) // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions { /* defined for finite differences */ Memcpy( zxcopy2, zxcopy, zxdim ); return - internal_loglik(dd, zxcopy2, generate_DmHalf( Delta, dd, pdC, pars ), setngs, DNULLP, DNULLP, sigma ); // 17-11-2015; Fixed sigma ... } void mixed_loglik(double *ZXy, int *pdims, double *pars, int *settings, double *logLik, double *lRSS, double *sigma) // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions { /* evaluate the log-likelihood */ dd = dims(pdims); /* settings gives RML, asDelta, gradHess, and pdClass in that order */ if (settings[ 1 ]) { /* gradHess not used and pdClass ignored */ *logLik = internal_loglik( dd, ZXy, pars, settings, DNULLP, lRSS, sigma); // 17-11-2015; ... } else { /* generate the Delta arrays from pars */ setngs = settings; pdC = setngs + 3; Delta = Calloc( (dd->DmOff)[ dd->Q ], double ); if (settings[ 2 ] == 0) { /* no gradient or Hessian */ *logLik = internal_loglik( dd, ZXy, generate_DmHalf( Delta, dd, pdC, pars ), settings, DNULLP, lRSS, sigma ); // 17-11-2015; ... } else { int npar = count_DmHalf_pars( dd, pdC ); zxdim = (dd->ZXrows) * (dd->ZXcols); zxcopy = Calloc( zxdim, double ); zxcopy2 = ZXy; Memcpy( zxcopy, ZXy, zxdim ); finite_diff_Hess( logLik_fun, pars, npar, logLik, sigma); // 17-11-2015; ... Free( zxcopy ); } Free( Delta ); } dimFree( dd ); } void /* loglikelihood and parameter estimates */ mixed_estimate(double *ZXy, int *pdims, double *DmHalf, int *RML, double *logLik, double *dc, int *invert, // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Sol.: double *sigma) { /* dc receives the decomposed ZXy array */ dimPTR dd = dims(pdims); *logLik = internal_loglik(dd, ZXy, DmHalf, RML, dc, DNULLP, sigma); internal_estimate(dd, dc); if (*invert != 0) { internal_R_invert( dd, dc ); } dimFree(dd); } void /* EM iterations for mixed-effects models */ internal_EM(dimPTR dd, double *ZXy, double *DmHalf, int nn, int *pdClass, int *RML, double *logLik, double *Ra, double *lRSS, // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions: double *sigma) { double sigmainv, *res, *pt, *dc = Calloc((size_t) ((dd->Srows) * (dd->ZXcols)), double), *zxcopy = Calloc((size_t) ((dd->ZXrows) * (dd->ZXcols)), double); double sqrtDF = sqrt((double) (dd->N - *RML * (dd->ncol[dd->Q]))); int i, j, k, offset; while (nn-- > 0) { copy_mat(zxcopy, dd->ZXrows, ZXy, dd->ZXrows, dd->ZXrows, dd->ZXcols); *logLik = internal_loglik(dd, zxcopy, DmHalf, RML, dc, DNULLP, sigma); internal_estimate( dd, dc ); internal_R_invert( dd, dc ); // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions if (*sigma > 0) { sigmainv = 1.0/(*sigma); } else { sigmainv = *(dc + (size_t)((dd->Srows) * (dd->ZXcols)) - 1)/sqrtDF; if (sigmainv == 0.) { error(_("Overfitted model!")); } else { sigmainv = 1.0/((sigmainv < 0.0) ? - sigmainv : sigmainv); } } offset = ((dd->ZXcols) - 1) * (dd->Srows); for (i = 0; i < (dd->Q); i++) { int ncol = (dd->q)[i], nright = (dd->nrot)[i] - (dd->nrot)[(dd->Q) - ( (*RML) ? 0 : 1 )]; int nrow = (ncol + nright + 1) * (dd->ngrp)[i]; QRptr qq; pt = res = Calloc((size_t) (ncol * nrow), double); for (j = 0; j < (dd->ngrp)[i]; j++) { copy_trans(pt, nrow, dc + (dd->SToff)[i][j], dd->Srows, ncol, ncol + nright); pt += ncol + nright; scale_mat(pt++, nrow, sigmainv, dc + offset + (dd->SToff)[i][j], 1, 1, ncol); } offset -= (dd->Srows) * ncol; qq = QR(res, nrow, nrow, ncol); QRstoreR(qq, Ra + (dd->DmOff)[i], ncol); QRfree(qq); scale_mat(res, nrow, sqrt(1.0/((dd->ngrp)[i])), Ra + (dd->DmOff)[i], ncol, ncol, ncol); switch (pdClass[i]) { case 0: case 4: /* default: unstructured */ invert_upper(res, nrow, ncol); copy_trans(DmHalf + (dd->DmOff)[i], ncol, res, nrow, ncol, ncol); break; case 1: /* diagonal */ for (j = 0; j < ncol; j++) { DmHalf[ (dd->DmOff)[i] + j * (ncol + 1)] = 1. / sqrt( d_sum_sqr( res + j * nrow, j + 1 ) ); } break; case 2: /* multiple of identity */ { double aux = 0.0; for(j = 0; j < ncol; j++) { aux += d_sum_sqr( res + j * nrow, j + 1 ); } aux = sqrt(ncol / aux); for(j = 0; j < ncol; j++) { DmHalf[(dd->DmOff)[i] + j * (ncol + 1)] = aux; } } break; case 3: /* compound symmetry */ { double trA = 0.0, trAJ = 0.0, *auxRes; int l; for(j = 0; j < ncol; j++) { for(k = 0; k <= j; k++) { trA += res[k + j * nrow] * res[k + j * nrow]; for(l = j + 1; l < ncol; l++) { trAJ += res[k + j * nrow] * res[k + l * nrow]; } } } trAJ = 2 * trAJ + trA; trA = (ncol - 1) / (ncol * trA - trAJ); trAJ = 1/trAJ - trA; trA = ncol * trA + trAJ; auxRes = DmHalf + (dd->DmOff[i]); for(j = 0; j < ncol; j++) { auxRes[j * (ncol + 1)] = trA; for(k = (j + 1); k < ncol; k++) { auxRes[j * ncol + k] = auxRes[j + k * ncol] = trAJ; } } F77_CALL(chol)(auxRes, &ncol, &ncol, auxRes, &l); } break; } Free(res); } } copy_mat(zxcopy, dd->ZXrows, ZXy, dd->ZXrows, dd->ZXrows, dd->ZXcols); *logLik = internal_loglik(dd, zxcopy, DmHalf, RML, dc, lRSS, // 17-11-2015; Fixed sigma patch : sigma); Free(dc); Free(zxcopy); } void mixed_EM(double *ZXy, int *pdims, double *DmHalf, int *nIter, int *pdClass, int *RML, double *logLik, double *Ra, double *lRSS, // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions double *sigma) { dimPTR dd = dims(pdims); internal_EM(dd, ZXy, DmHalf, *nIter, pdClass, RML, logLik, Ra, lRSS, sigma); dimFree(dd); } void /* to be called by Fortran msmnh */ mixed_calcf(int *n, double *theta, int *nf, double *f, int *uiparm, double *urparm, void (*ufparm)(void)) { Memcpy( zxcopy2, zxcopy, zxdim ); *f = - internal_loglik(dd, zxcopy2, generate_DmHalf( Delta, dd, pdC, theta ), setngs, DNULLP, DNULLP, // 17-11-2015; Fixed sigma patch; E van Willigen; Quant.Sol. _sigma_ ); } void /* to be called by Fortran msmnh */ mixed_calcgh(int *n, double *theta, int *nf, double *g, double *h, int *uiparm, double *urparm, void (*ufparm)(void)) { int i, nn = *n; double *hpt = values + nn + 1; finite_diff_Hess(negLogLik_fun, theta, (int) nn, values, // 17-11-2015; Fixed sigma patch; E van Willigen; Quant.Sol. _sigma_ ); Memcpy( g, values + 1, nn ); for( i = 1; i <= nn; i++ ) { /* copy upper triangle of Hessian */ Memcpy( h, hpt, i ); h += i; hpt += nn; } } static double * crossprod_mat(double *y, int ldy, double *x, int ldx, int nrow, int ncol) /* y <- t(x) %*% x */ { int i, j; for( i = 0; i < ncol; i++ ) { y[ i * ldy + i ] = d_dot_prod( x + i * ldx, 1, x + i * ldx, 1, nrow ); for( j = 0; j < i; j++) { y[ i * ldy + j ] = y[ j * ldy + i ] = d_dot_prod( x + i * ldx, 1, x + j * ldx, 1, nrow ); } } return y; } /* Forming the parameter structure from the Delta matrix */ /* Not sure if these will ever be called from S. */ /* Will leave open the possibility. */ static void Delta2MatrixLog( double *theta, int *q, double *Delta ) { int i, j, qq = *q, one = 1, info = 0; if ( qq == 1 ) { *theta = log(*Delta * *Delta)/2.; } else { double *vectors = Calloc((size_t) qq * qq, double), *DtransD = Calloc((size_t) qq * qq, double), *workmat = Calloc((size_t) qq * qq, double), *work2 = Calloc((size_t) qq, double), *values = Calloc((size_t) qq, double), *pt; crossprod_mat(DtransD, qq, Delta, qq, qq, qq); /* form t(Delta) %*% Delta */ F77_CALL(rs) (q, q, DtransD, values, &one, vectors, workmat, work2, &info); if (info != 0) { error(_("Unable to form eigenvalue-eigenvector decomposition [RS(.) ierr = %d]"), info); } copy_mat(workmat, qq, vectors, qq, qq, qq); for(i = 0; i < qq; i++) { values[i] = log(values[i])/2; for(j = 0; j < qq; j++) { workmat[i * qq + j] *= values[i]; } } copy_trans(DtransD, qq, workmat, qq, qq, qq); mult_mat(workmat, qq, vectors, qq, qq, qq, DtransD, qq, qq); for( i = 0, pt = theta; i < qq; i++ ) { for( j = 0; j <= i; j++ ) { *pt++ = workmat[ i * qq + j ]; } } Free(vectors); Free(DtransD); Free(workmat), Free(work2); Free(values); } } static void Delta2LogCholesky(double *theta, int *q, double *Delta ) { int i, qq = *q, info = 0; if ( qq == 1 ) { *theta = log(*Delta * *Delta)/2.; } else { double *ll = theta + qq, *DtransD = Calloc((size_t) qq * qq, double); crossprod_mat(DtransD, qq, Delta, qq, qq, qq); /* form t(Delta) %*% Delta */ F77_CALL(chol) (DtransD, &qq, &qq, Delta, &info); /* re-writes Delta */ if (info != 0) error(_("Unable to form Cholesky decomposition: the leading minor of order %d is not pos.def."), info); *theta = log(Delta[0]); for(i = 1; i < qq; i++) { theta[i] = log(Delta[i * (qq + 1)]); Memcpy(ll, Delta + i * qq, i); ll += i; } Free(DtransD); } } double * generate_theta( double *theta, dimPTR dd, int *pdClass, double *DmHalf ) { /* Expand parameters to DmHalf arrays */ int i, j, q, Q = dd->Q; for (i = 0; i < Q; i++) { q = (dd->q)[ i ]; switch (pdClass[i]) { case 0: /* default: unstructured */ Delta2MatrixLog( theta, dd->q + i, DmHalf + (dd->DmOff)[ i ] ); theta += (q * (q + 1))/2; break; case 1: /* diagonal */ for (j = 0; j < q; j++) { *theta++ = log( DmHalf[ (dd->DmOff)[i] + j * (q + 1) ] ); } break; case 2: /* multiple of identity */ *theta++ = log( DmHalf[(dd->DmOff)[i]] ); break; case 3: /* compound symmetry */ error(_("Haven't written the compound symmetry case for this yet")); break; case 4: /* default: unstructured */ Delta2LogCholesky( theta, dd->q + i, DmHalf + (dd->DmOff)[ i ] ); theta += (q * (q + 1))/2; break; } } return theta; } // This is called _only_ from R's nlme :: simulate.lme(): void /* both EM and Newton-Raphson iterations */ mixed_combined(double *ZXy, int *pdims, double *DmHalf, int *nIter, int *pdClass, int *RML, double *logLik, double *R0, double *lRSS, int *info, // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions double *sigma) { int i, j; double *Ra, *dc, *work; dd = dims(pdims); /* Using global dd, pdC, setngs, and Delta */ pdC = pdClass; setngs = RML; dc = Calloc((size_t) ((dd->Srows) * (dd->ZXcols)), double); Ra = Calloc( dd->DmOff[dd->Q], double); internal_decomp( dd, ZXy ); /* take decomp if useful */ /* check for non-zero entries in DmHalf */ if ( d_sum_sqr( DmHalf, dd->DmOff[ dd->Q ]) == 0. ) { work = ZXy; /* create starting estimates */ Delta = DmHalf; for( i = 0; i < dd->Q; i++ ) { for ( j = 0; j < (dd->q)[i]; j++ ) { *Delta = 0.375 * sqrt( d_sum_sqr( work, dd->ZXrows ) / (dd->ngrp)[i]); Delta += (dd->q)[i] + 1; work += dd->ZXrows; } Delta -= (dd->q)[i]; /* have moved too far - step back */ } } internal_EM(dd, ZXy, DmHalf, *nIter, pdClass, RML, logLik, Ra, lRSS, sigma); // 17-11-2015; Fixed sigma patch ... { statePTR st = Calloc(1, struct state_struct); int ntheta = count_DmHalf_pars( dd, pdC ), itrmcd, itncnt, p = dd->ncol[dd->Q], iagflg; double *theta = Calloc(ntheta, double), *typsiz = Calloc(ntheta, double), *grad = Calloc(ntheta, double), *newtheta = Calloc(ntheta, double), *a = Calloc(ntheta * ntheta, double), *work = Calloc(ntheta * 9, double); st->dd = dd; st->ZXy = ZXy; st->pdClass = pdClass; st->RML = RML; st->sigma = sigma; // 17-11-2015; Fixed sigma patch; ... generate_theta(theta, dd, pdClass, DmHalf); *info = 9; /* don't inhibit checks but suppress output */ for (i = 0; i < ntheta; i++) { typsiz[i] = 1.0; } /* iagflg = 1; */ iagflg = 0; for (i = 0; i < dd->Q; i++) { if (pdClass[i] < 1 || pdClass[i] == 3 || pdClass[i] > 4) { iagflg = 0; break; } } optif9(ntheta, ntheta, theta, (fcn_p) mixed_fcn, (fcn_p) mixed_grad, (d2fcn_p) 0, st, typsiz, 1.0 /*fscale*/, 1 /*method*/,1 /*iexp*/, info, -1 /*ndigit*/, 50 /*itnlim*/, iagflg, 0 /*iahflg*/, 1. /*dlt*/, pow(DBL_EPSILON, 0.25) /*gradtl*/, 0. /*stepmx*/, sqrt(DBL_EPSILON) /*steptl*/, newtheta, logLik, grad, &itrmcd, a, work, &itncnt); if (*info == 0) { *logLik = internal_loglik( dd, ZXy, generate_DmHalf( DmHalf, dd, pdC, theta ), setngs, dc, lRSS, // 17-11-2015; Fixed sigma patch ... : sigma ); copy_mat(R0, p, dc + (dd->SToff)[(dd->Q)][0], (dd->Srows), p, p + 1); } Free(work); Free(a); Free(newtheta); Free(grad); Free(typsiz); Free(theta); Free(st); } dimFree( dd ); Free( dc ); Free( Ra ); } /* functions for calculating df's for fixed effects tests */ static double inner_perc(double *x, int *grp, int n) /* percentage of groups for which x is inner */ { /* x - column of X matrix to be assessed grp - integer vector with groups n - length of x and grp data are assumed to be ordered by grp */ int currGrp, nn = 0, isInner; double nInner = 0., nGrp = 0., currVal; while (nn < n) { currGrp = grp[nn]; currVal = x[nn]; nGrp++; isInner = 0; do { if (isInner == 0 && x[nn] != currVal) { nInner++; isInner = 1; } nn++; } while (nn < n && currGrp == grp[nn]); } return(nInner/nGrp); } void inner_perc_table(double *X, int *grps, int *p, int *Q, int *n, double *pTable) /* constructs an p x Q "inner-percentage" table for a fixed effects matrix X and a set of grouping vectors grps */ { int i, j, pp = *p, nn = *n, ipp = 0, inn = 0; for(i = 0; i < *Q; i++) { for(j = 0; j < pp; j++) { pTable[j + ipp] = inner_perc(X + j * nn, grps + inn, nn); } ipp += pp; inn += nn; } } /* gls functions */ void gls_loglik(double *Xy, int *pdims, double *logLik, double *lRSS, // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions double *sigma) { int i, N = pdims[0], p = pdims[1], RML = pdims[2], Np1 = N + 1, Nr = N - RML * p, rnkm1; QRptr dmQR; dmQR = QR(Xy, N, N, p + 1); rnkm1 = (dmQR->rank) - 1; if(rnkm1 != p) { *logLik = -DBL_MAX; } else { // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions double f; *lRSS = log(f=fabs (dmQR->mat[p * Np1])); if (*sigma > 0) { // fixed sigma double h = 0; if (RML == 1) { for(i = 0; i < p; i++) { h += log(fabs(dmQR->mat[i * Np1])); } } *logLik -= pow(f,2)/(2*pow(*sigma,2)); *logLik -= Nr * log(*sigma); *logLik -= h; } else { // estimated sigma (default) *logLik -= (((double)Nr) * (*lRSS)); if (RML == 1) { for (i = 0; i < p; i++) { *logLik -= log(fabs(dmQR->mat[i * Np1])); } } } } QRfree(dmQR); } #if 0 /* gls functions */ void gls_loglik(double *Xy, int *pdims, double *logLik, double *lRSS) { int i, N = pdims[0], p = pdims[1], RML = pdims[2], Np1 = N + 1, Nr = N - RML * p; QRptr dmQR; dmQR = QR(Xy, N, N, p + 1); *lRSS = log(fabs(dmQR->mat[p * Np1])); *logLik -= Nr * (*lRSS); if (RML == 1) { for(i = 0; i < p; i++) { *logLik -= log(fabs(dmQR->mat[i * Np1])); } } QRfree(dmQR); } #endif void gls_estimate(double *Xy, int *pdims, double *beta, double *sigma, double *logLik, double *varBeta, int *rank, int *pivot) { int i, N = pdims[0], p = pdims[1], RML = pdims[2], pp1 = p + 1, Nr = N - RML * p, rk, rkm1, rkp1; QRptr dmQR; double *R = Calloc((size_t) (pp1 * pp1), double); dmQR = QR(Xy, N, N, pp1); *rank = rk = dmQR->rank; rkm1 = rk - 1; rkp1 = rk + 1; Memcpy(pivot, dmQR->pivot, pp1); for(i = 0; i < rk; i++) { Memcpy(R + i * rk, dmQR->mat + i * N, i + 1); } // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions if (*sigma > 0) { // fixed sigma double h = 0; *logLik = fabs(R[rk * rk - 1]); if (RML == 1) { // RML for(i=0; i typedef struct QR_struct { double *mat, *qraux; int *pivot, rank, ldmat, nrow, ncol; } *QRptr; extern void d_axpy(double *, double, double *, int); extern double d_dot_prod(double *, int, double *, int, int); extern double d_sum_sqr( double *, int); extern double *copy_mat(double *, int, double *, int, int, int); extern double *copy_trans(double *, int, double *, int, int, int); extern double *mult_mat(double *, int, double *, int, int, int, double *, int, int); extern QRptr QR(double *, int, int, int); extern void QRfree(QRptr); extern int QRqty(QRptr, double *, int, int); extern int QRsolve(QRptr, double *, int, int, double *, int); extern double QRlogAbsDet(QRptr); extern void QRstoreR(QRptr, double *, int); extern int QR_and_rotate(double *, int, int, int, double *, int, int, double *, double *, int); #endif /* NLME_MATRIX_H */ nlme/src/nlmefit.h0000644000176200001440000000772113245275713013623 0ustar liggesusers /* header file for the nlme package Copyright 2007-2018 The R Core Team Copyright 1999-2001 Saikat DebRoy, Douglas Bates This file is part of the nlme package for R and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #ifndef NLME_NLMEFIT_H #define NLME_NLMEFIT_H #include "base.h" #include // for nlm internals #include // for R_CheckUserInterrupt() typedef struct dim_struct { int N, /* number of observations in original data */ ZXrows, /* number of rows in ZXy */ ZXcols, /* number of columns in ZXy */ Q, /* number of levels of random effects */ Srows, /* number of rows in decomposition */ *q, /* dimensions of the random effects */ *ngrp, /* numbers of groups at each level */ *DmOff, /* offsets into the DmHalf array */ *ncol, /* no. of columns decomposed at each level */ *nrot, /* no. of columns rotated at each level */ **ZXoff, /* offsets into ZXy */ **ZXlen, /* groups lengths */ **SToff, /* offsets into storage */ **DecOff, /* offsets into decomposition */ **DecLen; /* decomposition group lengths */ } *dimPTR; typedef struct state_struct { dimPTR dd; double *ZXy; int *pdClass, *RML; double *sigma; // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions } *statePTR; extern dimPTR dims(int *); extern dimPTR dimS(SEXP); extern int count_DmHalf_pars(dimPTR, int *); extern double * generate_theta(double *, dimPTR, int *, double *); extern double * generate_DmHalf(double *, dimPTR, int *, double *); extern void dimFree(dimPTR); extern void mixed_decomp(double *, int *); extern void mixed_fcn(int, double *, double *, void *); extern void mixed_grad(int, double *, double *, void *); extern void internal_decomp(dimPTR, double *); extern void mixed_loglik(double *, int *, double *, int *, double *, double *, double *); // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions extern double internal_loglik(dimPTR, double *, double *, int *, double *, double *, double *); // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions extern void mixed_estimate(double *, int *, double *, int *, double *, double *, int *, double *); // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions extern void internal_estimate(dimPTR, double *); extern void mixed_EM(double *, int *, double *, int *, int *, int *, double *, double *, double *, double *); // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions extern void internal_EM(dimPTR, double *, double *, int, int *, int *, double *, double *, double *, double *); // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions extern void mixed_combined(double *, int *, double *, int *, int *, int *, double *, double *, double *, int *, double *); // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions extern void mixed_calcf(int *, double *, int *, double *, int *, double *, void (*)(void)); extern void mixed_calcgh(int *, double *, int *, double *, double *, int *, double *, void (*)(void)); extern void gls_loglik(double *, int *, double *, double *, double *); // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions extern void gls_estimate(double *, int *, double *, double *, double *, double *, int *, int *); #endif /* NLME_NLMEFIT_H */ nlme/src/pdMat.h0000644000176200001440000000176412657657003013235 0ustar liggesusers/* header file for the nlme package Copyright 1999 Saikat DebRoy Copyright 2007-2016 The R Core Team This file is part of the nlme package for R and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #ifndef NLME_PDMAT_H #define NLME_PDMAT_H #include "base.h" extern void compSymm_pd(double *, int *, double *); extern void matrixLog_pd(double *, int *, double *); extern void logChol_pd(double *, int *, double *); #endif /* NLME_BASE_H */ nlme/src/init.c0000644000176200001440000001357213462266240013120 0ustar liggesusers/* Copyright 2005-2018 The R Core Team This file is part of the nlme package for R and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #include #include #include #include #include "nlmefit.h" #include "nlOptimizer.h" #include "pdMat.h" extern void corStruct_factList(double *, int *, double *, double *); extern void corStruct_recalc(double *, int *, int *, double *); extern void symm_fullCorr(double *, int *, double *); extern void symm_matList(double *, int *, int *, int *, double *); extern void symm_factList(double *, int *, int *, int *p, double *, double *); extern void symm_recalc(double *, int *, int *, double *, int *, int *, double *); extern void nat_fullCorr(double *, int *, double *); extern void nat_matList(double *, int *, int *, int *, double *); extern void nat_factList(double *, int *, int *, int *, double *, double *); extern void nat_recalc(double *, int *, int *l, double *, int *, int *, double *); extern void AR1_matList(double *, int *, double *); extern void AR1_factList(double *, int *, double *, double *); extern void AR1_recalc(double *, int *, int *, double *, double *); extern void CAR1_matList(double *, double *, int *, double *); extern void CAR1_factList(double *, double *, int *, double *, double *); extern void CAR1_recalc(double *Xy, int *pdims, int *ZXcol, double *par, double *time, double *logdet); extern void ARMA_constCoef(int *, int *, double *); extern void ARMA_unconstCoef(int *, int *, double *); extern void ARMA_matList(double *, int *, int *, int *, int *, int *, double *); extern void ARMA_factList(double *, int *, int *, int *, int *, int *, double *, double *); extern void ARMA_recalc(double *, int *, int *, double *, int *, int *, int *, int *, double *); extern void compSymm_matList(double *, double *, int *, double *); extern void compSymm_factList(double *, double *, int *, double *, double *); extern void compSymm_recalc(double *, int *, int *, double *, double *, double *); extern void spatial_matList(double *, int *, double *, int *, double *, double *); extern void spatial_factList(double *, int *, double *, int *, double *, double *, double *); extern void spatial_recalc(double *, int *, int *, double *, double *, double *, int *, double *); extern void fit_nlme(double *, double *, int *, int *, int *, double *, double *, int *, double *, double *, int *, int *, double *, SEXP model); extern void nlme_one_comp_first (int *, double *, double *); extern void nlme_one_comp_open (int *, double *, double *); extern void inner_perc_table(double *, int *, int *, int *, int *, double *); extern void natural_pd(double *, int *, double *); R_CMethodDef CEntries[] = { {"corStruct_factList", (DL_FUNC) &corStruct_factList, 4}, {"corStruct_recalc", (DL_FUNC) &corStruct_recalc, 4}, {"symm_factList", (DL_FUNC) &symm_factList, 6}, {"symm_matList", (DL_FUNC) &symm_matList, 5}, {"symm_fullCorr", (DL_FUNC) &symm_fullCorr, 3}, {"symm_recalc", (DL_FUNC) &symm_recalc, 7}, {"nat_factList", (DL_FUNC) &nat_factList, 6}, {"nat_matList", (DL_FUNC) &nat_matList, 5}, {"nat_fullCorr", (DL_FUNC) &nat_fullCorr, 3}, {"nat_recalc", (DL_FUNC) &nat_recalc, 7}, {"AR1_factList", (DL_FUNC) &AR1_factList, 4}, {"AR1_matList", (DL_FUNC) &AR1_matList, 3}, {"AR1_recalc", (DL_FUNC) &AR1_recalc, 5}, {"CAR1_factList", (DL_FUNC) &CAR1_factList, 5}, {"CAR1_matList", (DL_FUNC) &CAR1_matList, 4}, {"CAR1_recalc", (DL_FUNC) &CAR1_recalc, 6}, {"ARMA_constCoef", (DL_FUNC) &ARMA_constCoef, 3}, {"ARMA_unconstCoef", (DL_FUNC) &ARMA_unconstCoef, 3}, {"ARMA_factList", (DL_FUNC) &ARMA_factList, 8}, {"ARMA_matList", (DL_FUNC) &ARMA_matList, 7}, {"ARMA_recalc", (DL_FUNC) &ARMA_recalc, 9}, {"compSymm_factList", (DL_FUNC) &compSymm_factList, 5}, {"compSymm_matList", (DL_FUNC) &compSymm_matList, 4}, {"compSymm_recalc", (DL_FUNC) &compSymm_recalc, 6}, {"spatial_factList", (DL_FUNC) &spatial_factList, 7}, {"spatial_matList", (DL_FUNC) &spatial_matList, 6}, {"spatial_recalc", (DL_FUNC) &spatial_recalc, 8}, {"gls_loglik", (DL_FUNC) &gls_loglik, 5}, // 17-11-2015; Fixed sigma ... {"gls_estimate", (DL_FUNC) &gls_estimate, 8}, {"fit_gnls", (DL_FUNC) &fit_gnls, 10}, {"inner_perc_table", (DL_FUNC) &inner_perc_table, 6}, {"mixed_loglik", (DL_FUNC) &mixed_loglik, 7}, // 17-11-2015; Fixed sigma ... {"mixed_decomp", (DL_FUNC) &mixed_decomp, 2}, {"mixed_EM", (DL_FUNC) &mixed_EM, 10}, // 17-11-2015; Fixed sigma ... {"nlme_one_comp_first", (DL_FUNC) &nlme_one_comp_first, 3}, {"nlme_one_comp_open", (DL_FUNC) &nlme_one_comp_open, 3}, {"fit_nlme", (DL_FUNC) &fit_nlme, 14}, // 17-11-2015; Fixed sigma ... {"matrixLog_pd", (DL_FUNC) &matrixLog_pd, 3}, {"logChol_pd", (DL_FUNC) &logChol_pd, 3}, {"natural_pd", (DL_FUNC) &natural_pd, 3}, {"compSymm_pd", (DL_FUNC) &compSymm_pd, 3}, {"mixed_estimate", (DL_FUNC) &mixed_estimate, 8}, // 17-11-2015; Fixed sigma ... {"mixed_combined", (DL_FUNC) &mixed_combined, 11}, {NULL, NULL, 0} }; void #ifdef HAVE_VISIBILITY_ATTRIBUTE __attribute__ ((visibility ("default"))) #endif R_init_nlme(DllInfo *dll) { R_registerRoutines(dll, CEntries, NULL, NULL, NULL); R_useDynamicSymbols(dll, FALSE); R_forceSymbols(dll, TRUE); } nlme/src/pdMat.c0000644000176200001440000000622112657657003013221 0ustar liggesusers/* Routines for dealing with pdMat objects Copyright 1997-2005 Douglas M. Bates , Jose C. Pinheiro, Saikat DebRoy Copyright 2007-2016 The R Core Team This file is part of the nlme package for R and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #include "pdMat.h" #include "matrix.h" /* Positive definite matrices */ static void Chol_pd(double *L, int *q, double *l) { int i, qq = *q; for(i = 0; i < qq; i++) { Memcpy(L + i * qq, l, i + 1); l += i + 1; } } void /* general pd, logChol parametrization */ logChol_pd(double *L, int *q, double *l) { int i, qq = *q; double *ll = l + qq; L[0] = exp(*l); for(i = 1; i < qq; i++) { L[i * (qq + 1)] = exp(l[i]); Memcpy(L + i * qq, ll, i); ll += i; } } void matrixLog_pd(double *L, int *q, double *l) { int i, j, qq = *q, one = 1L, info = 0L; if ( qq == 1 ) { *L = exp( *l ); } else { double *vectors = Calloc((size_t) qq * qq, double), *work1 = Calloc((size_t) qq, double), *work2 = Calloc((size_t) qq, double), *values = Calloc((size_t) qq, double); Chol_pd(L, q, l); for(i = 0; i < qq - 1; i++) { copy_mat(L + (i * (qq + 1) + 1), 1L, L + i * (qq + 1) + qq, qq, 1L, qq - (i + 1)); } F77_CALL(rs) (q, q, L, values, &one, vectors, work1, work2, &info); for(i = 0; i < qq; i++) { values[i] = exp(values[i]); for(j = 0; j < qq; j++) { vectors[i * qq + j] *= values[i]; } } copy_trans(L, qq, vectors, qq, qq, qq); Free(vectors); Free(work1); Free(work2); Free(values); } } void natural_pd(double *L, int *q, double *l) /* natural parametrization */ { int i, j, qp1 = *q + 1, info; double *std = l, *corr = l + *q, *work = Calloc(*q, double); for(i = 0; i < *q; i++) std[i] = exp(std[i]); for(i = 0; i < *q; i++) { L[i * qp1] = std[i] * std[i]; for(j = i + 1; j < *q; j++) { *corr = exp(*corr); *corr = (*corr - 1)/(*corr + 1); L[i * (*q) + j] = L[j * (*q) + i] = std[i] * std[j] * (*corr); corr++; } } F77_CALL(chol) (L, q, q, L, &info); Free(work); } void compSymm_pd(double *L, int *q, double *l) /* compound symmetry */ { int i, j, qp1 = *q + 1; double aux = exp(l[0]), aux1 = exp(l[1]), aux2; aux1 = (aux1 - 1.0/((double) *q - 1.0))/(aux1 + 1.0); aux2 = aux * sqrt(1.0 - aux1); aux1 = aux * sqrt((1.0 + (*q - 1.0) * aux1) / ((double) *q)); for(i = 0; i < *q; i++) { L[i * (*q)] = aux1; } for(i = 1; i < *q; i++) { aux = -aux2/sqrt(i * (i + 1)); for(j = 0; j < i; j++) { L[i + (j * (*q))] = aux; } L[i * qp1] = -aux * i; } } nlme/src/gnls.c0000644000176200001440000001346013053502555013112 0ustar liggesusers/* Routines for fitting gnls models Copyright 1997-2005 Douglas M. Bates , Jose C. Pinheiro, Saikat DebRoy Copyright 2007-2016 The R Core Team This file is part of the nlme package for R and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #include "nlOptimizer.h" #include "matrix.h" #include "nlmefit.h" extern void corStruct_recalc(double *, int *, int *, double *); /* gnls functions and variables */ typedef struct gnls_struct { /* Generalized nonlinear least squares structure */ double *residuals, *gradient, *corFactor, *varWeights, minFactor, tolerance, *newtheta, *theta, *incr, *add_ons, new_objective, objective; double *result[1]; int corOpt, varOpt, npar, ncol, N, nrdof, maxIter, *corDims; SEXP model; int conv_failure; } *gnlsPtr; static gnlsPtr gnls_init(double *ptheta, int *dims, double *corFactor, double *varWeights, int *corDims, double *settings, double *additional, int corOpt, int varOpt, SEXP model) { int nResult, npar = dims[0], // == p = pLen N = dims[1]; // == NReal == length(additional) gnlsPtr gnls = Calloc(1, struct gnls_struct); gnls->theta = ptheta; gnls->corFactor = corFactor; gnls->varWeights = varWeights; gnls->corDims = corDims; gnls->npar = npar; gnls->N = N; gnls->nrdof = N - npar; gnls->ncol = npar + 1; gnls->maxIter = (int) settings[0]; gnls->minFactor = settings[1]; gnls->tolerance = settings[2]; gnls->newtheta = Calloc(npar, double); gnls->incr = Calloc(npar, double); gnls->varOpt = varOpt; gnls->corOpt = corOpt; gnls->add_ons = additional; gnls->model = model; gnls->result[0] = DNULLP; nResult = evaluate(ptheta, npar, model, gnls->result); gnls->result[0] = Calloc(nResult, double); return gnls; } static void gnlsFree( gnlsPtr gnls ) { Free(gnls->newtheta); Free(gnls->incr); Free(gnls->result[0]); Free(gnls); } static double gnls_objective(gnlsPtr gnls) { int i, j; if(gnls->varOpt) { /* variance function correction */ for(i = 0; i < gnls->N; i++) { for(j = 0; j < gnls->ncol; j++) { *(gnls->result[0] + i + j * gnls->N) *= gnls->varWeights[i]; } } } if(gnls->corOpt) { /* correlation structure correction */ corStruct_recalc(gnls->result[0], gnls->corDims, &gnls->ncol, gnls->corFactor); } gnls->residuals = gnls->result[0] + gnls->npar * gnls->N; gnls->gradient = gnls->result[0]; return(d_sum_sqr(gnls->residuals, gnls->N)); } static double gnls_increment(gnlsPtr gnls) { if (sqrt_eps == 0.0) sqrt_eps = sqrt(DOUBLE_EPS); double* auxRes = Calloc(gnls->N, double); Memcpy(auxRes, gnls->residuals, gnls->N); QRptr aQR = QR(gnls->gradient, gnls->N, gnls->N, gnls->npar); QRsolve(aQR, gnls->residuals, gnls->N, 1L, gnls->incr, gnls->npar); QRqty(aQR, auxRes, gnls->N, 1L); double regSS = 0.; for(int i=0; i < gnls->npar; i++) { regSS += auxRes[i] * auxRes[i]; } QRfree(aQR); Free(auxRes); return(sqrt(((double) gnls->nrdof) * regSS / ((double) gnls->npar) * (gnls->new_objective - regSS))); } static int gnls_iterate(gnlsPtr gnls) { double factor, criterion; int iteration; SEXP model = gnls->model; Memcpy(gnls->newtheta, gnls->theta, gnls->npar); evaluate(gnls->theta, gnls->npar , model, gnls->result); gnls->new_objective = gnls->objective = gnls_objective(gnls); gnls->conv_failure = 0; for (factor = 1.0, iteration = 1; iteration <= gnls->maxIter; iteration++) { /* outer iteration loop */ /* increment and convergence criterion */ criterion = gnls_increment(gnls); if (gnls->conv_failure) return(iteration); /* Unable to make increment */ if (criterion < gnls->tolerance) return(iteration); /* successful completion */ do { /* inner loop for acceptable step size */ if (factor < gnls->minFactor) { gnls->conv_failure = 1; return(iteration); } Memcpy(gnls->newtheta, gnls->theta, gnls->npar); d_axpy(gnls->newtheta, factor, gnls->incr, gnls->npar); evaluate(gnls->newtheta, gnls->npar , model, gnls->result); gnls->new_objective = gnls_objective(gnls); if (gnls->conv_failure) return(iteration); /* unable to evaluate objective */ factor /= 2.0; } while (gnls->new_objective >= gnls->objective); factor *= 4.0; if (factor > 1.0) factor = 1.0; gnls->objective = gnls->new_objective; Memcpy(gnls->theta, gnls->newtheta, gnls->npar); } gnls->conv_failure = 2; /* Maximum number of iterations exceeded */ return(iteration - 1); } static void gnls_wrapup(gnlsPtr gnls) { SEXP model = gnls->model; evaluate(gnls->theta, gnls->npar , model, gnls->result); Memcpy(gnls->add_ons, gnls->result[0] + gnls->npar * gnls->N, gnls->N); gnls->objective = gnls_objective(gnls); } void fit_gnls(double *ptheta, int *pdims, // = Dims double *pcorFactor, double *pvarWeights, int *pcorDims, double *settings, double *additional, int *pcorOpt, int *pvarOpt, SEXP model) { gnlsPtr gnls; PROTECT(model); if(sqrt_eps == 0.0) sqrt_eps = sqrt(DOUBLE_EPS); gnls = gnls_init(ptheta, pdims, pcorFactor, pvarWeights, pcorDims, settings, additional, *pcorOpt, *pvarOpt, model); settings[4] = (double) gnls_iterate(gnls); gnls_wrapup(gnls); settings[3] = gnls->conv_failure; settings[5] = gnls->objective; gnlsFree(gnls); UNPROTECT(1); } nlme/src/Makevars0000644000176200001440000000003410513125522013461 0ustar liggesusersPKG_CFLAGS=$(C_VISIBILITY) nlme/src/rs.f0000644000176200001440000005107513245173560012605 0ustar liggesusers DOUBLE PRECISION FUNCTION EPSLON (X) DOUBLE PRECISION X C C ESTIMATE UNIT ROUNDOFF IN QUANTITIES OF SIZE X. C DOUBLE PRECISION A,B,C,EPS C C THIS PROGRAM SHOULD FUNCTION PROPERLY ON ALL SYSTEMS C SATISFYING THE FOLLOWING TWO ASSUMPTIONS, C 1. THE BASE USED IN REPRESENTING FLOATING POINT C NUMBERS IS NOT A POWER OF THREE. C 2. THE QUANTITY A IN STATEMENT 10 IS REPRESENTED TO C THE ACCURACY USED IN FLOATING POINT VARIABLES C THAT ARE STORED IN MEMORY. C THE STATEMENT NUMBER 10 AND THE GO TO 10 ARE INTENDED TO C FORCE OPTIMIZING COMPILERS TO GENERATE CODE SATISFYING C ASSUMPTION 2. C UNDER THESE ASSUMPTIONS, IT SHOULD BE TRUE THAT, C A IS NOT EXACTLY EQUAL TO FOUR-THIRDS, C B HAS A ZERO FOR ITS LAST BIT OR DIGIT, C C IS NOT EXACTLY EQUAL TO ONE, C EPS MEASURES THE SEPARATION OF 1.0 FROM C THE NEXT LARGER FLOATING POINT NUMBER. C THE DEVELOPERS OF EISPACK WOULD APPRECIATE BEING INFORMED C ABOUT ANY SYSTEMS WHERE THESE ASSUMPTIONS DO NOT HOLD. C C THIS VERSION DATED 4/6/83. C A = 4.0D0/3.0D0 10 B = A - 1.0D0 C = B + B + B EPS = DABS(C-1.0D0) IF (EPS .EQ. 0.0D0) GO TO 10 EPSLON = EPS*DABS(X) RETURN END c Use a wrapper for C99 hypot, which is guaranteed to handle special values c such as NaN. DOUBLE PRECISION FUNCTION PYTHAG(A,B) DOUBLE PRECISION A,B,P CALL HYPOT(A,B,P) PYTHAG = P RETURN END C$$$ DOUBLE PRECISION FUNCTION PYTHAG(A,B) C$$$ DOUBLE PRECISION A,B C$$$C C$$$C FINDS DSQRT(A**2+B**2) WITHOUT OVERFLOW OR DESTRUCTIVE UNDERFLOW C$$$C C$$$ DOUBLE PRECISION P,R,S,T,U C$$$ P = DMAX1(DABS(A),DABS(B)) C$$$c 'nan' did lead to infinite loop before 2018-02: C$$$ IF ((risfinite(P) .ne. 0) .and. (P .NE. 0.0D0)) THEN C$$$ R = (DMIN1(DABS(A),DABS(B))/P)**2 C$$$ 10 CONTINUE C$$$ T = 4.0D0 + R C$$$ IF (T .EQ. 4.0D0) GO TO 20 C$$$ S = R/T C$$$ U = 1.0D0 + 2.0D0*S C$$$ P = U*P C$$$ R = (S/U)**2 * R C$$$ GO TO 10 C$$$ END IF C$$$ 20 PYTHAG = P C$$$ RETURN C$$$ END SUBROUTINE RS(NM,N,A,W,MATZ,Z,FV1,FV2,IERR) C INTEGER N,NM,IERR,MATZ DOUBLE PRECISION A(NM,N),W(N),Z(NM,N),FV1(N),FV2(N) C C THIS SUBROUTINE CALLS THE RECOMMENDED SEQUENCE OF C SUBROUTINES FROM THE EIGENSYSTEM SUBROUTINE PACKAGE (EISPACK) C TO FIND THE EIGENVALUES AND EIGENVECTORS (IF DESIRED) C OF A REAL SYMMETRIC MATRIX. C C ON INPUT C C NM MUST BE SET TO THE ROW DIMENSION OF THE TWO-DIMENSIONAL C ARRAY PARAMETERS AS DECLARED IN THE CALLING PROGRAM C DIMENSION STATEMENT. C C N IS THE ORDER OF THE MATRIX A. C C A CONTAINS THE REAL SYMMETRIC MATRIX. C C MATZ IS AN INTEGER VARIABLE SET EQUAL TO ZERO IF C ONLY EIGENVALUES ARE DESIRED. OTHERWISE IT IS SET TO C ANY NON-ZERO INTEGER FOR BOTH EIGENVALUES AND EIGENVECTORS. C C ON OUTPUT C C W CONTAINS THE EIGENVALUES IN ASCENDING ORDER. C C Z CONTAINS THE EIGENVECTORS IF MATZ IS NOT ZERO. C C IERR IS AN INTEGER OUTPUT VARIABLE SET EQUAL TO AN ERROR C COMPLETION CODE DESCRIBED IN THE DOCUMENTATION FOR TQLRAT C AND TQL2. THE NORMAL COMPLETION CODE IS ZERO. C C FV1 AND FV2 ARE TEMPORARY STORAGE ARRAYS. C C QUESTIONS AND COMMENTS SHOULD BE DIRECTED TO BURTON S. GARBOW, C MATHEMATICS AND COMPUTER SCIENCE DIV, ARGONNE NATIONAL LABORATORY C C THIS VERSION DATED AUGUST 1983. C C ------------------------------------------------------------------ C IF (N .LE. NM) GO TO 10 IERR = 10 * N GO TO 50 C 10 IF (MATZ .NE. 0) GO TO 20 C .......... FIND EIGENVALUES ONLY .......... CALL TRED1(NM,N,A,W,FV1,FV2) CALL TQLRAT(N,W,FV2,IERR) GO TO 50 C .......... FIND BOTH EIGENVALUES AND EIGENVECTORS .......... 20 CALL TRED2(NM,N,A,W,FV1,Z) CALL TQL2(NM,N,W,FV1,Z,IERR) 50 RETURN END SUBROUTINE TQL2(NM,N,D,E,Z,IERR) C INTEGER I,J,K,L,M,N,II,L1,L2,NM,MML,IERR DOUBLE PRECISION D(N),E(N),Z(NM,N) DOUBLE PRECISION C,C2,C3,DL1,EL1,F,G,H,P,R,S,S2,TST1,TST2,PYTHAG C C THIS SUBROUTINE IS A TRANSLATION OF THE ALGOL PROCEDURE TQL2, C NUM. MATH. 11, 293-306(1968) BY BOWDLER, MARTIN, REINSCH, AND C WILKINSON. C HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 227-240(1971). C C THIS SUBROUTINE FINDS THE EIGENVALUES AND EIGENVECTORS C OF A SYMMETRIC TRIDIAGONAL MATRIX BY THE QL METHOD. C THE EIGENVECTORS OF A FULL SYMMETRIC MATRIX CAN ALSO C BE FOUND IF TRED2 HAS BEEN USED TO REDUCE THIS C FULL MATRIX TO TRIDIAGONAL FORM. C C ON INPUT C C NM MUST BE SET TO THE ROW DIMENSION OF TWO-DIMENSIONAL C ARRAY PARAMETERS AS DECLARED IN THE CALLING PROGRAM C DIMENSION STATEMENT. C C N IS THE ORDER OF THE MATRIX. C C D CONTAINS THE DIAGONAL ELEMENTS OF THE INPUT MATRIX. C C E CONTAINS THE SUBDIAGONAL ELEMENTS OF THE INPUT MATRIX C IN ITS LAST N-1 POSITIONS. E(1) IS ARBITRARY. C C Z CONTAINS THE TRANSFORMATION MATRIX PRODUCED IN THE C REDUCTION BY TRED2, IF PERFORMED. IF THE EIGENVECTORS C OF THE TRIDIAGONAL MATRIX ARE DESIRED, Z MUST CONTAIN C THE IDENTITY MATRIX. C C ON OUTPUT C C D CONTAINS THE EIGENVALUES IN ASCENDING ORDER. IF AN C ERROR EXIT IS MADE, THE EIGENVALUES ARE CORRECT BUT C UNORDERED FOR INDICES 1,2,...,IERR-1. C C E HAS BEEN DESTROYED. C C Z CONTAINS ORTHONORMAL EIGENVECTORS OF THE SYMMETRIC C TRIDIAGONAL (OR FULL) MATRIX. IF AN ERROR EXIT IS MADE, C Z CONTAINS THE EIGENVECTORS ASSOCIATED WITH THE STORED C EIGENVALUES. C C IERR IS SET TO C ZERO FOR NORMAL RETURN, C J IF THE J-TH EIGENVALUE HAS NOT BEEN C DETERMINED AFTER 30 ITERATIONS. C C CALLS PYTHAG FOR DSQRT(A*A + B*B) . C C QUESTIONS AND COMMENTS SHOULD BE DIRECTED TO BURTON S. GARBOW, C MATHEMATICS AND COMPUTER SCIENCE DIV, ARGONNE NATIONAL LABORATORY C C THIS VERSION DATED AUGUST 1983. C C ------------------------------------------------------------------ c c unnecessary initialization of C3 and S2 to keep g77 -Wall happy c C3 = 0.0D0 S2 = 0.0D0 C IERR = 0 IF (N .EQ. 1) GO TO 1001 C DO I = 2, N E(I-1) = E(I) end do C F = 0.0D0 TST1 = 0.0D0 E(N) = 0.0D0 C DO 240 L = 1, N J = 0 H = DABS(D(L)) + DABS(E(L)) IF (TST1 .LT. H) TST1 = H C .......... LOOK FOR SMALL SUB-DIAGONAL ELEMENT .......... DO M = L, N TST2 = TST1 + DABS(E(M)) IF (TST2 .EQ. TST1) GO TO 120 C .......... E(N) IS ALWAYS ZERO, SO THERE IS NO EXIT C THROUGH THE BOTTOM OF THE LOOP .......... end do C 120 IF (M .EQ. L) GO TO 220 130 IF (J .EQ. 30) GO TO 1000 J = J + 1 C .......... FORM SHIFT .......... L1 = L + 1 L2 = L1 + 1 G = D(L) P = (D(L1) - G) / (2.0D0 * E(L)) R = PYTHAG(P,1.0D0) D(L) = E(L) / (P + DSIGN(R,P)) D(L1) = E(L) * (P + DSIGN(R,P)) DL1 = D(L1) H = G - D(L) IF (L2 .GT. N) GO TO 145 C DO I = L2, N D(I) = D(I) - H end do C 145 F = F + H C .......... QL TRANSFORMATION .......... P = D(M) C = 1.0D0 C2 = C EL1 = E(L1) S = 0.0D0 MML = M - L C .......... FOR I=M-1 STEP -1 UNTIL L DO -- .......... DO 200 II = 1, MML C3 = C2 C2 = C S2 = S I = M - II G = C * E(I) H = C * P R = PYTHAG(P,E(I)) E(I+1) = S * R S = E(I) / R C = P / R P = C * D(I) - S * G D(I+1) = H + S * (C * G + S * D(I)) C .......... FORM VECTOR .......... DO 180 K = 1, N H = Z(K,I+1) Z(K,I+1) = S * Z(K,I) + C * H Z(K,I) = C * Z(K,I) - S * H 180 CONTINUE C 200 CONTINUE C P = -S * S2 * C3 * EL1 * E(L) / DL1 E(L) = S * P D(L) = C * P TST2 = TST1 + DABS(E(L)) IF (TST2 .GT. TST1) GO TO 130 220 D(L) = D(L) + F 240 CONTINUE C .......... ORDER EIGENVALUES AND EIGENVECTORS .......... DO 300 II = 2, N I = II - 1 K = I P = D(I) C DO 260 J = II, N IF (D(J) .GE. P) GO TO 260 K = J P = D(J) 260 CONTINUE C IF (K .EQ. I) GO TO 300 D(K) = D(I) D(I) = P C DO 280 J = 1, N P = Z(J,I) Z(J,I) = Z(J,K) Z(J,K) = P 280 CONTINUE C 300 CONTINUE C GO TO 1001 C .......... SET ERROR -- NO CONVERGENCE TO AN C EIGENVALUE AFTER 30 ITERATIONS .......... 1000 IERR = L 1001 RETURN END SUBROUTINE TQLRAT(N,D,E2,IERR) C INTEGER I,J,L,M,N,II,L1,MML,IERR DOUBLE PRECISION D(N),E2(N) DOUBLE PRECISION B,C,F,G,H,P,R,S,T,EPSLON,PYTHAG C C THIS SUBROUTINE IS A TRANSLATION OF THE ALGOL PROCEDURE TQLRAT, C ALGORITHM 464, COMM. ACM 16, 689(1973) BY REINSCH. C C THIS SUBROUTINE FINDS THE EIGENVALUES OF A SYMMETRIC C TRIDIAGONAL MATRIX BY THE RATIONAL QL METHOD. C C ON INPUT C C N IS THE ORDER OF THE MATRIX. C C D CONTAINS THE DIAGONAL ELEMENTS OF THE INPUT MATRIX. C C E2 CONTAINS THE SQUARES OF THE SUBDIAGONAL ELEMENTS OF THE C INPUT MATRIX IN ITS LAST N-1 POSITIONS. E2(1) IS ARBITRARY. C C ON OUTPUT C C D CONTAINS THE EIGENVALUES IN ASCENDING ORDER. IF AN C ERROR EXIT IS MADE, THE EIGENVALUES ARE CORRECT AND C ORDERED FOR INDICES 1,2,...IERR-1, BUT MAY NOT BE C THE SMALLEST EIGENVALUES. C C E2 HAS BEEN DESTROYED. C C IERR IS SET TO C ZERO FOR NORMAL RETURN, C J IF THE J-TH EIGENVALUE HAS NOT BEEN C DETERMINED AFTER 30 ITERATIONS. C C CALLS PYTHAG FOR DSQRT(A*A + B*B) . C C QUESTIONS AND COMMENTS SHOULD BE DIRECTED TO BURTON S. GARBOW, C MATHEMATICS AND COMPUTER SCIENCE DIV, ARGONNE NATIONAL LABORATORY C C THIS VERSION DATED AUGUST 1983. C C ------------------------------------------------------------------ c c unnecessary initialization of B and C to keep g77 -Wall happy c B = 0.0D0 C = 0.0D0 C IERR = 0 IF (N .EQ. 1) GO TO 1001 C DO I = 2, N E2(I-1) = E2(I) end do C F = 0.0D0 T = 0.0D0 E2(N) = 0.0D0 C DO 290 L = 1, N J = 0 H = DABS(D(L)) + DSQRT(E2(L)) IF (T .GT. H) GO TO 105 T = H B = EPSLON(T) C = B * B C .......... LOOK FOR SMALL SQUARED SUB-DIAGONAL ELEMENT .......... 105 DO 110 M = L, N IF (E2(M) .LE. C) GO TO 120 C .......... E2(N) IS ALWAYS ZERO, SO THERE IS NO EXIT C THROUGH THE BOTTOM OF THE LOOP .......... 110 CONTINUE C 120 IF (M .EQ. L) GO TO 210 130 IF (J .EQ. 30) GO TO 1000 J = J + 1 C .......... FORM SHIFT .......... L1 = L + 1 S = DSQRT(E2(L)) G = D(L) P = (D(L1) - G) / (2.0D0 * S) R = PYTHAG(P,1.0D0) D(L) = S / (P + DSIGN(R,P)) H = G - D(L) C DO I = L1, N D(I) = D(I) - H end do C F = F + H C .......... RATIONAL QL TRANSFORMATION .......... G = D(M) IF (G .EQ. 0.0D0) G = B H = G S = 0.0D0 MML = M - L C .......... FOR I=M-1 STEP -1 UNTIL L DO -- .......... DO 200 II = 1, MML I = M - II P = G * H R = P + E2(I) E2(I+1) = S * R S = E2(I) / R D(I+1) = H + S * (H + D(I)) G = D(I) - E2(I) / G IF (G .EQ. 0.0D0) G = B H = G * P / R 200 CONTINUE C E2(L) = S * G D(L) = H C .......... GUARD AGAINST UNDERFLOW IN CONVERGENCE TEST .......... IF (H .EQ. 0.0D0) GO TO 210 IF (DABS(E2(L)) .LE. DABS(C/H)) GO TO 210 E2(L) = H * E2(L) IF (E2(L) .NE. 0.0D0) GO TO 130 210 P = D(L) + F C .......... ORDER EIGENVALUES .......... IF (L .EQ. 1) GO TO 250 C .......... FOR I=L STEP -1 UNTIL 2 DO -- .......... DO 230 II = 2, L I = L + 2 - II IF (P .GE. D(I-1)) GO TO 270 D(I) = D(I-1) 230 CONTINUE C 250 I = 1 270 D(I) = P 290 CONTINUE C GO TO 1001 C .......... SET ERROR -- NO CONVERGENCE TO AN C EIGENVALUE AFTER 30 ITERATIONS .......... 1000 IERR = L 1001 RETURN END SUBROUTINE TRED1(NM,N,A,D,E,E2) C INTEGER I,J,K,L,N,II,NM,JP1 DOUBLE PRECISION A(NM,N),D(N),E(N),E2(N) DOUBLE PRECISION F,G,H,SCALE C C THIS SUBROUTINE IS A TRANSLATION OF THE ALGOL PROCEDURE TRED1, C NUM. MATH. 11, 181-195(1968) BY MARTIN, REINSCH, AND WILKINSON. C HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 212-226(1971). C C THIS SUBROUTINE REDUCES A REAL SYMMETRIC MATRIX C TO A SYMMETRIC TRIDIAGONAL MATRIX USING C ORTHOGONAL SIMILARITY TRANSFORMATIONS. C C ON INPUT C C NM MUST BE SET TO THE ROW DIMENSION OF TWO-DIMENSIONAL C ARRAY PARAMETERS AS DECLARED IN THE CALLING PROGRAM C DIMENSION STATEMENT. C C N IS THE ORDER OF THE MATRIX. C C A CONTAINS THE REAL SYMMETRIC INPUT MATRIX. ONLY THE C LOWER TRIANGLE OF THE MATRIX NEED BE SUPPLIED. C C ON OUTPUT C C A CONTAINS INFORMATION ABOUT THE ORTHOGONAL TRANS- C FORMATIONS USED IN THE REDUCTION IN ITS STRICT LOWER C TRIANGLE. THE FULL UPPER TRIANGLE OF A IS UNALTERED. C C D CONTAINS THE DIAGONAL ELEMENTS OF THE TRIDIAGONAL MATRIX. C C E CONTAINS THE SUBDIAGONAL ELEMENTS OF THE TRIDIAGONAL C MATRIX IN ITS LAST N-1 POSITIONS. E(1) IS SET TO ZERO. C C E2 CONTAINS THE SQUARES OF THE CORRESPONDING ELEMENTS OF E. C E2 MAY COINCIDE WITH E IF THE SQUARES ARE NOT NEEDED. C C QUESTIONS AND COMMENTS SHOULD BE DIRECTED TO BURTON S. GARBOW, C MATHEMATICS AND COMPUTER SCIENCE DIV, ARGONNE NATIONAL LABORATORY C C THIS VERSION DATED AUGUST 1983. C C ------------------------------------------------------------------ C DO 100 I = 1, N D(I) = A(N,I) A(N,I) = A(I,I) 100 CONTINUE C .......... FOR I=N STEP -1 UNTIL 1 DO -- .......... DO 300 II = 1, N I = N + 1 - II L = I - 1 H = 0.0D0 SCALE = 0.0D0 IF (L .LT. 1) GO TO 130 C .......... SCALE ROW (ALGOL TOL THEN NOT NEEDED) .......... DO K = 1, L SCALE = SCALE + DABS(D(K)) end do C IF (SCALE .NE. 0.0D0) GO TO 140 C DO J = 1, L D(J) = A(L,J) A(L,J) = A(I,J) A(I,J) = 0.0D0 end do C 130 E(I) = 0.0D0 E2(I) = 0.0D0 GO TO 300 C 140 DO K = 1, L D(K) = D(K) / SCALE H = H + D(K) * D(K) end do C E2(I) = SCALE * SCALE * H F = D(L) G = -DSIGN(DSQRT(H),F) E(I) = SCALE * G H = H - F * G D(L) = F - G IF (L .EQ. 1) GO TO 285 C .......... FORM A*U .......... DO J = 1, L E(J) = 0.0D0 end do C DO 240 J = 1, L F = D(J) G = E(J) + A(J,J) * F JP1 = J + 1 IF (L .LT. JP1) GO TO 220 C DO K = JP1, L G = G + A(K,J) * D(K) E(K) = E(K) + A(K,J) * F end do C 220 E(J) = G 240 CONTINUE C .......... FORM P .......... F = 0.0D0 C DO J = 1, L E(J) = E(J) / H F = F + E(J) * D(J) end do C H = F / (H + H) C .......... FORM Q .......... DO J = 1, L E(J) = E(J) - H * D(J) end do C .......... FORM REDUCED A .......... DO J = 1, L F = D(J) G = E(J) C DO K = J, L A(K,J) = A(K,J) - F * E(K) - G * D(K) end do C end do C 285 DO J = 1, L F = D(J) D(J) = A(L,J) A(L,J) = A(I,J) A(I,J) = F * SCALE end do C 300 CONTINUE C RETURN END SUBROUTINE TRED2(NM,N,A,D,E,Z) C INTEGER I,J,K,L,N,II,NM,JP1 DOUBLE PRECISION A(NM,N),D(N),E(N),Z(NM,N) DOUBLE PRECISION F,G,H,HH,SCALE C C THIS SUBROUTINE IS A TRANSLATION OF THE ALGOL PROCEDURE TRED2, C NUM. MATH. 11, 181-195(1968) BY MARTIN, REINSCH, AND WILKINSON. C HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 212-226(1971). C C THIS SUBROUTINE REDUCES A REAL SYMMETRIC MATRIX TO A C SYMMETRIC TRIDIAGONAL MATRIX USING AND ACCUMULATING C ORTHOGONAL SIMILARITY TRANSFORMATIONS. C C ON INPUT C C NM MUST BE SET TO THE ROW DIMENSION OF TWO-DIMENSIONAL C ARRAY PARAMETERS AS DECLARED IN THE CALLING PROGRAM C DIMENSION STATEMENT. C C N IS THE ORDER OF THE MATRIX. C C A CONTAINS THE REAL SYMMETRIC INPUT MATRIX. ONLY THE C LOWER TRIANGLE OF THE MATRIX NEED BE SUPPLIED. C C ON OUTPUT C C D CONTAINS THE DIAGONAL ELEMENTS OF THE TRIDIAGONAL MATRIX. C C E CONTAINS THE SUBDIAGONAL ELEMENTS OF THE TRIDIAGONAL C MATRIX IN ITS LAST N-1 POSITIONS. E(1) IS SET TO ZERO. C C Z CONTAINS THE ORTHOGONAL TRANSFORMATION MATRIX C PRODUCED IN THE REDUCTION. C C A AND Z MAY COINCIDE. IF DISTINCT, A IS UNALTERED. C C QUESTIONS AND COMMENTS SHOULD BE DIRECTED TO BURTON S. GARBOW, C MATHEMATICS AND COMPUTER SCIENCE DIV, ARGONNE NATIONAL LABORATORY C C THIS VERSION DATED AUGUST 1983. C C ------------------------------------------------------------------ C DO I = 1, N DO J = I, N Z(J,I) = A(J,I) end do D(I) = A(N,I) end do C IF (N .EQ. 1) GO TO 510 C .......... FOR I=N STEP -1 UNTIL 2 DO -- .......... DO 300 II = 2, N I = N + 2 - II L = I - 1 H = 0.0D0 SCALE = 0.0D0 IF (L .LT. 2) GO TO 130 C .......... SCALE ROW (ALGOL TOL THEN NOT NEEDED) .......... DO K = 1, L SCALE = SCALE + DABS(D(K)) end do C IF (SCALE .NE. 0.0D0) GO TO 140 130 E(I) = D(L) C DO J = 1, L D(J) = Z(L,J) Z(I,J) = 0.0D0 Z(J,I) = 0.0D0 end do C GO TO 290 C 140 DO K = 1, L D(K) = D(K) / SCALE H = H + D(K) * D(K) end do C F = D(L) G = -DSIGN(DSQRT(H),F) E(I) = SCALE * G H = H - F * G D(L) = F - G C .......... FORM A*U .......... DO J = 1, L E(J) = 0.0D0 end do C DO 240 J = 1, L F = D(J) Z(J,I) = F G = E(J) + Z(J,J) * F JP1 = J + 1 IF (L .LT. JP1) GO TO 220 C DO K = JP1, L G = G + Z(K,J) * D(K) E(K) = E(K) + Z(K,J) * F end do C 220 E(J) = G 240 CONTINUE C .......... FORM P .......... F = 0.0D0 C DO J = 1, L E(J) = E(J) / H F = F + E(J) * D(J) end do C HH = F / (H + H) C .......... FORM Q .......... DO J = 1, L E(J) = E(J) - HH * D(J) end do C .......... FORM REDUCED A .......... DO 280 J = 1, L F = D(J) G = E(J) C DO K = J, L Z(K,J) = Z(K,J) - F * E(K) - G * D(K) end do C D(J) = Z(L,J) Z(I,J) = 0.0D0 280 CONTINUE C 290 D(I) = H 300 CONTINUE C .......... ACCUMULATION OF TRANSFORMATION MATRICES .......... DO 500 I = 2, N L = I - 1 Z(N,L) = Z(L,L) Z(L,L) = 1.0D0 H = D(I) IF (H .ne. 0.0D0) then DO K = 1, L D(K) = Z(K,I) / H end do C DO J = 1, L G = 0.0D0 DO K = 1, L G = G + Z(K,I) * Z(K,J) end do C DO K = 1, L Z(K,J) = Z(K,J) - G * D(K) end do end do end if C 380 DO K = 1, L Z(K,I) = 0.0D0 end do C 500 CONTINUE C 510 DO I = 1, N D(I) = Z(N,I) Z(N,I) = 0.0D0 end do C Z(N,N) = 1.0D0 E(1) = 0.0D0 RETURN END nlme/src/pythag.c0000644000176200001440000000172213245275713013447 0ustar liggesusers/* Copyright 2018 The R Core Team This file is part of the nlme package for R and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ /* Replaces FORTRAN version in rs.f which did not handle special values such as NaN. return value in an arg for maximal portability -- see WRE section 6.6 */ #include #include void F77_SUB(hypot)(double *a, double *b, double *p) { *p = hypot(*a, *b); } nlme/src/matrix.c0000644000176200001440000001417012657657003013462 0ustar liggesusers/* Basic matrix manipulations and QR decomposition Copyright 1997-2005 Douglas M. Bates , Jose C. Pinheiro, Saikat DebRoy Copyright 2007-2016 The R Core Team This file is part of the nlme package for R and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #include "matrix.h" /* find qr decomposition, dqrdc2() is basis of R's qr(), also used by nlme */ void F77_NAME(dqrdc2)(double *x, int *ldx, int *n, int *p, double *tol, int *rank, double *qraux, int *pivot, double *work); void F77_NAME(dqrls)(double *x, int *n, int *p, double *y, int *ny, double *tol, double *b, double *rsd, double *qty, int *k, int *jpvt, double *qraux, double *work); void d_axpy(double *y, double a, double *x, int n) { /* y <- a * x + y */ while (n-- > 0) { *y++ += a * *x++; } } double d_sum_sqr( double *x, int n ) { /* sum(x * x) */ double accum = 0.0; while (n-- > 0) { accum += *x * *x; x++; } return accum; } double d_dot_prod( double *x, int incx, double *y, int incy, int n ) { /* sum(x * y) */ double accum = 0.0; while (n-- > 0) { accum += *x * *y; x +=incx; y += incy; } return accum; } double * copy_mat(double *y, int ldy, double *x, int ldx, int nrow, int ncol) { /* y <- x */ double * ret = y; while (ncol-- > 0) { Memcpy(y, x, nrow); y += ldy; x += ldx; } return ret; } double * copy_trans(double *y, int ldy, double *x, int ldx, int nrow, int ncol) /* y <- t(x) */ { double * ret = y; int i, j; for (i = 0L; i < nrow; i++) { for (j = 0L; j < ncol; j++) { y[j] = x[i + j * ldx]; } y += ldy; } return ret; } double * mult_mat(double *z, int ldz, double *x, int ldx, int xrows, int xcols, double *y, int ldy, int ycols) { /* z <- x %*% y */ double *t, *tmp = Calloc((size_t)(xrows * ycols), double); int i, j; /* use tmp so z can be either x or y */ t = tmp; for (i = 0; i < ycols; i++) { for (j = 0; j < xcols; j++) { d_axpy(t, y[j], x + j * ldx, xrows); } t += xrows; y += ldy; } copy_mat(z, ldz, tmp, xrows, xrows, ycols); Free(tmp); return z; } static void zero_mat(double *y, int ldy, int nrow, int ncol) { /* y[,] <- 0 */ while (ncol-- > 0) { int i; for (i = 0; i < nrow; i++) { y[i] = 0.0; } y += ldy; } } QRptr QR(double *mat, int ldmat, int nrow, int ncol) { /* Constructor for a QR object */ QRptr value = Calloc((size_t) 1, struct QR_struct); int j; double *work; if (sqrt_eps == 0.) { sqrt_eps = sqrt(DOUBLE_EPS); } value->mat = mat; value->ldmat = ldmat; value->nrow = nrow; value->ncol = ncol; value->qraux = Calloc((size_t) ncol, double); value->pivot = Calloc((size_t) ncol, int); for (j = 0; j < ncol; j++) { (value->pivot)[j] = j; } work = Calloc( 2 * ncol, double ); F77_CALL(dqrdc2) (mat, &ldmat, &nrow, &ncol, &sqrt_eps, &(value->rank), value->qraux, value->pivot, work); Free(work); return value; } void QRfree(QRptr this) { /* destructor for a QR object*/ Free(this->pivot); Free(this->qraux); Free(this); } int QRqty(QRptr this, double *ymat, int ldy, int ycol) { /* ymat <- qr.qty(this, ymat) */ int j, info, task = 1000L; for (j = 0; j < ycol; j++) { double *col = ymat + j * ldy; F77_CALL(dqrsl) (this->mat, &(this->ldmat), &(this->nrow), &(this->ncol), this->qraux, col, DNULLP, col, DNULLP, DNULLP, DNULLP, &task, &info); } return info; } int QRsolve( QRptr this, double *ymat, int ldy, int ycol, double *beta, int ldbeta ) { /* beta <- qr.beta(this, ymat) */ int j, info, task = 1100L; double *qty = Calloc( this->nrow, double ), *bb = Calloc( this->ncol, double ); for (j = 0; j < ycol; j++) { Memcpy( qty, ymat, this->nrow ); F77_CALL(dqrsl) (this->mat, &(this->ldmat), &(this->nrow), &(this->ncol), this->qraux, qty, DNULLP, qty, bb, DNULLP, DNULLP, &task, &info); Memcpy( beta, bb, this->ncol ); ymat += ldy; beta += ldbeta; } Free( qty ); Free( bb ); return info; } double QRlogAbsDet(QRptr this) { /* log(abs(det(upper triangle))) */ int j; double accum = 0.0; for (j = 0; j < this->rank; j++) accum += log(fabs(this->mat[j * (this->ldmat + 1L)])); return accum; } void QRstoreR(QRptr this, double *dest, int ldDest) { /* store the R part into dest */ int i; for (i = 0; i < this->ncol; i++) { Memcpy(dest + this->pivot[i] * ldDest, this->mat + i * this->ldmat, ((i + 1) > this->rank) ? this->rank : i + 1); } } int QR_and_rotate(double *mat, int ldmat, int nrow, int ncol, double *DmHalf, int qi, int ndecomp, double *logdet, double *store, int ldstr) /* Append DmHalf to the bottom of mat and take a QR decomposition of the first ndecomp columns. Apply the rotations to the other columns. Return the rank and increment log(abs(det(R11))). */ { int rank, arow = nrow + qi, /* number of rows in augmented matrix */ ndrow = ((arow > ndecomp) ? ndecomp : arow); double *aug = Calloc((size_t) arow * ncol, double); QRptr aQR; copy_mat(aug, arow, mat, ldmat, nrow, ncol); copy_mat(aug + nrow, arow, DmHalf, qi, qi, qi); aQR = QR(aug, arow, arow, ndecomp); if (logdet != DNULLP) { *logdet += QRlogAbsDet(aQR); } QRqty(aQR, aug + ndecomp * arow, arow, ncol - ndecomp); if (ldstr > 0) { QRstoreR(aQR, store, ldstr); copy_mat(store + ndecomp * ldstr, ldstr, aug + ndecomp * arow, arow, ndrow, ncol - ndecomp); } if (qi < ndecomp) { zero_mat(mat, ldmat, nrow, ncol); } copy_mat(mat + ndecomp * ldmat, ldmat, aug + ndecomp * (arow + 1L), arow, arow - ndrow, ncol - ndecomp); rank = aQR->rank; QRfree(aQR); Free(aug); return rank; } nlme/src/chol.f0000644000176200001440000000444712074271074013105 0ustar liggesusersc----------------------------------------------------------------------- c c R : A Computer Langage for Statistical Data Analysis c Copyright (C) 1996, 1997 Robert Gentleman and Ross Ihaka c Copyright (C) 2001 The R Core Team c c This program is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 2 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this program; if not, a copy is available at c http://www.r-project.org/Licenses/ c c----------------------------------------------------------------------- c c chol performs the choleski decomposition of a symmetric c positive-definite matrix. this is just a wrapper for the c linpack routine dpofa. c c on entry c c a double precision(lda,n) c the upper triangle of the matrix to be factorized c is contained in the upper triangle of a. c c lda integer c the leading dimension of a. c c n integer c the number or rows and columns of the matrix c to be factorized. c c on return c c v double precision(n,n) c the square-root (choleski) factor. c c info integer c the error indicator from dpofa. this will be c zero unless the matrix being factorized is c not positive definite. c c this version dated aug 25, 1996. c ross ihaka, university of auckland. c subroutine chol(a, lda, n, v, info) c implicit none integer n, lda, info double precision a(lda, n), v(n,n) integer i, j c do 20 i = 1,n do 10 j = 1,n if(i .gt. j) then v(i,j) = 0.0d0 else v(i,j) = a(i,j) end if 10 continue 20 continue call dpofa(v, n, n, info) return end nlme/src/nlme.c0000644000176200001440000003551313234331542013102 0ustar liggesusers/* Routines for fitting nlme models Copyright 2007-2018 The R Core Team Copyright 1997-2001 Douglas M. Bates , Jose C. Pinheiro, Saikat DebRoy This file is part of the nlme package for R and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #include "nlOptimizer.h" #include "matrix.h" #include "nlmefit.h" extern void corStruct_recalc(double *, int *, int *, double *); #define is_na_DOUBLE(x) ISNA(*(x)) /* nlme functions and variables */ typedef struct nlme_struct { /* Nonlinear mixed-effects structure */ double *residuals, *gradient, *DmHalf, *corFactor, *varWeights, *newtheta, *theta, *incr, *add_ons, new_objective, objective, RSS, *sigma; // <- 17-11-2015; Fixed sigma patch; E van Willigen; Quant.Sol. int corOpt, varOpt, nparTot, ngrpTot, nrdof, *sgroups, *corDims, *npar, *pdClass, *pdims, *ZXoff, *ZXlen; double *result[1]; dimPTR dd, d1; SEXP model; int conv_failure; } *nlmePtr; double sqrt_eps = 0.0; static int * make_sequential(int *dest, int *src, int n) { /* copy the pattern from src to dest */ /* but in sequential values starting */ /* from 0 */ int val = 0, *ret = dest, sval; if (n <= 0) return dest; sval = *src++; *dest++ = val; while (--n) { if (*src != sval) {sval = *src; val++;} src++; *dest++ = val; } return ret; } static nlmePtr nlme_init(double *ptheta, double *pDmHalf, int *pgroups, int *pdims, int *pdClass, double *pcorFactor, double *pvarWeights, int *pcorDims, double *additional, int *pcorOpt, int *pvarOpt, // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions double *sigma, SEXP model) { int i, *src, nResult; nlmePtr nlme = Calloc(1, struct nlme_struct); nlme->pdims = pdims; nlme->DmHalf = pDmHalf; nlme->pdClass = pdClass; nlme->corFactor = pcorFactor; nlme->varWeights = pvarWeights; nlme->corDims = pcorDims; nlme->dd = dims(pdims); nlme->npar = Calloc(nlme->dd->Q + 1, int); nlme->sigma = sigma; // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions for(i = 0, nlme->nparTot = 0; i <= nlme->dd->Q; i++) { nlme->npar[i] = (nlme->dd->ncol)[i] * (nlme->dd->ngrp)[i]; nlme->nparTot += nlme->npar[i]; } nlme->nrdof = nlme->dd->N - nlme->nparTot; nlme->sgroups = pgroups; for(i = 0, src = nlme->sgroups; i < nlme->dd->Q; i++) { make_sequential(src, src, nlme->dd->N); src += nlme->dd->N; } nlme->corOpt = *pcorOpt; nlme->varOpt = *pvarOpt; nlme->theta = ptheta; nlme->add_ons = additional; nlme->ngrpTot = 0; for (i = 0; i < (nlme->dd->Q + 2); i++) { nlme->ngrpTot += nlme->dd->ngrp[i]; } nlme->ZXoff = Calloc(nlme->ngrpTot, int); Memcpy(nlme->ZXoff, nlme->dd->ZXoff[0], nlme->ngrpTot); nlme->ZXlen = Calloc(nlme->ngrpTot, int); Memcpy(nlme->ZXlen, nlme->dd->ZXlen[0], nlme->ngrpTot); nlme->newtheta = Calloc(nlme->nparTot, double); nlme->incr = Calloc(nlme->nparTot, double); nlme->model = model; nlme->result[0] = DNULLP; nResult = evaluate(ptheta, nlme->nparTot, model, nlme->result); nlme->result[0] = Calloc(nResult, double); return(nlme); } static void nlmeFree(nlmePtr nlme) { Free(nlme->newtheta); Free(nlme->incr); Free(nlme->npar); Free(nlme->ZXoff); Free(nlme->ZXlen); Free(nlme->result[0]); Free(nlme); } static void /* undo changes in dd from internal_decomp */ restore_dims(nlmePtr nlme) { nlme->dd->ZXrows = nlme->dd->N; Memcpy(nlme->dd->ZXoff[0], nlme->ZXoff, nlme->ngrpTot); Memcpy(nlme->dd->ZXlen[0], nlme->ZXlen, nlme->ngrpTot); } static void nlme_wtCorrAdj(nlmePtr nlme) { int i, j; if(nlme->varOpt) { /* variance function adjustment */ for(i = 0; i < nlme->dd->N; i++) { for(j = 0; j < nlme->dd->ZXcols; j++) { *(nlme->result[0] + i + j * nlme->dd->N) *= nlme->varWeights[i]; } } } if(nlme->corOpt) { /* correlation structure adjustment */ corStruct_recalc(nlme->result[0], nlme->corDims, &nlme->dd->ZXcols, nlme->corFactor); } } static double nlme_RSS(nlmePtr nlme) { nlme->residuals = nlme->result[0] + (nlme->dd->ZXcols - 1) * nlme->dd->N; nlme->gradient = nlme->result[0]; nlme->RSS = d_sum_sqr(nlme->residuals, nlme->dd->N); return(nlme->RSS); } static double nlme_objective(nlmePtr nlme) { int i; double RSS, *srcB; RSS = nlme->RSS; for(i = 0, srcB = nlme->newtheta; i < nlme->dd->Q; i++) { double *work = Calloc(nlme->npar[i], double); mult_mat(work, (nlme->dd->ncol)[i], nlme->DmHalf + (nlme->dd->DmOff)[i], (nlme->dd->ncol)[i], (nlme->dd->ncol)[i], (nlme->dd->ncol)[i], srcB, (nlme->dd->ncol)[i], (nlme->dd->ngrp)[i]); RSS += d_sum_sqr(work, nlme->npar[i]); srcB += nlme->npar[i]; Free(work); } return(RSS); } static void nlme_workingRes(nlmePtr nlme) { int i, j, k; double *theta = nlme->theta; for(j = 0; j < nlme->dd->Q; j++) { int nb = nlme->dd->ncol[j]; double *res = nlme->gradient + nlme->dd->ZXrows * (nlme->dd->ZXcols - 1); for(k = 0; k < nlme->dd->ngrp[j]; k++) { double *Zjk = nlme->gradient + nlme->dd->ZXoff[j][k]; for(i = 0; i < nlme->dd->ZXlen[j][k]; i++) { *res += d_dot_prod(Zjk + i, nlme->dd->ZXrows, theta, 1, nb); res++; } theta += nb; } } } static double nlme_increment(nlmePtr nlme) { double predObj, *dest, *src, logLik, lRSS, *Ra = Calloc(nlme->dd->DmOff[nlme->dd->Q], double), *dc = Calloc(nlme->dd->Srows * nlme->dd->ZXcols, double) /* , *auxGrad = Calloc(nlme->dd->N * (nlme->dd->ZXcols - 1), double) */ ; double *incr = nlme->incr; double *theta = nlme->theta; int i, j, start, RML = 0; if (sqrt_eps == 0.0) sqrt_eps = sqrt(DOUBLE_EPS); /* Memcpy(auxGrad, nlme->gradient, (nlme->dd->ZXcols - 1) * nlme->dd->N); */ internal_decomp(nlme->dd, nlme->gradient); nlme_workingRes(nlme); internal_EM(nlme->dd, nlme->gradient, nlme->DmHalf, 20, // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions nlme->pdClass, &RML, &logLik, Ra, &lRSS, nlme->sigma); { statePTR st = Calloc(1, struct state_struct); int ntheta = count_DmHalf_pars( nlme->dd, nlme->pdClass ), itrmcd, itncnt, msg, iagflg; double epsm, *theta = Calloc(ntheta, double), *typsiz = Calloc(ntheta, double), *grad = Calloc(ntheta, double), *newtheta = Calloc(ntheta, double), *a = Calloc(ntheta * ntheta, double), *work = Calloc(ntheta * 9, double); st->dd = nlme->dd; st->ZXy = nlme->gradient; st->pdClass = nlme->pdClass; st->RML = &RML; st->sigma = nlme->sigma; // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions generate_theta(theta, nlme->dd, nlme->pdClass, nlme->DmHalf); epsm = DBL_EPSILON; msg = 9; /* don't inhibit checks but suppress output */ for (i = 0; i < ntheta; i++) { typsiz[i] = 1.0; } /* iagflg = 1; */ /* for (i = 0; i < nlme->dd->Q; i++) { */ /* if (nlme->pdClass[i] < 1 || nlme->pdClass[i] == 3 || nlme->pdClass[i] > 4) { */ /* iagflg = 0; */ /* break; */ /* } */ /* } */ iagflg = 0; /* temporary modification */ // Call the documented C API interface to R's nlm() : optif9(ntheta, ntheta, theta, (fcn_p) mixed_fcn, (fcn_p) mixed_grad, /* no hessian: */ (d2fcn_p) 0, st, typsiz, 1.0 /*fscale*/, 1 /*method*/, 1 /*iexp*/, &msg, -1 /*ndigit*/, 20 /*itnlim*/, iagflg, 0 /*iahflg*/, -1. /*dlt*/, pow(epsm, 1.0/3.0) /*gradtl*/, 0. /*stepmx*/, sqrt(epsm) /*steptl*/, newtheta, &logLik, grad, &itrmcd, a, work, &itncnt); if (msg == 0) { generate_DmHalf(nlme->DmHalf, nlme->dd, nlme->pdClass, theta); } Free(work); Free(a); Free(newtheta); Free(grad); Free(typsiz); Free(theta); Free(st); } nlme->objective = nlme_objective(nlme); // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions internal_loglik(nlme->dd, nlme->result[0], nlme->DmHalf, &RML, dc, DNULLP, nlme->sigma); internal_estimate(nlme->dd, dc); src = dc + (nlme->dd->ZXcols - 1) * nlme->dd->Srows; dest = incr; for(i = 0, start = 0; i <= nlme->dd->Q; i++) { for(j = 0; j < (nlme->dd->ngrp)[i]; j++) { Memcpy(dest, src + ((nlme->dd->SToff)[i][j] - start), (nlme->dd->ncol)[i]); dest += (nlme->dd->ncol)[i]; } start += (nlme->dd->ncol)[i] * nlme->dd->Srows; } for(i = 0; i < (nlme->nparTot - nlme->npar[nlme->dd->Q]); i++) { incr[i] -= theta[i]; } predObj = dc[nlme->dd->ZXcols * nlme->dd->ZXrows - 1]; predObj = predObj * predObj; /* regSS = nlme_RegSS(nlme, auxGrad); */ /* Regression Sum of Squares */ Free(Ra); Free(dc); /* Free(auxGrad); */ return(sqrt(((double) nlme->nrdof) * (nlme->objective - predObj) / (((double) nlme->nparTot) * predObj))); } static int nlme_iterate(nlmePtr nlme, double *settings) { double factor, criterion; SEXP model = nlme->model; double *newtheta = nlme->newtheta; double *theta = nlme->theta; int iteration; long maxIter = (long) settings[0]; double minFactor = settings[1]; double tolerance = settings[2]; Memcpy(newtheta, theta, nlme->nparTot); evaluate(theta, nlme->nparTot , model, nlme->result); nlme_wtCorrAdj(nlme); nlme_RSS(nlme); settings[3] = nlme->conv_failure = 0; for (factor = 1.0, iteration = 1; iteration <= maxIter; iteration++) { /* outer iteration loop */ /* increment and convergence criterion */ criterion = nlme_increment(nlme); if (nlme->conv_failure) return(iteration); /* Unable to make increment */ if (criterion < tolerance) return(iteration); /* successful completion */ int inner_it = 0; do { /* inner loop for acceptable step size */ if (factor < minFactor) { settings[3] = 1; return(iteration); } Memcpy(newtheta, theta, nlme->nparTot); d_axpy(newtheta, factor, nlme->incr, nlme->nparTot); evaluate(newtheta, nlme->nparTot , model, nlme->result); restore_dims(nlme); nlme_wtCorrAdj(nlme); nlme_RSS(nlme); nlme->new_objective = nlme_objective(nlme); if (nlme->conv_failure) return(iteration); /* unable to evaluate objective */ if((inner_it++) % 1000 == 0) R_CheckUserInterrupt(); factor /= 2.0; } while (nlme->new_objective >= nlme->objective); factor *= 4.0; if (factor > 1.0) factor = 1.0; nlme->objective = nlme->new_objective; Memcpy(theta, newtheta, nlme->nparTot); } settings[3] = 2; /* Maximum number of iterations exceeded */ return(iteration - 1); } static void nlme_wrapup(nlmePtr nlme) { SEXP model = nlme->model; evaluate(nlme->theta, nlme->nparTot , model, nlme->result); Memcpy(nlme->add_ons, nlme->result[0], nlme->dd->N * nlme->dd->ZXcols); nlme->objective = nlme_objective(nlme); Free(nlme->npar); dimFree(nlme->dd); } void fit_nlme(double *ptheta, double *pDmHalf, int *pgroups, int *pdims, int *pdClass, double *pcorFactor, double *pvarWeights, int *pcorDims, double *settings, // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions double *additional, int *pcorOpt, int *pvarOpt, double *sigma, SEXP model) { nlmePtr nlme; PROTECT(model); nlme = nlme_init(ptheta, pDmHalf, pgroups, pdims, pdClass, pcorFactor, pvarWeights, pcorDims, // 17-11-2015; Fixed sigma patch; E van Willigen; Quantitative Solutions additional, pcorOpt, pvarOpt, sigma , model); if(sqrt_eps == 0.0) sqrt_eps = sqrt(DOUBLE_EPS); settings[4] = (double) nlme_iterate(nlme, settings); nlme_wrapup(nlme); settings[5] = nlme->objective; nlmeFree(nlme); UNPROTECT(1); } void nlme_one_comp_open (int *nrow, double *Resp, double *inmat) { int i, nn = *nrow; double ke, ka, tl = 0, delta, C = 0, Ca = 0, interval, *Subject, *Time, *Conc, *Dose, *Interval, *V, *Ka, *Ke, sl = DOUBLE_EPS; /* sl is last subject number, usually */ /* an integer but passed as double. */ /* It is started at an unlikely value. */ Subject = inmat; Time = inmat + nn; Conc = inmat + 2 * nn; Dose = inmat + 3 * nn; Interval = inmat + 4 * nn; V = inmat + 5 * nn; Ka = inmat + 6 * nn; Ke = inmat + 7 * nn; for(i = nn; i--; Resp++, Subject++, Time++, Conc++, Dose++, Interval++, V++, Ka++, Ke++) { ke = *Ke; ka = *Ka; if (*Subject != sl) { /* new Subject */ sl = *Subject; tl = *Time; *Resp = 0; if (!is_na_DOUBLE(Interval)) { /* steady-state dosing */ interval = *Interval; C = *Dose * ka * (1/(1 - exp(-ke * interval)) - 1/(1 - exp(-ka * interval)))/ (*V * (ka - ke)); Ca = *Dose / (*V * (1 - exp(-ka * interval))); } else { /* non-steady-state */ C = 0; Ca = *Dose/ *V; } } else { /* same Subject */ if (!is_na_DOUBLE(Dose)) { if (!is_na_DOUBLE(Interval)) { /* steady-state dosing */ interval = *Interval; C = *Dose * ka * (1/(1 - exp(-ke * interval)) - 1/(1 - exp(-ka * interval)))/ (*V * (ka - ke)); Ca = *Dose / (*V * (1 - exp(-ka * interval))); } else { /* non-steady-state */ delta = *Time - tl; C = C*exp(-ke * delta) + Ca*ka*(exp(-ke*delta) - exp(-ka*delta))/(ka -ke); Ca = Ca * exp(-ka*delta) + *Dose / *V; } tl = *Time; *Resp = 0; } else if (!is_na_DOUBLE(Conc)) { delta = *Time - tl; *Resp = C * exp(-ke * delta) + Ca * ka * (exp(-ke * delta) - exp(-ka * delta))/(ka - ke); } else *Resp = 0; } } } /* Phenobarbital Model */ void nlme_one_comp_first (int *nrow, double *Resp, double *inmat) { int i, j, nn = *nrow, mm = 0; double v, cl, *tl = Calloc(nn, double), *ds = Calloc(nn, double), *Subject, *Time, *Dose, *V, *Cl, sl = DOUBLE_EPS; /* sl is last subject number, usually */ /* an integer but passed as double. */ /* It is started at an unlikely value. */ Subject = inmat; Time = inmat + nn; Dose = inmat + 2 * nn; V = inmat + 3 * nn; Cl = inmat + 4 * nn; for(i = nn; i--; Resp++, Subject++, Time++, Dose++, V++, Cl++) { v = *V; cl = *Cl; *Resp = 0; if (*Subject != sl) { /* new Subject */ if (is_na_DOUBLE(Dose)) { error(_("First observation on an individual must have a dose")); } sl = *Subject; mm = 0; tl[mm] = *Time; ds[mm] = *Dose; } else { /* same Subject */ if (!is_na_DOUBLE(Dose)) { /* Dose measurement */ mm++; tl[mm] = *Time; ds[mm] = *Dose; } else { /* Concentration measurement */ for(j = 0; j <= mm; j++) { *Resp += ds[j] * exp(-cl * (*Time - tl[j]) / v) / v; } } } } Free(ds); Free(tl); } nlme/src/base.h0000644000176200001440000000225412657657003013075 0ustar liggesusers/* header file for the nlme package Copyright 1999-2001 Saikat DebRoy, Douglas Bates Copyright 2007-2013 The R Core Team This file is part of the nlme package for S and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #ifndef NLME_BASE_H #define NLME_BASE_H #include #include // for memcpy #include #include #include #ifdef ENABLE_NLS # include # define _(String) dgettext ("nlme", String) #else # define _(String) (String) #endif #define DNULLP (double *) 0 extern double sqrt_eps; extern double xlower; #endif /* NLME_BASE_H */ nlme/src/corStruct.c0000644000176200001440000006362312657657003014155 0ustar liggesusers/* Routines dealing with correlation structures. Copyright 1997-2005 Douglas M. Bates , Jose C. Pinheiro, Saikat DebRoy Copyright 2007-2016 The R Core Team This file is part of the nlme package for R and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #include "matrix.h" #include /* Factor list and Recalc for general corStruct object */ void corStruct_factList(double *mat, int *pdims, double *FactorL, double *logdet) { int i, j, M = pdims[1], *len = pdims + 4, job = 11L, info; double *work, *work1; for(i = 0; i < M; i++) { int li = len[i], lisq = li * li, lip1 = li + 1; work = Calloc(li, double); work1 = Calloc(lisq, double); F77_CALL(chol) (mat, &li, &li, mat, &info); for(j = 0; j < li; j++) { work1[j * lip1] = 1; F77_CALL(dtrsl) (mat, &li, &li, work1 + j * li, &job, &info); *logdet -= log(fabs(mat[j * lip1])); } Memcpy(FactorL, work1, lisq); Free(work); Free(work1); FactorL += lisq; mat += lisq; } } void corStruct_recalc(double *Xy, int *pdims, int *ZXcol, double *Factor) { int N = pdims[0], M = pdims[1], *len = pdims + 4, *start = len + M, i; for(i = 0; i < M; i++) { mult_mat(Xy + start[i], N, Factor, len[i], len[i], len[i], Xy + start[i], N, *ZXcol); Factor += (len[i] * len[i]); } } /* symm class - unstructured correlation - based on spherical parametrization */ void symm_fullCorr(double *par, int *maxC, double *crr) /* calculates full correlation structure */ { double *work, aux, aux1, *src = par, *src1, *dest; int i, j, n = *maxC; /* first get upper-triangular factor */ dest = work = Calloc(n * (n + 1) / 2, double); for(i = 0; i < n; i++) { aux = 1.0; for(j = 0; j < i; j++) { aux1 = exp(*src); aux1 = PI * aux1/(1 + aux1); /* untransforming */ *dest = aux * cos(aux1); aux *= sin(aux1); dest++; src++; } *dest = aux; dest++; } /* getting the correlations */ for(i = 0, dest = crr, src = work; i < n - 1; i++) { int ip1 = i + 1; src += i; for(j = ip1, src1 = src; j < n; j++) { src1 += j; *dest = d_dot_prod(src, 1L, src1, 1L, ip1); dest++; } } Free(work); } static void symm_mat(double *crr, int *time, int *n, int *maxC, double *mat) { int i, j, k, np1 = *n + 1, n1, n2; for(i = 0; i < *n; i++) { mat[i * np1] = 1.0; for(j = i + 1; j < *n; j++) { n1 = (time[i] < time[j]) ? time[i] : time[j]; n2 = time[i] + time[j] - 2 * n1 - 1; k = n1 * *maxC - n1 * (n1 + 1) / 2 + n2; *(mat + i + j * (*n)) = *(mat + j + i * (*n)) = crr[k]; } } } void symm_matList(double *pars, int *time, int *maxC, int *pdims, double *mat) { double *crr = Calloc(*maxC * (*maxC - 1) / 2, double); int i, M = pdims[1], *len = pdims + 4; /* parameters assumed in unconstrained form */ symm_fullCorr(pars, maxC, crr); for(i = 0; i < M; i++) { symm_mat(crr, time, &len[i], maxC, mat); mat += len[i] * len[i]; time += len[i]; } Free(crr); } static void symm_fact(double *crr, int *time, int *n, int *maxC, double *mat, double *logdet) { int job = 11L, info, i, nsq = *n * (*n), np1 = *n + 1; double *work = Calloc(*n, double), *work1 = Calloc(nsq, double); symm_mat(crr, time, n, maxC, mat); F77_CALL(chol) (mat, n, n, mat, &info); for(i = 0; i < *n; i++) { work1[i * np1] = 1; F77_CALL(dtrsl) (mat, n, n, work1 + i * (*n), &job, &info); *logdet -= log(fabs(mat[i * np1])); } Memcpy(mat, work1, nsq); Free(work); Free(work1); } void symm_factList(double *pars, int *time, int *maxC, int *pdims, double *FactorL, double *logdet) { double *crr = Calloc(*maxC * (*maxC - 1L) / 2L, double); int i, M = pdims[1], *len = pdims + 4; /* parameters assumed in unconstrained form */ symm_fullCorr(pars, maxC, crr); for(i = 0; i < M; i++) { symm_fact(crr, time, &len[i], maxC, FactorL, logdet); FactorL += len[i] * len[i]; time += len[i]; } Free(crr); } void symm_recalc(double *Xy, int *pdims, int *ZXcol, double *pars, int *time, int *maxC, double *logdet) { int N = pdims[0], M = pdims[1], *len = pdims + 4, *start = len + M, i; double *crr = Calloc(*maxC * (*maxC - 1) / 2, double); /* parameters assumed in unconstrained form */ symm_fullCorr(pars, maxC, crr); for(i = 0; i < M; i++) { double *Factor = Calloc((len[i] * len[i]), double); symm_fact(crr, time + start[i], &len[i], maxC, Factor, logdet); mult_mat(Xy + start[i], N, Factor, len[i], len[i], len[i], Xy + start[i], N, *ZXcol); Free(Factor); } Free(crr); } /* nat class - unstructured correlation - natural parametrization */ void nat_fullCorr(double *par, int *maxC, double *crr) /* calculates full correlation structure */ { double aux; int i, npar = *maxC * (*maxC - 1) / 2; for(i = 0; i < npar; i++) { aux = exp(par[i]); crr[i] = (aux - 1)/(aux + 1); } } void nat_matList(double *pars, int *time, int *maxC, int *pdims, double *mat) { double *crr = Calloc(*maxC * (*maxC - 1) / 2, double); int i, M = pdims[1], *len = pdims + 4; /* parameters assumed in unconstrained form */ nat_fullCorr(pars, maxC, crr); for(i = 0; i < M; i++) { symm_mat(crr, time, &len[i], maxC, mat); mat += len[i] * len[i]; time += len[i]; } Free(crr); } void nat_factList(double *pars, int *time, int *maxC, int *pdims, double *FactorL, double *logdet) { double *crr = Calloc(*maxC * (*maxC - 1L) / 2L, double); int i, M = pdims[1], *len = pdims + 4; /* parameters assumed in unconstrained form */ nat_fullCorr(pars, maxC, crr); for(i = 0; i < M; i++) { symm_fact(crr, time, &len[i], maxC, FactorL, logdet); FactorL += len[i] * len[i]; time += len[i]; } Free(crr); } void nat_recalc(double *Xy, int *pdims, int *ZXcol, double *pars, int *time, int *maxC, double *logdet) { int N = pdims[0], M = pdims[1], *len = pdims + 4, *start = len + M, i; double *crr = Calloc(*maxC * (*maxC - 1) / 2, double); /* parameters assumed in unconstrained form */ nat_fullCorr(pars, maxC, crr); for(i = 0; i < M; i++) { double *Factor = Calloc((len[i] * len[i]), double); symm_fact(crr, time + start[i], &len[i], maxC, Factor, logdet); mult_mat(Xy + start[i], N, Factor, len[i], len[i], len[i], Xy + start[i], N, *ZXcol); Free(Factor); } Free(crr); } /* AR1 class */ static void AR1_mat(double *par, int *n, double *mat) { int i, j; double aux; for(i = 0; i < *n; i++) { *(mat + i * (*n + 1)) = 1.0; for(j = i + 1; j < *n; j++) { aux = pow(*par, j - i); *(mat + i + j * (*n)) = *(mat + j + i * (*n)) = aux; } } } static double safe_phi(double x) /* returns (exp(x) - 1)/(exp(x) + 1), x < 0 */ { /* or (1 - exp(-x))/(1 + exp(-x)), x > 0 */ double ex; if (x < 0.0) { ex = exp(x); return (ex - 1.0)/(ex + 1.0); } ex = exp(-x); return (1.0 - ex)/(1.0 + ex); } void AR1_matList(double *par, int *pdims, double *mat) { int i, M = pdims[1], *len = pdims + 4; /* par assumed in unconstrained form */ *par = safe_phi( *par ); for(i = 0; i < M; i++) { AR1_mat(par, &len[i], mat); mat += len[i] * len[i]; } } static void AR1_fact(double *par, int *n, double *mat, double *logdet) { int i, np1 = *n + 1; double aux = sqrt(1 - *par * (*par)), aux1 = - (*par)/aux; *logdet -= (*n - 1) * log(aux); aux = 1/aux; mat[0] = 1; for(i = 1; i < *n; i++) { mat[i * np1] = aux; mat[i + *n * (i - 1)] = aux1; } } void AR1_factList(double *par, int *pdims, double *FactorL, double *logdet) { int i, M = pdims[1], *len = pdims + 4; /* par assumed in unconstrained form */ *par = safe_phi( *par ); for(i = 0; i < M; i++) { AR1_fact(par, &len[i], FactorL, logdet); FactorL += len[i] * len[i]; } } void AR1_recalc(double *Xy, int *pdims, int *ZXcol, double *par, double *logdet) { int N = pdims[0], M = pdims[1], *len = pdims + 4, *start = len + M, i; double *Factor; /* par assumed in unconstrained form */ *par = safe_phi( *par ); for(i = 0; i < M; i++) { Factor = Calloc(len[i] * len[i], double); AR1_fact(par, &len[i], Factor, logdet); mult_mat(Xy + start[i], N, Factor, len[i], len[i], len[i], Xy + start[i], N, *ZXcol); Free(Factor); } } /* Continuous AR1 class */ static void CAR1_mat(double *par, double *time, int *n, double *mat) { int i, j; double aux; for(i = 0; i < *n; i++) { *(mat + i * (*n + 1)) = 1.0; for(j = i + 1; j < *n; j++) { aux = pow(*par, fabs(time[j] - time[i])); *(mat + i + j * (*n)) = *(mat + j + i * (*n)) = aux; } } } void CAR1_matList(double *par, double *time, int *pdims, double *mat) { int i, M = pdims[1], *len = pdims + 4; double aux = exp(*par); /* parameter assumed in unconstrained form */ *par = aux / (1.0 + aux); for(i = 0; i < M; i++) { CAR1_mat(par, time, &len[i], mat); mat += len[i] * len[i]; time += len[i]; } } static void CAR1_fact(double *par, double *time, int *n, double *mat, double *logdet) { int job = 11L, info, i, nsq = *n * (*n), np1 = *n + 1; double *work = Calloc(*n, double), *work1 = Calloc(nsq, double); CAR1_mat(par, time, n, mat); F77_CALL(chol) (mat, n, n, mat, &info); for(i = 0; i < *n; i++) { work1[i * np1] = 1; F77_CALL(dtrsl) (mat, n, n, work1 + i * (*n), &job, &info); *logdet -= log(fabs(mat[i * np1])); } Memcpy(mat, work1, nsq); Free(work); Free(work1); } void CAR1_factList(double *par, double *time, int *pdims, double *FactorL, double *logdet) { int i, M = pdims[1], *len = pdims + 4; double aux = exp(*par); /* parameter assumed in unconstrained form */ *par = aux / (1.0 + aux); for(i = 0; i < M; i++) { CAR1_fact(par, time, &len[i], FactorL, logdet); FactorL += len[i] * len[i]; time += len[i]; } } void CAR1_recalc(double *Xy, int *pdims, int *ZXcol, double *par, double *time, double *logdet) { int N = pdims[0], M = pdims[1], *len = pdims + 4, *start = len + M, i; double aux = exp(*par); /* parameter assumed in unconstrained form */ *par = aux / (1.0 + aux); for(i = 0; i < M; i++) { double *Factor = Calloc(len[i] * len[i], double); CAR1_fact(par, time + start[i], &len[i], Factor, logdet); mult_mat(Xy + start[i], N, Factor, len[i], len[i], len[i], Xy + start[i], N, *ZXcol); Free(Factor); } } /* ARMA class */ static void ARMA_transPar(int N, double *pars, double sgn) { int i, j, n, n2; double ps, D, aux; for(n = N - 1; n > -1; n--) { if ((ps = pars[n] * pars[n]) >= 1.0) error(_("All parameters must be less than 1 in absolute value")); if (n) { D = 1 - ps; n2 = (n - 1)/2; for(i = 0; i <= n2; i++) { if ((j = n - i -1) > i) { aux = (pars[i] + sgn * pars[j] * pars[n])/D; pars[j] = (pars[j] + sgn * pars[i] * pars[n])/D; pars[i] = aux; } else { pars[i] /= (1 - sgn * pars[n]); } } } pars[n] = log((1 + pars[n])/(1 - pars[n])); } } void ARMA_unconstCoef(int *p, int *q, double *pars) { ARMA_transPar(*p, pars, 1.0); ARMA_transPar(*q, pars + *p, -1.0); } static void ARMA_untransPar(int N, double *pars, double sgn) { int i, j; double *aux; if (N) { aux = Calloc(N, double); for(i = 0; i < N; i++) { pars[i] = exp(-pars[i]); aux[i] = pars[i] = (1 - pars[i])/(1 + pars[i]); if (i) { for(j = 0; j < i; j++) { pars[j] = aux[j] + sgn * pars[i] * aux[i - j - 1]; } Memcpy(aux, pars, i); } } Free(aux); } } void ARMA_constCoef(int *p, int *q, double *pars) { ARMA_untransPar(*p, pars, -1.0); ARMA_untransPar(*q, pars + *p, 1.0); } static void ARMA_cross(int *p, int *q, double *pars, double *psi) { int i, j, M = *q + 1, PM; M = (*p > M ? *p : M); psi[0] = 1; for(i = 1; i < M; i++) { psi[i] = ((*q < i) ? 0 : pars[*p + i - 1]); PM = (*p < i ? *p : i); for(j = 0; j < PM; j++) { psi[i] += pars[j] * psi[i - j - 1]; } } } static void ARMA_corr(int *p, int *q, int *maxlag, double *pars, double *psi, double *crr) { int P = *p + 1, Pp1 = P + 1, i, j, k, minPQ, Mlag, maxPQ, *pivot = Calloc(P, int); double *coef = Calloc(P * P, double), *src, *qraux = Calloc(P, double), *work = Calloc(P * P, double), *work1; if (sqrt_eps == 0.0) sqrt_eps = sqrt(DOUBLE_EPS); if ((maxPQ = ((*p > *q) ? *p : *q))) { for(i = 0, src = coef; i < P; i++, src += Pp1) { crr[i] = 0; *src = 1; } Mlag = ((*maxlag > *q) ? *maxlag : *q); Mlag = ((Mlag > *p) ? Mlag : *p) + 1; work1 = Calloc(Mlag, double); for(i = P; i < Mlag; i++) { crr[i] = 0; } crr[0] = 1; for(i = 1, src = pars + *p; i <= *q; i++, src++) { crr[0] += (*src) * psi[i]; } if (*p) { if ((minPQ = ((*p < *q) ? *p : *q))) { for(i = 1, src = pars + *p - 1; i <= minPQ; i++) { for(j = i; j <= *q; j++) { crr[i] += *(src + j) * psi[j - i]; } } } for(i = 0, src = coef; i < P; i++, src++) { for(j = 0; j < *p; j++) { k = i - j - 1; k = ((k > 0) ? k : -k); *(src + (k * P)) -= pars[j]; } } /* F77_CALL(dqrdca) (coef, &P, &P, &P, qraux, pivot, work, &i, &sqrt_eps); */ F77_CALL(dqrdc2) (coef, &P, &P, &P, &sqrt_eps, &i, qraux, pivot, work); if (i < P) error(_("Coefficient matrix not invertible" )); i = 100L; F77_CALL(dqrsl) (coef, &P, &P, &P, qraux, crr, DNULLP, crr, work1, DNULLP, DNULLP, &i, &j); Memcpy(crr, work1, Mlag); } for(i = P; i <= *q; i++) { for(j = 0; j < *p; j++) { crr[i] += pars[j] * crr[i - j - 1]; } for(j = i, src = pars + i - 1; j <= *q; j++, src++) { crr[i] += *src * psi[j - i]; } } for(i = maxPQ + 1; i < Mlag; i++) { for(j = 0; j < *p; j++) { crr[i] += pars[j] * crr[i - j - 1]; } } for(i = 1; i < Mlag; i++) { crr[i] /= crr[0]; } Free(qraux); Free(work); Free(coef); Free(pivot); Free(work1); } crr[0] = 1; } static void ARMA_fullCorr(int *p, int *q, int *maxlag, double *pars, double *crr) { int M = *q + 1; double *psi; M = ((M < *p) ? *p : M); psi = Calloc(M, double); ARMA_cross(p, q, pars, psi); ARMA_corr(p, q, maxlag, pars, psi, crr); Free(psi); } static void ARMA_mat(double *crr, int *time, int *n, double *mat) { int i, j, k; for(i = 0; i < *n; i++) { for(j = i; j < *n; j++) { k = time[j] - time[i]; k = ((k < 0) ? -k : k); *(mat + i + j * (*n)) = *(mat + j + i * (*n)) = crr[k]; } } } void ARMA_matList(double *pars, int *p, int *q, int *time, int *maxlag, int *pdims, double *mat) { double *crr = Calloc(*maxlag + 1L, double); int i, M = pdims[1], *len = pdims + 4; /* parameters assumed in unconstrained form */ ARMA_constCoef(p, q, pars); ARMA_fullCorr(p, q, maxlag, pars, crr); for(i = 0; i < M; i++) { ARMA_mat(crr, time, &len[i], mat); mat += len[i] * len[i]; time += len[i]; } Free(crr); } static void ARMA_fact(double *crr, int *time, int *n, double *mat, double *logdet) { int job = 11L, info, i, nsq = *n * (*n), np1 = *n + 1; double *work = Calloc(*n, double), *work1 = Calloc(nsq, double); ARMA_mat(crr, time, n, mat); F77_CALL(chol) (mat, n, n, mat, &info); for(i = 0; i < *n; i++) { work1[i * np1] = 1; F77_CALL(dtrsl) (mat, n, n, work1 + i * (*n), &job, &info); *logdet -= log(fabs(mat[i * np1])); } Memcpy(mat, work1, nsq); Free(work); Free(work1); } void ARMA_factList(double *pars, int *p, int *q, int *time, int *maxlag, int *pdims, double *FactorL, double *logdet) { double *crr = Calloc(*maxlag + 1L, double); int i, M = pdims[1], *len = pdims + 4; /* parameters assumed in unconstrained form */ ARMA_constCoef(p, q, pars); ARMA_fullCorr(p, q, maxlag, pars, crr); for(i = 0; i < M; i++) { ARMA_fact(crr, time, &len[i], FactorL, logdet); FactorL += len[i] * len[i]; time += len[i]; } Free(crr); } void ARMA_recalc(double *Xy, int *pdims, int *ZXcol, double *pars, int *p, int *q, int *time, int *maxlag, double *logdet) { int N = pdims[0], M = pdims[1], *len = pdims + 4, *start = len + M, i; double *crr = Calloc(*maxlag + 1L, double); /* parameters assumed in unconstrained form */ ARMA_constCoef(p, q, pars); ARMA_fullCorr(p, q, maxlag, pars, crr); for(i = 0; i < M; i++) { double *Factor = Calloc(len[i] * len[i], double); ARMA_fact(crr, time + start[i], &len[i], Factor, logdet); mult_mat(Xy + start[i], N, Factor, len[i], len[i], len[i], Xy + start[i], N, *ZXcol); Free(Factor); } } /* Compound symmetry */ static void compSymm_mat(double *par, int *n, double *mat) { int i, j; for(i = 0; i < *n; i++) { mat[(*n + 1) * i] = 1.0; for(j = i + 1; j < *n; j++) { *(mat + i + j * (*n)) = *(mat + j + i * (*n)) = *par; } } } void compSymm_matList(double *par, double *inf, int *pdims, double *mat) { int i, M = pdims[1], *len = pdims + 4; /* parameter assumed in unconstrained form */ double aux = exp(*par); *par = (aux + *inf)/(aux + 1.0); for(i = 0; i < M; i++) { compSymm_mat(par, &len[i], mat); mat += len[i] * len[i]; } } static void compSymm_fact(double *par, int *n, double *mat, double *logdet) { int i, j, np1 = *n + 1, nsq = *n * (*n); double aux, aux1, *work = Calloc(nsq, double); aux = 1 + (*n - 1) * (*par); *logdet -= log(aux)/2; aux = 1/sqrt(aux * (*n)); for(i = 0; i < nsq; i += *n) { work[i] = aux; } aux = 1 - (*par); *logdet -= (*n - 1) * log(aux)/2; for(i = 1; i < *n; i++) { aux1 = -1/sqrt(aux * i * (i + 1)); for(j = 0; j < i; j++) { work[i + j * (*n)] = aux1; } work[i * np1] = -i * aux1; } Memcpy(mat, work, nsq); Free(work); } void compSymm_factList(double *par, double *inf, int *pdims, double *FactorL, double *logdet) { int i, M = pdims[1], *len = pdims + 4; /* parameter assumed in unconstrained form */ double aux = exp(*par); *par = (aux + *inf)/(aux + 1.0); for(i = 0; i < M; i++) { compSymm_fact(par, &len[i], FactorL, logdet); FactorL += len[i] * len[i]; } } void compSymm_recalc(double *Xy, int *pdims, int *ZXcol, double *par, double *inf, double *logdet) { int N = pdims[0], M = pdims[1], *len = pdims + 4, *start = len + M, i; double aux = exp(*par); /* parameter assumed in unconstrained form */ *par = (aux + *inf)/(aux + 1.0); for(i = 0; i < M; i++) { double *Factor = Calloc(len[i] * len[i], double); compSymm_fact(par, &len[i], Factor, logdet); mult_mat(Xy + start[i], N, Factor, len[i], len[i], len[i], Xy + start[i], N, *ZXcol); Free(Factor); } } /* Huyn-Feldt class */ static void HF_mat(double *par, int *time, int *n, double *mat) { int i, j, np1 = *n + 1; for(i = 0; i < *n; i++) { mat[i * np1] = par[time[i]]; for(j = i + 1; j < *n; j++) { *(mat + i + j * (*n)) = *(mat + j + i * (*n)) = 0.5 * (par[time[i]] + par[time[j]]) - 1.0; } } } void HF_matList(double *par, int *maxC, int *time, int *pdims, double *mat) { int i, M = pdims[1], *len = pdims + 4; /* parameter assumed in unconstrained form */ double inf = -1.0/(2.0 * ((double) *maxC)); for(i = 0; i < *maxC; i++) { par[i] = 2.0 * (exp(par[i]) + inf) + 1.0; } for(i = 0; i < M; i++) { HF_mat(par, time, &len[i], mat); mat += len[i] * len[i]; time += len[i]; } } static void HF_fact(double *par, int *time, int *n, double *mat, double *logdet) { int job = 11L, info, i, nsq = *n * (*n), np1 = *n + 1; double *work = Calloc(*n, double), *work1 = Calloc(nsq, double); HF_mat(par, time, n, mat); F77_CALL(chol) (mat, n, n, mat, &info); for(i = 0; i < *n; i++) { work1[i * np1] = 1; F77_CALL(dtrsl) (mat, n, n, work1 + i * (*n), &job, &info); *logdet -= log(fabs(mat[i * np1])); } Memcpy(mat, work1, nsq); Free(work); Free(work1); } void HF_factList(double *par, int *maxC, int *time, int *pdims, double *FactorL, double *logdet) { int i, M = pdims[1], *len = pdims + 4; /* parameter assumed in unconstrained form */ double inf = -1.0/(2.0 * ((double) *maxC)); for(i = 0; i < *maxC; i++) { par[i] = 2.0 * (exp(par[i]) + inf) + 1.0; } for(i = 0; i < M; i++) { HF_fact(par, time, &len[i], FactorL, logdet); FactorL += len[i] * len[i]; time += len[i]; } } void HF_recalc(double *Xy, int *pdims, int *ZXcol, double *par, int *time, int *maxC, double *logdet) { int N = pdims[0], M = pdims[1], *len = pdims + 4, *start = len + M, i; double inf = -1.0/(2.0 * ((double) *maxC)); /* parameter assumed in unconstrained form */ for(i = 0; i < *maxC; i++) { par[i] = 2.0 * (exp(par[i]) + inf) + 1.0; } for(i = 0; i < M; i++) { double *Factor = Calloc(len[i] * len[i], double); HF_fact(par, time + start[i], &len[i], Factor, logdet); mult_mat(Xy + start[i], N, Factor, len[i], len[i], len[i], Xy + start[i], N, *ZXcol); Free(Factor); } } /* Spatial correlation structures */ /* Spherical class */ static double spher_corr(double val) { if (val < 1) return(1.0 - 1.5 * val + 0.5 * pow(val, 3)); else return(0.0); } /* Exponential class */ static double exp_corr(double val) { return(exp(-val)); } /* Gaussian class */ static double Gaus_corr(double val) { return(exp(-(val * val))); } /* Linear class */ static double lin_corr(double val) { if (val < 1) return(1.0 - val); else return(0.0); } /* Rational class */ static double ratio_corr(double val) { double val2 = val * val; return(1/(1+val2)); } /* Dummy class */ static double dummy_corr(double val) { error(_("Unknown spatial correlation class")); return(0.0); /* -Wall */ } /* methods for the virtual class */ static void spatial_mat(double *par, double *dist, int *n, int *nug, double (*corr)(double ), double *mat) { int i, j, np1 = *n + 1; double aux, *sdist, ratio = 1.0; sdist = dist; if (*nug) ratio = par[1]; for(i = 0; i < *n; i++) { mat[i * np1] = 1.0; for(j = i + 1; j < *n; j++, sdist++) { aux = *sdist / *par; *(mat + i + j * (*n)) = *(mat + j + i * (*n)) = ratio * corr(aux); } } } void spatial_matList(double *par, int *nug, double *dist, int *pdims, double *minD, double *mat) { int i, M = pdims[1], spClass = pdims[2], *len = pdims + 4, *start = len + M; double aux, (*corr)(double ) = dummy_corr; /* parameter assumed in unconstrained form */ par[0] = exp(par[0]); if (*nug == 1) { aux = exp(par[1]); par[1] = 1 / (1.0 + aux); /* 1 - nugget */ } switch(spClass) { case 1: /* spherical */ corr = spher_corr; par[0] += *minD; break; case 2: /* exponential */ corr = exp_corr; break; case 3: /* Gaussian */ corr = Gaus_corr; break; case 4: /* linear */ corr = lin_corr; par[0] += *minD; break; case 5: /* rational quadratic */ corr = ratio_corr; break; default: error(_("Unknown spatial correlation class")); break; } for(i = 0; i < M; i++) { spatial_mat(par, dist + start[i], &len[i], nug, corr, mat); mat += len[i] * len[i]; } } static void spatial_fact(double *par, double *dist, int *n, int *nug, double (*corr) (double ), double *mat, double *logdet) { int job = 11L, info, i, nsq = *n * (*n), np1 = *n + 1; double *work = Calloc(*n, double), *work1 = Calloc(nsq, double); spatial_mat(par, dist, n, nug, corr, mat); F77_CALL(chol) (mat, n, n, mat, &info); for(i = 0; i < *n; i++) { work1[i * np1] = 1; F77_CALL(dtrsl) (mat, n, n, work1 + i * (*n), &job, &info); *logdet -= log(fabs(mat[i * np1])); } Memcpy(mat, work1, nsq); Free(work); Free(work1); } void spatial_factList(double *par, int *nug, double *dist, int *pdims, double *minD, double *FactorL, double *logdet) { int i, M = pdims[1], spClass = pdims[2], *len = pdims + 4, *start = len + M; double aux, (*corr)(double ) = dummy_corr; /* parameter assumed in unconstrained form */ par[0] = exp(par[0]); if (*nug == 1) { aux = exp(par[1]); par[1] = 1 / (1.0 + aux); /* 1 - nugget */ } switch(spClass) { case 1: /* spherical */ corr = spher_corr; par[0] += *minD; break; case 2: /* exponential */ corr = exp_corr; break; case 3: /* Gaussian */ corr = Gaus_corr; break; case 4: /* linear */ corr = lin_corr; par[0] += *minD; break; case 5: /* rational quadratic */ corr = ratio_corr; break; default: error(_("Unknown spatial correlation class")); break; } for(i = 0; i < M; i++) { spatial_fact(par, dist + start[i], &len[i], nug, corr, FactorL, logdet); FactorL += len[i] * len[i]; } } void spatial_recalc(double *Xy, int *pdims, int *ZXcol, double *par, double *dist, double *minD, int *nug, double *logdet) { int N = pdims[0], M = pdims[1], spClass = pdims[2], *len = pdims + 4, *start = len + M, i; double aux, (*corr)(double ) = dummy_corr, *sXy; /* parameter assumed in unconstrained form */ par[0] = exp(par[0]); if (*nug == 1) { aux = exp(par[1]); par[1] = 1 / (1.0 + aux); /* 1 - nugget */ } switch(spClass) { case 1: /* spherical */ corr = spher_corr; par[0] += *minD; break; case 2: /* exponential */ corr = exp_corr; break; case 3: /* Gaussian */ corr = Gaus_corr; break; case 4: /* linear */ corr = lin_corr; par[0] += *minD; break; case 5: /* rational quadratic */ corr = ratio_corr; break; default: error(_("Unknown spatial correlation class")); break; } for(i = 0, sXy = Xy; i < M; i++) { double *Factor = Calloc(len[i] * len[i], double); spatial_fact(par, dist + start[i], &len[i], nug, corr, Factor, logdet); mult_mat(sXy, N, Factor, len[i], len[i], len[i], sXy, N, *ZXcol); sXy += len[i]; Free(Factor); } } nlme/src/nlOptimizer.c0000644000176200001440000000253612657657003014475 0ustar liggesusers/* Implementation of eval_model() and spread() for R. Copyright 1999 Saikat DebRoy Copyright 2007-2016 The R Core Team This file is part of the nlme package for S and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #include "nlOptimizer.h" int evaluate(double *param, int nParam, SEXP model, double **value) { SEXP newPars, call, result; int i, nResult; PROTECT(newPars = allocVector(REALSXP, nParam)); PROTECT(model); for(i = 0; i < nParam; i++) REAL(newPars)[i] = param[i]; PROTECT(call = lang2(model, newPars)); PROTECT(result = eval(call, R_GlobalEnv)); nResult = LENGTH(result); if(value[0] == (double *) 0) { UNPROTECT(4); return(nResult); } double *res = REAL(result); for(i = 0; i < nResult; i++) value[0][i] = res[i]; UNPROTECT(4); return(-1); } nlme/src/nlOptimizer.h0000644000176200001440000000206512657657003014477 0ustar liggesusers/* header file for the nlme package Copyright 1999 Saikat DebRoy Copyright 2007-2016 The R Core Team This file is part of the nlme package for R and related languages and is made available under the terms of the GNU General Public License, version 2, or at your option, any later version, incorporated herein by reference. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, a copy is available at http://www.r-project.org/Licenses/ */ #ifndef NLME_NLOPTIMIZER_H #define NLME_NLOPTIMIZER_H #include "base.h" #include "Rinternals.h" extern int evaluate(double *, int, SEXP model, double **); extern void fit_gnls(double *, int *, double *, double *, int *, double *, double *, int *, int *, SEXP model); #endif /* NLME_NLOPTIMIZER_H */ nlme/R/0000755000176200001440000000000013452715114011411 5ustar liggesusersnlme/R/newMethods.R0000644000176200001440000006350513336503465013667 0ustar liggesusers### Methods for generics from newGenerics.q for some standard classes ### ### Copyright 2006-2018 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates ##*## Methods for some of the generics in newGenerics.q for standard classes Dim.default <- function(object, ...) dim(object) getCovariate.data.frame <- function(object, form = formula(object), data) { ## Return the primary covariate if (!(inherits(form, "formula"))) { stop("'form' must be a formula") } aux <- getCovariateFormula(form) if (length(all.vars(aux)) > 0) { eval(aux[[2]], object) } else { rep(1, dim(object)[1]) } } getData.nls <- function(object) { mCall <- object$call ## avoid partial matches here. data <- eval(if("data" %in% names(object)) object$data else mCall$data) if (is.null(data)) return(data) naAct <- object[["na.action"]] if (!is.null(naAct)) { ## guessing here: known values (omit, exclude) work. data <- if (inherits(naAct, "omit")) data[-naAct, ] else if (inherits(naAct, "exclude")) data else eval(mCall$na.action)(data) } subset <- mCall$subset if (!is.null(subset)) { subset <- eval(asOneSidedFormula(subset)[[2]], data) data <- data[subset, ] } data } getGroups.data.frame <- ## Return the groups associated with object according to form for level function(object, form = formula(object), level, data, sep = "/") { if (!missing(data)) { stop( "data argument to \"data.frame\" method for 'getGroups' does not make sense" ) } if (inherits(form, "formula")) { grpForm <- getGroupsFormula(form, asList = TRUE, sep = sep) if (is.null(grpForm)) { ## will use right hand side of form as the group formula grpForm <- splitFormula(asOneSidedFormula(form[[length(form)]]), sep = sep) names(grpForm) <- unlist( lapply( grpForm, function(el) deparse( el[[ length(el) ]] ) ) ) } if (any(vapply(grpForm, function(el) length(all.vars(el)) != 1, NA))) stop("invalid formula for groups") form <- grpForm } else if (data.class(form) == "list") { if (!all(vapply(form, function(el) inherits(el, "formula"), NA))) { stop("'form' must have all components as formulas") } } else { stop("'form' can only be a formula, or a list of formulas") } vlist <- lapply(form, function(x, N) { val <- eval(x[[length(x)]], object) if (length(val) == 1L) # repeat groups as.factor(rep(val, N)) else as.factor(val)[drop = TRUE] }, N = nrow(object)) if (length(vlist) == 1) return(vlist[[1]]) # ignore level - only one choice ## make the list into a data frame with appropriate names value <- do.call("data.frame", vlist) row.names(value) <- row.names(object) ## needed for fitted.lme if (missing(level)) return(value) if (is.character(level)) { nlevel <- match(level, names(vlist)) if (any(aux <- is.na(nlevel))) { stop(gettextf("level of %s does not match formula %s", level[aux], sQuote(deparse(form))), domain = "NA") } } else { nlevel <- as.numeric(level) if (any(aux <- is.na(match(nlevel, 1:ncol(value))))) { stop(gettextf("level of %s does not match formula %s", level[aux], sQuote(deparse(form))), domain = "NA") } } if (length(nlevel) > 1) return(value[, nlevel]) # multicolumn selection if (nlevel == 1) return(value[, 1]) # no need to do more work value <- value[, 1:nlevel] val <- as.factor(do.call("paste", c(lapply(as.list(value), as.character), sep = sep))) if (inherits(value[, 1], "ordered")) { value <- value[do.call("order", value),] aux <- unique(do.call("paste", c(lapply(as.list(value), as.character), sep = sep))) ordered(val, aux) } else { ordered(val, unique(as.character(val))) } } getResponse.data.frame <- function(object, form = formula(object)) { ## Return the response, the evaluation of the left hand side of a formula ## on object if (!(inherits(form, "formula") && (length(form) == 3))) { stop("'form' must be a two-sided formula") } eval(form[[2]], object) } getGroupsFormula.default <- ## Return the formula(s) for the groups associated with object. ## The result is a one-sided formula unless asList is TRUE in which case ## it is a list of formulas, one for each level. function(object, asList = FALSE, sep = "/") { form <- formula(object) if (!inherits(form, "formula")){ stop("'form' argument must be a formula") } form <- form[[length(form)]] if (!(length(form) == 3L && form[[1L]] == as.name("|"))) ## no conditioning expression return(NULL) ## val <- list( asOneSidedFormula( form[[ 3 ]] ) ) val <- splitFormula(asOneSidedFormula(form[[3]]), sep = sep) names(val) <- unlist(lapply(val, function(el) deparse(el[[2]]))) # if (!missing(level)) { # if (length(level) == 1) { # return(val[[level]]) # } else { # val <- val[level] # } # } if (asList) as.list(val) else as.formula(eval(parse(text = paste("~", paste(names(val), collapse = sep))))) } Names.formula <- function(object, data = list(), exclude = c("pi", "."), ...) { if (!is.list(data)) { return(NULL) } # no data to evaluate variable names allV <- all.vars(object) allV <- allV[is.na(match(allV, exclude))] if (length(allV) == 0) { if (attr(terms(object), "intercept")) "(Intercept)" ## else NULL } else if (!anyNA(match(allV, names(data)))) dimnames(model.matrix(object, model.frame(object, data)))[[2]] ## else NULL } Names.listForm <- function(object, data = list(), exclude = c("pi", "."), ...) { pnames <- as.character(unlist(lapply(object, `[[`, 2L))) nams <- lapply(object, function(el) Names(getCovariateFormula(el), data, exclude)) if (is.null(nams[[1]])) return(NULL) val <- c() for(i in seq_along(object)) val <- c(val, if ((length(nams[[i]]) == 1) && (nams[[i]] == "(Intercept)")) pnames[i] else paste(pnames[i], nams[[i]], sep = ".")) val } needUpdate.default <- function(object) { val <- attr(object, "needUpdate") !is.null(val) && val } ##--- needs Trellis/Lattice : pairs.compareFits <- function(x, subset, key = TRUE, ...) { object <- x if(!missing(subset)) { object <- object[subset,,] } dims <- dim(object) if(dims[3] == 1) { stop("at least two coefficients are needed") } dn <- dimnames(object) coefs <- array(c(object), c(dims[1]*dims[2], dims[3]), list(rep(dn[[1]], dims[2]), dn[[3]])) if(dims[3] > 2) { # splom tt <- list(coefs = coefs, grp = ordered(rep(dn[[2]], rep(dims[1], dims[2])), levels = dn[[2]])) args <- list(~ coefs, data = tt, groups = tt$grp, panel = function(x, y, subscripts, groups, ...) { x <- as.numeric(x) y <- as.numeric(y) panel.superpose(x, y, subscripts, groups) aux <- groups[subscripts] aux <- aux == unique(aux)[1] lsegments(x[aux], y[aux], x[!aux], y[!aux], lty = 2, lwd = 0.5) }) } else { tt <- list(x = coefs[,1], y = coefs[,2], grp = ordered(rep(dn[[2]], rep(dims[1], dims[2])), levels = dn[[2]])) args <- list(y ~ x, data = tt, groups = tt$grp, panel = function(x, y, subscripts, groups, ...) { x <- as.numeric(x) y <- as.numeric(y) panel.grid() panel.superpose(x, y, subscripts, groups) aux <- groups[subscripts] aux <- aux == unique(aux)[1] lsegments(x[aux], y[aux], x[!aux], y[!aux], lty = 2, lwd = 0.5) }, xlab = dn[[3]][1], ylab = dn[[3]][2]) } dots <- list(...) args[names(dots)] <- dots if(is.logical(key)) { if(key && length(unique(tt$grp)) > 1) { args[["key"]] <- list(points = Rows(trellis.par.get("superpose.symbol"), 1:2), text = list(levels = levels(tt$grp)), columns = 2) } } else { args[["key"]] <- key } if(dims[3] > 2) do.call("splom", args) else do.call("xyplot", args) } ##--- needs Trellis/Lattice : plot.nls <- function(x, form = resid(., type = "pearson") ~ fitted(.), abline, id = NULL, idLabels = NULL, idResType = c("pearson", "normalized"), grid, ...) ## Diagnostic plots based on residuals and/or fitted values { object <- x if (!inherits(form, "formula")) { stop("'form' must be a formula") } ## constructing data allV <- all.vars(asOneFormula(form, id, idLabels)) allV <- allV[is.na(match(allV,c("T","F","TRUE","FALSE")))] if (length(allV) > 0) { data <- getData(object) if (is.null(data)) { # try to construct data alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(list(quote(data.frame)), alist) mode(alist) <- "call" data <- eval(alist, sys.parent(1)) } else { if (any(naV <- is.na(match(allV, names(data))))) { stop(sprintf(ngettext(sum(naV), "%s not found in data", "%s not found in data"), allV[naV]), domain = NA) } } } else data <- NULL if (inherits(data, "groupedData")) { # save labels and units, if present ff <- formula(data) rF <- deparse(getResponseFormula(ff)[[2]]) cF <- c_deparse(getCovariateFormula(ff)[[2]]) lbs <- attr(data, "labels") unts <- attr(data, "units") if (!is.null(lbs$x)) cL <- paste(lbs$x, unts$x) else cF <- NULL if (!is.null(lbs$y)) rL <- paste(lbs$y, unts$y) else rF <- NULL } else { rF <- cF <- NULL } ## argument list dots <- list(...) args <- if (length(dots) > 0) dots else list() ## appending object to data data <- as.list(c(as.list(data), . = list(object))) ## covariate - must always be present covF <- getCovariateFormula(form) .x <- eval(covF[[2]], data) if (!is.numeric(.x)) { stop("covariate must be numeric") } argForm <- ~ .x argData <- data.frame(.x = .x, check.names = FALSE) if (is.null(xlab <- attr(.x, "label"))) { xlab <- deparse(covF[[2]]) if (!is.null(cF) && (xlab == cF)) xlab <- cL #### BUG!!!! else if (!is.null(rF) && (xlab == rF)) xlab <- rL } if (is.null(args$xlab)) args$xlab <- xlab ## response - need not be present respF <- getResponseFormula(form) if (!is.null(respF)) { .y <- eval(respF[[2]], data) if (is.null(ylab <- attr(.y, "label"))) { ylab <- deparse(respF[[2]]) if (!is.null(cF) && (ylab == cF)) ylab <- cL else if (!is.null(rF) && (ylab == rF)) ylab <- rL } argForm <- .y ~ .x argData[, ".y"] <- .y if (is.null(args$ylab)) args$ylab <- ylab } ## groups - need not be present grpsF <- getGroupsFormula(form) if (!is.null(grpsF)) { gr <- splitFormula(grpsF, sep = "*") for(i in seq_along(gr)) { auxGr <- all.vars(gr[[i]]) for(j in auxGr) { argData[[j]] <- eval(as.name(j), data) } } if (length(argForm) == 2) argForm <- eval(parse(text = paste("~ .x |", deparse(grpsF[[2]])))) else argForm <- eval(parse(text = paste(".y ~ .x |", deparse(grpsF[[2]])))) } ## adding to args list args <- c(list(argForm, data = argData), args) ## if (is.null(args$strip)) { ## args$strip <- function(...) strip.default(..., style = 1) ## } if (is.null(args$cex)) args$cex <- par("cex") if (is.null(args$adj)) args$adj <- par("adj") if (!is.null(id)) { # identify points in plot idResType <- match.arg(idResType) id <- switch(mode(id), numeric = { if ((id <= 0) || (id >= 1)) { stop("'id' must be between 0 and 1") } as.logical(abs(resid(object, type = idResType)) > -qnorm(id / 2)) }, call = eval(asOneSidedFormula(id)[[2]], data), stop("'id' can only be a formula or numeric") ) if (is.null(idLabels)) { idLabels <- getGroups(object) if (length(idLabels) == 0) idLabels <- 1:object$dims$N idLabels <- as.character(idLabels) } else { if (mode(idLabels) == "call") { idLabels <- as.character(eval(asOneSidedFormula(idLabels)[[2]], data)) } else if (is.vector(idLabels)) { if (length(idLabels <- unlist(idLabels)) != length(id)) { stop("'idLabels' of incorrect length") } idLabels <- as.character(idLabels) } else { stop("'idLabels' can only be a formula or a vector") } } } ## defining abline, if needed if (missing(abline)) { if (missing(form)) { # r ~ f abline <- c(0, 0) } else { abline <- NULL } } #assign("id", id , where = 1) #assign("idLabels", idLabels, where = 1) #assign("abl", abline, where = 1) assign("abl", abline) ## defining the type of plot if (length(argForm) == 3) { if (is.numeric(.y)) { # xyplot plotFun <- "xyplot" if (is.null(args$panel)) { args <- c(args, panel = list(function(x, y, subscripts, ...) { x <- as.numeric(x) y <- as.numeric(y) dots <- list(...) if (grid) panel.grid() panel.xyplot(x, y, ...) if (any(ids <- id[subscripts])){ ltext(x[ids], y[ids], idLabels[subscripts][ids], cex = dots$cex, adj = dots$adj) } if (!is.null(abl)) { if (length(abl) == 2) panel.abline(a = abl, ...) else panel.abline(h = abl, ...) } })) } } else { # assume factor or character plotFun <- "bwplot" if (is.null(args$panel)) { args <- c(args, panel = list(function(x, y, ...) { if (grid) panel.grid() panel.bwplot(x, y, ...) if (!is.null(abl)) { panel.abline(v = abl[1], ...) } })) } } } else { plotFun <- "histogram" if (is.null(args$panel)) { args <- c(args, panel = list(function(x, ...) { if (grid) panel.grid() panel.histogram(x, ...) if (!is.null(abl)) { panel.abline(v = abl[1], ...) } })) } } ## needed in panel(): if (missing(grid)) grid <- (plotFun == "xyplot") ## T / F do.call(plotFun, as.list(args)) } #pruneLevels.factor <- function(object) object[drop = TRUE] ##*## Plot method for ACF objects plot.ACF <- function(x, alpha = 0, xlab = "Lag", ylab = "Autocorrelation", grid = FALSE, ...) { object <- x ylim <- range(object$ACF) if (alpha) { assign("stdv", qnorm(1-alpha/2)/sqrt(attr(object,"n.used"))) stMax <- max(stdv) ylim <- c(min(c(-stMax, ylim[1])), max(c(ylim[2], stMax))) } assign("alpha", as.logical(alpha)) assign("grid", grid) xyplot(ACF ~ lag, object, ylim = ylim, panel = function(x, y, ...) { x <- as.numeric(x) y <- as.numeric(y) if (grid) panel.grid() panel.xyplot(x, y, type = "h") panel.abline(0, 0) if (alpha) { llines(x, stdv, lty = 2) llines(x, -stdv, lty = 2) } }, xlab = xlab, ylab = ylab, ...) } plot.augPred <- function(x, key = TRUE, grid = FALSE, ...) { labels <- list(xlab = paste(attr(x, "labels")$x, attr(x, "units")$x), ylab = paste(attr(x, "labels")$y, attr(x, "units")$y)) labels <- labels[unlist(lapply(labels, function(el) length(el) > 0))] args <- c(list(attr(x, "formula"), groups = quote(.type), data = x, strip = function(...) strip.default(..., style = 1), panel = if (length(levels(x[[".type"]])) == 2) { ## single prediction level function(x, y, subscripts, groups, ...) { if (grid) panel.grid() orig <- groups[subscripts] == "original" panel.xyplot(x[orig], y[orig], ...) panel.xyplot(x[!orig], y[!orig], ..., type = "l") } } else { # multiple prediction levels function(x, y, subscripts, groups, ...) { if (grid) panel.grid() orig <- groups[subscripts] == "original" panel.xyplot(x[orig], y[orig], ...) panel.superpose(x[!orig], y[!orig], subscripts[!orig], groups, ..., type = "l") } }), labels) ## perhaps include key argument allowing logical values dots <- list(...) args[names(dots)] <- dots if (is.logical(key) && key) { levs <- levels(x[[".type"]]) if ((lLev <- length(levs)) > 2) { # more than one levels lLev <- lLev - 1 levs <- levs[1:lLev] aux <- !is.na(match(substring(levs, 1, 8), "predict.")) if (sum(aux) > 0) { levs[aux] <- substring(levs[aux], 9) } args[["key"]] <- list(lines = c(Rows(trellis.par.get("superpose.line"), 1:lLev), list(size = rep(3, lLev))), text = list(levels = levs), columns = min(6, lLev)) } } else { args[["key"]] <- key } assign("grid", grid) do.call("xyplot", args) } plot.compareFits <- function(x, subset, key = TRUE, mark = NULL, ...) { object <- x if(!missing(subset)) { object <- object[subset,,] } dims <- dim(object) dn <- dimnames(object) assign("mark", rep(mark, rep(dims[1] * dims[2], dims[3]))) tt <- data.frame(group = ordered(rep(dn[[1]], dims[2] * dims[3]), levels = dn[[1]]), coefs = as.vector(object), what = ordered(rep(dn[[3]], rep(dims[1] * dims[2], dims[3])), levels = dn[[3]]), grp = ordered(rep(rep(dn[[2]], rep(dims[1], dims[2])), dims[3]), levels = dn[[2]])) args <- list(group ~ coefs | what, data = tt, scales = list(x=list(relation="free")), strip = function(...) strip.default(..., style = 1), xlab = "", groups = tt$grp, panel = function(x, y, subscripts, groups, ...) { x <- as.numeric(x) y <- as.numeric(y) dot.line <- trellis.par.get("dot.line") panel.abline(h = y, lwd = dot.line$lwd, lty = dot.line$lty, col = dot.line$col) if(!is.null(mark)) { panel.abline(v = mark[subscripts][1], lty = 2) } panel.superpose(x, y, subscripts, groups) }) dots <- list(...) args[names(dots)] <- dots if(is.logical(key)) { if(key && length(unique(tt$grp)) > 1) { args[["key"]] <- list(points = Rows(trellis.par.get("superpose.symbol"), 1:2), text = list(levels = levels(tt$grp)), columns = 2) } } else { args[["key"]] <- key } do.call("dotplot", args) } plot.Variogram <- function(x, smooth, showModel, sigma = NULL, span = 0.6, xlab = "Distance", ylab = "Semivariogram", type = "p", ylim, grid = FALSE, ...) { object <- x trlLin <- trellis.par.get("superpose.line") ## coll <- attr(object, "collapse") modVrg <- attr(object, "modelVariog") lineT <- 1 if (!is.na(match(type, c("l","o","b")))) { lineT <- lineT + 1 } if (missing(showModel)) { showModel <- !is.null(modVrg) } if (showModel) { if (is.null(modVrg)) { stop("no model variogram available with 'showModel = TRUE'") } assign("ltyM", trlLin$lty[lineT]) assign("colM", trlLin$col[lineT]) assign("modVrg", modVrg) lineT <- lineT + 1 } if (missing(smooth)) { smooth <- !showModel } if (smooth) { assign("ltyS", trlLin$lty[lineT]) assign("colS", trlLin$col[lineT]) } assign("smooth", smooth) assign("showModel", showModel) assign("span", span) assign("type", type) assign("sigma", sigma) assign("grid", grid) if (missing(ylim)) { ylim <- c(0, max(object$variog)) } xyplot(variog ~ dist, object, ylim = ylim, panel = function(x, y, ...) { if (grid) panel.grid() panel.xyplot(x, y, type = type, ...) if (showModel) { panel.xyplot(modVrg$dist, modVrg$variog, type = "l", col = colM, lty = ltyM, ...) } if (smooth) { panel.loess(x, y, span = span, col = colS, lty = ltyS, ...) } if (!is.null(sigma)) { panel.abline(c(sigma, 0), lty = 2) } }, xlab = xlab, ylab = ylab, ...) } print.compareFits <- function(x, ...) { # Will need to be changed for S4! print(unclass(x), ...) invisible(x) } print.correlation <- ## Print only the lower triangle of a correlation matrix function(x, title = " Correlation:", rdig = 3, ...) { p <- dim(x)[2] if (p > 1) { cat(title, "\n") ll <- lower.tri(x) x[ll] <- format(round(x[ll], digits = rdig)) x[!ll] <- "" if (!is.null(colnames(x))) { colnames(x) <- abbreviate(colnames(x), minlength = rdig + 3) } print(x[-1, - p, drop = FALSE], ..., quote = FALSE) } invisible(x) } ##if(R.version$major <= 1 && R.version$minor < 3) ## not in R 1.3 and later ##--- needs Trellis/Lattice : qqnorm.nls <- function(y, form = ~ resid(., type = "p"), abline = NULL, id = NULL, idLabels = NULL, grid = FALSE, ...) ## normal probability plots for residuals { object <- y if (!inherits(form, "formula")) { stop("'form' must be a formula") } ## constructing data allV <- all.vars(asOneFormula(form, id, idLabels)) allV <- allV[is.na(match(allV,c("T","F","TRUE","FALSE")))] if (length(allV) > 0) { data <- getData(object) if (is.null(data)) { # try to construct data alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(as.list(quote(data.frame)), alist) mode(alist) <- "call" data <- eval(alist, sys.parent(1)) } else { if (any(naV <- is.na(match(allV, names(data))))) { stop(sprintf(ngettext(sum(naV), "%s not found in data", "%s not found in data"), allV[naV]), domain = NA) } } } else data <- NULL ## argument list dots <- list(...) if (length(dots) > 0) args <- dots else args <- list() ## appending object to data data <- as.list(c(as.list(data), . = list(object))) ## covariate - must always be present covF <- getCovariateFormula(form) .x <- eval(covF[[2]], data) labs <- attr(.x, "label") if (is.null(labs) || ((labs != "Standardized residuals") && (labs != "Normalized residuals") && (substring(labs, 1, 9) != "Residuals"))) { stop("only residuals allowed") } if (is.null(args$xlab)) args$xlab <- labs if (is.null(args$ylab)) args$ylab <- "Quantiles of standard normal" fData <- qqnorm(.x, plot.it = FALSE) data[[".y"]] <- fData$x data[[".x"]] <- fData$y dform <- ".y ~ .x" if (!is.null(grp <- getGroupsFormula(form))) { dform <- paste(dform, deparse(grp[[2]]), sep = "|") } if (!is.null(id)) { # identify points in plot id <- switch(mode(id), numeric = { if ((id <= 0) || (id >= 1)) { stop("'id' must be between 0 and 1") } if (labs == "Normalized residuals") { as.logical(abs(resid(object, type="normalized")) > -qnorm(id / 2)) } else { as.logical(abs(resid(object, type="pearson")) > -qnorm(id / 2)) } }, call = eval(asOneSidedFormula(id)[[2]], data), stop("'id' can only be a formula or numeric") ) if (is.null(idLabels)) { idLabels <- getGroups(object) if (length(idLabels) == 0) idLabels <- 1:object$dims$N idLabels <- as.character(idLabels) } else { if (mode(idLabels) == "call") { idLabels <- as.character(eval(asOneSidedFormula(idLabels)[[2]], data)) } else if (is.vector(idLabels)) { if (length(idLabels <- unlist(idLabels)) != length(id)) { stop("'idLabels' of incorrect length") } idLabels <- as.character(idLabels) } else { stop("'idLabels' can only be a formula or a vector") } } } # assign("id", if (is.null(id)) NULL else as.logical(as.character(id)), # frame = 1) assign("id", if (is.null(id)) NULL else as.logical(as.character(id))) assign("idLabels", as.character(idLabels)) assign("grid", grid) assign("abl", abline) if (is.null(args$strip)) { args$strip <- function(...) strip.default(..., style = 1) } if (is.null(args$cex)) args$cex <- par("cex") if (is.null(args$adj)) args$adj <- par("adj") args <- c(list(eval(parse(text = dform)), data = substitute(data)), args) if (is.null(args$panel)) { args <- c(list(panel = function(x, y, subscripts, ...){ x <- as.numeric(x) y <- as.numeric(y) dots <- list(...) if (grid) panel.grid() panel.xyplot(x, y, ...) if (any(ids <- id[subscripts])){ ltext(x[ids], y[ids], idLabels[subscripts][ids], cex = dots$cex, adj = dots$adj) } if (!is.null(abl)) { if (length(abl) == 2) panel.abline(a = abl, ...) else panel.abline(h = abl, ...) } }), args) } do.call("xyplot", args) } Variogram.default <- function(object, distance, ...) { ld <- length(distance) lo <- length(object) if (ld != round(lo*(lo-1)/2)) { stop("'distance' and 'object' have incompatible lengths") } val <- outer(object, object, function(x,y) ((x - y)^2)/2) val <- val[lower.tri(val)] val <- data.frame(variog = val, dist = as.numeric(distance)) class(val) <- c("Variogram", "data.frame") val } ## local function for complete deparsing c_deparse <- function(...) paste(deparse(..., width.cutoff=500), collapse="") nlme/R/lme.R0000644000176200001440000031223013517067553012323 0ustar liggesusers### Fit a general linear mixed effects model ### ### Copyright 2005-2019 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of the GNU General Public License as published by ### the Free Software Foundation; either version 2 of the License, or ### (at your option) any later version. ### ### This program is distributed in the hope that it will be useful, ### but WITHOUT ANY WARRANTY; without even the implied warranty of ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ### GNU General Public License for more details. ### ### A copy of the GNU General Public License is available at ### http://www.r-project.org/Licenses/ lme <- ## fits general linear mixed effects model by maximum likelihood, or ## residual maximum likelihood using Newton-Raphson algorithm. function(fixed, data = sys.frame(sys.parent()), random, correlation = NULL, weights = NULL, subset, method = c("REML", "ML"), na.action = na.fail, control = list(), contrasts = NULL, keep.data = TRUE) UseMethod("lme") lme.groupedData <- function(fixed, data = sys.frame(sys.parent()), random, correlation = NULL, weights = NULL, subset, method = c("REML", "ML"), na.action = na.fail, control = list(), contrasts = NULL, keep.data = TRUE) { args <- as.list(match.call())[-1L] names(args)[1L] <- "data" form <- getResponseFormula(fixed) form[[3]] <- getCovariateFormula(fixed)[[2L]] do.call(lme, c(list(fixed = form), args)) } lme.lmList <- function(fixed, data = sys.frame(sys.parent()), random, correlation = NULL, weights = NULL, subset, method = c("REML", "ML"), na.action = na.fail, control = list(), contrasts = NULL, keep.data = TRUE) { if (length(grpForm <- getGroupsFormula(fixed, asList = TRUE)) > 1) { stop("can only fit \"lmList\" objects with single grouping variable") } this.call <- as.list(match.call())[-1L] ## warn "data" is passed to this function if (!is.na(match("data", names(this.call)))) { warning("'lme.lmList' will redefine 'data'") } ## add object, data, and groups from the call that created object last.call <- as.list(attr(fixed, "call"))[-1L] whichLast <- match(c("object", "data", "na.action"), names(last.call)) whichLast <- whichLast[!is.na(whichLast)] last.call <- last.call[whichLast] names(last.call)[match(names(last.call), "object")] <- "fixed" this.call[names(last.call)] <- last.call this.call$fixed <- eval(substitute(L ~ R, list(L = getResponseFormula (fixed)[[2L]], R = getCovariateFormula(fixed)[[2L]]))) if (missing(random)) { random <- eval(as.call(this.call[["fixed"]][-2])) } random <- reStruct(random, data = NULL) mData <- this.call[["data"]] if (is.null(mData)) { # will try to construct allV <- all.vars(formula(random)) if (length(allV) > 0) { alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(as.list(quote(data.frame)), alist) mode(alist) <- "call" mData <- eval(alist, sys.parent(1)) } } else { if (mode(mData) == "name" || mode(mData) == "call") { mData <- eval(mData) } } reSt <- reStruct(random, data = mData) # getting random effects names names(reSt) <- names(grpForm) if (length(reSt) > 1) { stop("can only fit \"lmList\" objects with single grouping variable") } rNames <- Names(reSt[[1L]]) if (all(match(rNames, names(cf <- na.omit(coef(fixed))), 0))) { if (isInitialized(reSt)) { warning("initial value for \"reStruct\" overwritten in 'lme.lmList'") } madRes <- mad(resid(fixed), na.rm = TRUE) madRan <- unlist(lapply(cf, mad, na.rm = TRUE)[rNames]) names(madRan) <- rNames matrix(reSt) <- diag((madRan/madRes)^2, ncol = length(rNames)) } this.call[["random"]] <- reSt val <- do.call(lme.formula, this.call) val$origCall <- match.call() val } lme.formula <- function(fixed, data = sys.frame(sys.parent()), random = pdSymm( eval( as.call(fixed[-2]) ) ), correlation = NULL, weights = NULL, subset, method = c("REML", "ML"), na.action = na.fail, control = list(), contrasts = NULL, keep.data = TRUE) { Call <- match.call() miss.data <- missing(data) || !is.data.frame(data) ## control parameters controlvals <- lmeControl() if (!missing(control)) { controlvals[names(control)] <- control } fixedSigma <- controlvals$sigma > 0 ## if(fixedSigma && controlvals$apVar) { ## if("apVar" %in% names(control)) ## warning("for 'sigma' fixed, 'apVar' is set FALSE, as the cov approxmation is not yet available.") ## controlvals$apVar <- FALSE ## } ## ## checking arguments ## if (!inherits(fixed, "formula") || length(fixed) != 3) { stop("\nfixed-effects model must be a formula of the form \"resp ~ pred\"") } method <- match.arg(method) REML <- method == "REML" reSt <- reStruct(random, REML = REML, data = NULL) groups <- getGroupsFormula(reSt) if (is.null(groups)) { if (inherits(data, "groupedData")) { groups <- getGroupsFormula(data) namGrp <- rev(names(getGroupsFormula(data, asList = TRUE))) Q <- length(namGrp) if (length(reSt) != Q) { # may need to repeat reSt if (length(reSt) != 1) { stop("incompatible lengths for 'random' and grouping factors") } randL <- vector("list", Q) names(randL) <- rev(namGrp) for(i in 1:Q) randL[[i]] <- random reSt <- reStruct(as.list(randL), REML = REML, data = NULL) } else { names(reSt) <- namGrp } } else { ## will assume single group groups <- ~ 1 names(reSt) <- "1" } } ## check if corStruct is present and assign groups to its formula, ## if necessary if (!is.null(correlation)) { add.form <- FALSE if(!is.null(corGrpsForm <- getGroupsFormula(correlation, asList = TRUE))) { corGrpsForm <- unlist(lapply(corGrpsForm, function(el) deparse(el[[2L]]))) lmeGrpsForm <- unlist(lapply(splitFormula(groups), function(el) deparse(el[[2L]]))) corQ <- length(corGrpsForm) lmeQ <- length(lmeGrpsForm) if (corQ <= lmeQ) { if (any(corGrpsForm != lmeGrpsForm[1:corQ])) { stop("incompatible formulas for groups in 'random' and 'correlation'") } if (corQ < lmeQ) { warning("cannot use smaller level of grouping for 'correlation' than for 'random'. Replacing the former with the latter.") add.form <- TRUE } } else if (any(lmeGrpsForm != corGrpsForm[1:lmeQ])) { stop("incompatible formulas for groups in 'random' and 'correlation'") } } else { add.form <- TRUE corQ <- lmeQ <- 1 } if(add.form) ## using the same grouping as in random attr(correlation, "formula") <- eval(substitute(~ COV | GRP, list(COV = getCovariateFormula(formula(correlation))[[2L]], GRP = groups[[2L]]))) } else { corQ <- lmeQ <- 1 } ## create an lme structure containing the random effects model and plug-ins lmeSt <- lmeStruct(reStruct = reSt, corStruct = correlation, varStruct = varFunc(weights)) ## extract a data frame with enough information to evaluate ## fixed, groups, reStruct, corStruct, and varStruct mfArgs <- list(formula = asOneFormula(formula(lmeSt), fixed, groups), data = data, na.action = na.action) if (!missing(subset)) { mfArgs[["subset"]] <- asOneSidedFormula(Call[["subset"]])[[2L]] } mfArgs$drop.unused.levels <- TRUE dataMix <- do.call(model.frame, mfArgs) origOrder <- row.names(dataMix) # preserve the original order for(i in names(contrasts)) # handle contrasts statement contrasts(dataMix[[i]]) <- contrasts[[i]] ## sort the model.frame by groups and get the matrices and parameters ## used in the estimation procedures grps <- getGroups(dataMix, groups) ## ordering data by groups if (inherits(grps, "factor")) { # single level ord <- order(grps) #"order" treats a single named argument peculiarly grps <- data.frame(grps) row.names(grps) <- origOrder names(grps) <- as.character(deparse((groups[[2L]]))) } else { ord <- do.call(order, grps) ## making group levels unique for(i in 2:ncol(grps)) { grps[, i] <- as.factor(paste(as.character(grps[, i-1]), as.character(grps[, i ]), sep = "/")) } } if (corQ > lmeQ) { ## may have to reorder by the correlation groups ord <- do.call(order, getGroups(dataMix, getGroupsFormula(correlation))) } grps <- grps[ord, , drop = FALSE] dataMix <- dataMix[ord, ,drop = FALSE] revOrder <- match(origOrder, row.names(dataMix)) # putting in orig. order ## obtaining basic model matrices N <- nrow(grps) Z <- model.matrix(reSt, dataMix) ncols <- attr(Z, "ncols") Names(lmeSt$reStruct) <- attr(Z, "nams") ## keeping the contrasts for later use in predict contr <- attr(Z, "contr") X <- model.frame(fixed, dataMix) Terms <- attr(X, "terms") auxContr <- lapply(X, function(el) if (inherits(el, "factor") && length(levels(el)) > 1) contrasts(el)) contr <- c(contr, auxContr[is.na(match(names(auxContr), names(contr)))]) contr <- contr[!unlist(lapply(contr, is.null))] X <- model.matrix(fixed, data=X) y <- eval(fixed[[2L]], dataMix) ncols <- c(ncols, dim(X)[2L], 1) Q <- ncol(grps) ## creating the condensed linear model dims <- MEdims(grps, ncols) attr(lmeSt, "conLin") <- list(Xy = array(c(Z, X, y), c(N, sum(ncols)), list(row.names(dataMix), c(colnames(Z), colnames(X), deparse(fixed[[2L]])))), dims = dims, logLik = 0, ## 17-11-2015; Fixed sigma: sigma = controlvals$sigma, auxSigma = 0) ## checking if enough observations per group to estimate ranef if(max(dims$ZXlen[[1L]]) < dims$qvec[1L] && !isTRUE(allow <- controlvals$allow.n.lt.q)) { msg <- gettextf("fewer observations than random effects in all level %s groups", Q) if(isFALSE(allow)) stop (msg, domain = NA) else # typically NA, was hardwired default in nlme <= 3.1-137 [2018] warning(msg, domain = NA) } ## degrees of freedom for testing fixed effects fixDF <- getFixDF(X, grps, dims$ngrps, terms = Terms) ## initialization lmeSt <- Initialize(lmeSt, dataMix, grps, control = controlvals) parMap <- attr(lmeSt, "pmap") ## Checking possibility of single decomposition if (length(lmeSt) == 1) { # reStruct only, can do one decomposition ## need to save conLin for calculating fitted values and residuals oldConLin <- attr(lmeSt, "conLin") decomp <- TRUE attr(lmeSt, "conLin") <- MEdecomp(attr(lmeSt, "conLin")) } else decomp <- FALSE ## Setup for optimization iterations if(controlvals$opt == "nlminb") { control <- list(iter.max = controlvals$msMaxIter, eval.max = controlvals$msMaxEval, trace = controlvals$msVerbose) keep <- c("abs.tol", "rel.tol", "x.tol", "xf.tol", "step.min", "step.max", "sing.tol", "scale.init", "diff.g") } else { ## "optim" control <- list(maxit = controlvals$msMaxIter, reltol = controlvals$msTol,# if(numIter == 0) controlvals$msTol else reltol trace = controlvals$msVerbose) keep <- c("fnscale", "parscale", "ndeps", "abstol", "alpha", "beta", "gamma", "REPORT", "type", "lmm", "factr", "pgtol", "temp", "tmax") } control <- c(control, controlvals[names(controlvals) %in% keep]) ## ## getting the linear mixed effects fit object, ## possibly iterating for variance functions ## numIter <- 0L repeat { oldPars <- coef(lmeSt) optRes <- if (controlvals$opt == "nlminb") { nlminb(c(oldPars), function(lmePars) -logLik(lmeSt, lmePars), control = control) } else { ## "optim" if(numIter == 1L) { # (yes, strange, but back-compatible ..) : reltol <- controlvals$reltol if(is.null(reltol)) reltol <- 100*.Machine$double.eps control$reltol <- reltol } optim(c(oldPars), function(lmePars) -logLik(lmeSt, lmePars), control = control, method = controlvals$optimMethod) } coef(lmeSt) <- optRes$par attr(lmeSt, "lmeFit") <- MEestimate(lmeSt, grps) ## checking if any updating is needed if (!needUpdate(lmeSt)) { if (optRes$convergence) { msg <- gettextf("%s problem, convergence error code = %s\n message = %s", controlvals$opt, optRes$convergence, paste(optRes$message, collapse = "")) if(!controlvals$returnObject) stop(msg, domain = NA) else warning(msg, domain = NA) } break } ## updating the fit information numIter <- numIter + 1L lmeSt <- update(lmeSt, dataMix) ## calculating the convergence criterion aConv <- coef(lmeSt) conv <- abs((oldPars - aConv)/ifelse(aConv == 0, 1, aConv)) aConv <- NULL for(i in names(lmeSt)) { if (any(parMap[,i])) { aConv <- c(aConv, max(conv[parMap[,i]])) names(aConv)[length(aConv)] <- i } } if (max(aConv) <= controlvals$tolerance) { break } if (numIter > controlvals$maxIter) { msg <- gettext("maximum number of iterations (lmeControl(maxIter)) reached without convergence") if (controlvals$returnObject) { warning(msg, domain = NA) break } else stop(msg, domain = NA) } } ## end{repeat} ## wrapping up lmeFit <- attr(lmeSt, "lmeFit") names(lmeFit$beta) <- namBeta <- colnames(X) attr(fixDF, "varFixFact") <- varFix <- lmeFit$sigma * lmeFit$varFix varFix <- crossprod(varFix) dimnames(varFix) <- list(namBeta, namBeta) ## ## fitted.values and residuals (in original order) ## Fitted <- fitted(lmeSt, level = 0:Q, conLin = if (decomp) oldConLin else attr(lmeSt, "conLin"))[ revOrder, , drop = FALSE] Resid <- y[revOrder] - Fitted rownames(Resid) <- rownames(Fitted) <- origOrder attr(Resid, "std") <- lmeFit$sigma/(varWeights(lmeSt)[revOrder]) ## putting groups back in original order grps <- grps[revOrder, , drop = FALSE] ## making random effects estimates consistently ordered ## for(i in names(lmeSt$reStruct)) { ## lmeFit$b[[i]] <- lmeFit$b[[i]][unique(as.character(grps[, i])),, drop = F] ## NULL ## } ## inverting back reStruct lmeSt$reStruct <- solve(lmeSt$reStruct) ## saving part of dims dims <- attr(lmeSt, "conLin")$dims[c("N", "Q", "qvec", "ngrps", "ncol")] ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions attr(lmeSt, "fixedSigma") <- fixedSigma ## getting the approximate var-cov of the parameters apVar <- if (controlvals$apVar) { lmeApVar(lmeSt, lmeFit$sigma, .relStep = controlvals[[".relStep"]], minAbsPar = controlvals[["minAbsParApVar"]], natural = controlvals[["natural"]]) } else { "Approximate variance-covariance matrix not available" } ## getting rid of condensed linear model and fit attr(lmeSt, "conLin") <- NULL attr(lmeSt, "lmeFit") <- NULL grpDta <- inherits(data, "groupedData") ## ## creating the lme object ## structure(class = "lme", list(modelStruct = lmeSt, dims = dims, contrasts = contr, coefficients = list( fixed = lmeFit$beta, random = lmeFit$b), varFix = varFix, sigma = lmeFit$sigma, apVar = apVar, logLik = lmeFit$logLik, numIter = if (needUpdate(lmeSt)) numIter, # else NULL groups = grps, call = Call, terms = Terms, method = method, fitted = Fitted, residuals = Resid, fixDF = fixDF, na.action = attr(dataMix, "na.action"), data = if (keep.data && !miss.data) data), ## saving labels and units for plots units = if(grpDta) attr(data, "units"), labels= if(grpDta) attr(data, "labels")) } ### Auxiliary functions used internally in lme and its methods getFixDF <- function(X, grps, ngrps, assign = attr(X, "assign"), terms) { ## calculates degrees of freedom for fixed effects Wald tests if (!is.list(assign)) { # in R namTerms <- attr(terms, "term.labels") if (attr(terms, "intercept") > 0) { namTerms <- c("(Intercept)", namTerms) } namTerms <- factor(assign, labels = namTerms) assign <- split(order(assign), namTerms) } ## function to check if a vector is (nearly) a multiple of (1,1,...,1) const <- function(x, tolerance = sqrt(.Machine$double.eps)) { if (length(x) < 1) return(NA) x <- as.numeric(x) ## return all(abs(if(x[1L] == 0) x else x/x[1L] - 1) < tolerance) } N <- nrow(X) p <- ncol(X) Q <- ncol(grps) Qp1 <- Q + 1L namX <- colnames(X) ngrps <- rev(ngrps)[-(1:2)] stratNam <- c(names(ngrps), "Residual") dfX <- dfTerms <- setNames(c(ngrps, N) - c(0, ngrps), stratNam) valX <- setNames(double(p), namX) namTerms <- names(assign) valTerms <- double(length(assign)) names(valTerms) <- namTerms if (any(notIntX <- !apply(X, 2, const))) { ## percentage of groups for which columns of X are inner innP <- array(c(rep(1, p), .C(inner_perc_table, as.double(X), as.integer(unlist(grps)), as.integer(p), as.integer(Q), as.integer(N), val = double(p * Q))[["val"]]), dim = c(p, Qp1), dimnames = list(namX, stratNam)) ## strata in which columns of X are estimated ## ignoring fractional inner percentages for now stratX <- stratNam[apply(innP, 1, function(el, index) max(index[el > 0]), index = 1:Qp1)] ## strata in which terms are estimated notIntTerms <- unlist(lapply(assign, function(el, notIntX) { any(notIntX[el]) }, notIntX = notIntX)) stratTerms <- stratNam[unlist(lapply(assign, function(el) max(match(stratX[el], stratNam)) ))][notIntTerms] stratX <- stratX[notIntX] xDF <- table(stratX) dfX[names(xDF)] <- dfX[names(xDF)] - xDF if (!all(notIntX)) { # correcting df for intercept dfX[1L] <- dfX[1L] - 1L } else { dfX[-1L] <- dfX[-1L] + 1L } valX[notIntX] <- dfX[stratX] ## number of parameters in each term pTerms <- lengths(assign)[notIntTerms] tDF <- tapply(pTerms, stratTerms, sum) dfTerms[names(tDF)] <- dfTerms[names(tDF)] - tDF if (!all(notIntTerms)) { dfTerms[1L] <- dfTerms[1L] - 1L } else { dfTerms[-1L] <- dfTerms[-1L] + 1L } valTerms[notIntTerms] <- dfTerms[stratTerms] } else { notIntTerms <- vapply(assign, function(el) any(notIntX[el]), NA) } if (!all(notIntX)) { #intercept included valX[!notIntX] <- max(dfX) if (!all(notIntTerms)) valTerms[!notIntTerms] <- max(dfTerms) } structure(list(X = valX, terms = valTerms), assign = assign) } lmeApVar.fullLmeLogLik <- function(Pars, object, conLin, dims, N, settings) { ## logLik as a function of sigma and coef(lmeSt) fixedSigma <- attr(object, "fixedSigma") npar <- length(Pars) if (!fixedSigma) { sigma <- exp(Pars[npar]) # within-group std. dev. Pars <- Pars[-npar] lsigma <- 0 } else { sigma <- lsigma <- conLin$sigma } coef(object) <- Pars if ((lO <- length(object)) > 1) { for(i in lO:2) conLin <- recalc(object[[i]], conLin) } val <- .C(mixed_loglik, as.double(conLin$Xy), as.integer(unlist(dims)), as.double(sigma * unlist(pdFactor(solve(object$reStruct)))), as.integer(settings), logLik = double(1L), lRSS = double(1L), sigma=as.double(lsigma))[c("logLik", "lRSS")] aux <- (exp(val[["lRSS"]])/sigma)^2 conLin[["logLik"]] + val[["logLik"]] + (N * log(aux) - aux)/2 } lmeApVar <- function(lmeSt, sigma, conLin = attr(lmeSt, "conLin"), .relStep = .Machine$double.eps^(1/3), minAbsPar = 0, natural = TRUE) { fixedSigma <- attr(lmeSt,"fixedSigma") ## calculate approximate variance-covariance matrix of all parameters ## except the fixed effects. By default, uses natural parametrization for ## for pdSymm matrices dims <- conLin$dims sett <- attr(lmeSt, "settings") N <- dims$N - sett[1L] * dims$ncol[dims$Q + 1L] sett[2:3] <- c(1, 0) # asDelta = TRUE and no grad/Hess conLin[["logLik"]] <- 0 # making sure sig2 <- sigma * sigma reSt <- lmeSt[["reStruct"]] for(i in seq_along(reSt)) { matrix(reSt[[i]]) <- as.double(sig2) * pdMatrix(reSt[[i]]) if (inherits(reSt[[i]], "pdSymm") && natural) { reSt[[i]] <- pdNatural(reSt[[i]]) } if (inherits(reSt[[i]], "pdBlocked") && natural) { for(j in seq_along(reSt[[i]])) { if (inherits(reSt[[i]][[j]], "pdSymm")) { reSt[[i]][[j]] <- pdNatural(reSt[[i]][[j]]) } } } } lmeSt[["reStruct"]] <- reSt cSt <- lmeSt[["corStruct"]] if (!is.null(cSt) && inherits(cSt, "corSymm") && natural) { cStNatPar <- coef(cSt, unconstrained = FALSE) class(cSt) <- c("corNatural", "corStruct") coef(cSt) <- log((cStNatPar + 1)/(1 - cStNatPar)) lmeSt[["corStruct"]] <- cSt } Pars <- if(fixedSigma) coef(lmeSt) else c(coef(lmeSt), lSigma = log(sigma)) val <- fdHess(Pars, lmeApVar.fullLmeLogLik, lmeSt, conLin, dims, N, sett, .relStep = .relStep, minAbsPar = minAbsPar)[["Hessian"]] if (all(eigen(val, only.values=TRUE)$values < 0)) { ## negative definite - OK val <- solve(-val) nP <- names(Pars) dimnames(val) <- list(nP, nP) attr(val, "Pars") <- Pars attr(val, "natural") <- natural val } else { ## problem - solution is not a maximum "Non-positive definite approximate variance-covariance" } } MEdecomp <- function(conLin) ## decompose a condensed linear model. Returns another condensed ## linear model { dims <- conLin$dims if (dims[["StrRows"]] >= dims[["ZXrows"]]) { ## no point in doing the decomposition return(conLin) } dc <- array(.C(mixed_decomp, as.double(conLin$Xy), as.integer(unlist(dims)))[[1L]], c(dims$StrRows, dims$ZXcols)) dims$ZXrows <- dims$StrRows dims$ZXoff <- dims$DecOff dims$ZXlen <- dims$DecLen conLin[c("Xy", "dims")] <- list(Xy = dc, dims = dims) conLin } MEEM <- function(object, conLin, niter = 0) ## perform niter iterations of the EM algorithm for conLin ## assumes that object is in precision form { if (niter > 0) { dd <- conLin$dims pdCl <- attr(object, "settings")[-(1:3)] pdCl[pdCl == -1] <- 0 precvec <- unlist(pdFactor(object)) zz <- .C(mixed_EM, as.double(conLin$Xy), as.integer(unlist(dd)), precvec = as.double(precvec), as.integer(niter), as.integer(pdCl), as.integer(attr(object, "settings")[1L]), double(1), double(length(precvec)), double(1), as.double(conLin$sigma))[["precvec"]] Prec <- vector("list", length(object)) names(Prec) <- names(object) for (i in seq_along(object)) { len <- dd$qvec[i]^2 matrix(object[[i]]) <- crossprod(matrix(zz[1:len + dd$DmOff[i]], ncol = dd$qvec[i])) } } object } MEestimate <- function(object, groups, conLin = attr(object, "conLin")) { dd <- conLin$dims nc <- dd$ncol REML <- attr(object$reStruct, "settings")[1L] Q <- dd$Q rConLin <- recalc(object, conLin) zz <- .C(mixed_estimate, as.double(rConLin$Xy), as.integer(unlist(dd)), as.double(unlist(pdFactor(object$reStruct))), as.integer(REML), double(1), estimates = double(dd$StrRows * dd$ZXcols), as.logical(FALSE), ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions sigma = as.double(conLin$sigma))[["estimates"]] estimates <- array(zz, c(dd$StrRows, dd$ZXcols)) resp <- estimates[ , dd$ZXcols] reSt <- object$reStruct nam <- names(reSt) val <- vector(mode = "list", length = Q) start <- dd$StrRows * c(0, cumsum(nc)) for (i in seq_along(reSt)) { val[[i]] <- matrix(resp[as.vector(outer(1:(nc[i]), dd$SToff[[i]] - start[i], "+"))], ncol = nc[i], byrow = TRUE, dimnames = list(unique(as.character(groups[, nam[i]])), Names(reSt[[i]]))) } names(val) <- nam p <- nc[[Q + 1L]] N <- dd$N - REML * p dimE <- dim(estimates) ## 17-11-2015; Fixed sigma patch; ... modified by MM notably for p == 0: Np <- N auxSigma <- abs(resp[dimE[1]])/sqrt(Np) if(conLin$sigma > 0) { loglik <- (N * (-log(2 * pi)-2*log(conLin$sigma)))/2 + rConLin$logLik sigma <- conLin$sigma } else { loglik <- (N * (log(N) - (1 + log(2 * pi))))/2 + rConLin$logLik sigma <- auxSigma } list(logLik = loglik, b = rev(val), beta = if(p) resp[dimE[1] - (p:1)] else double(), sigma = sigma, auxSigma = auxSigma, varFix = if(p) t(solve(estimates[dimE[1] - (p:1), dimE[2] - (p:1), drop = FALSE])) else matrix(,p,p)) } MEdims <- function(groups, ncols) { ## define constants used in matrix decompositions and log-lik calculations ## first need some local functions glengths <- ## returns the group lengths from a vector of last rows in the group function(lstrow) diff(c(0, lstrow)) offsets <- ## converts total number of columns(N), columns per level(ncols), and ## a list of group lengths to offsets in C arrays function(N, ncols, lstrow, triangle = FALSE) { pop <- function(x) x[-length(x)] cstart <- c(0, cumsum(N * ncols)) for (i in seq_along(lstrow)) { lstrow[[i]] <- cstart[i] + if (triangle) { lstrow[[i]] - ncols[i] # storage offsets style } else { pop(c(0, lstrow[[i]])) # decomposition style } } lstrow } Q <- ncol(groups) # number of levels N <- nrow(groups) # number of observations ## 'isLast' indicates if the row is the last row in the group at that level. ## this version propagates changes from outer groups to inner groups ## isLast <- (array(unlist(lapply(c(rev(as.list(groups)), ## list(X = rep(0, N), y = rep(0, N))), ## function(x) c(0 != diff(codes(x)), TRUE))), ## c(N, Q+2), list(NULL, c(rev(names(groups)), "X", "y"))) ## %*% (row(diag(Q+2)) >= col(diag(Q+2)))) != 0 ## this version does not propagate changes from outer to inner. isLast <- array(FALSE, dim(groups) + c(0, 2), list(NULL, c(rev(names(groups)), "X", "y"))) for(i in 1:Q) { isLast[, Q + 1L - i] <- c(0 != diff(as.integer(groups[[i]])), TRUE) } isLast[N, ] <- TRUE lastRow <- apply(isLast, 2, function(x) seq_along(x)[x]) if(!is.list(lastRow)) { nm <- names(lastRow) lastRow <- as.list(lastRow) names(lastRow) <- nm } isLast <- t(isLast) strSizes <- cumsum(ncols * isLast) * isLast # required storage sizes lastStr <- apply(t(strSizes), 2, function(x) x[x != 0]) if(!is.list(lastStr)) { nm <- names(lastStr) lastStr <- as.list(lastStr) names(lastStr) <- nm } strRows <- max(lastStr[[length(lastStr)]]) lastBlock <- vector("list", Q) names(lastBlock) <- rownames(strSizes)[1:Q] for(i in 1:Q) lastBlock[[i]] <- c(strSizes[i, -N], strRows) maxStr <- do.call(pmax, lastBlock) for(i in 1:Q) lastBlock[[i]] <- maxStr[as.logical(lastBlock[[i]])] lastBlock <- c(lastBlock, list(X = strRows, y = strRows)) list(N = N, # total number of rows in data ZXrows = N, # no. of rows in array ZXcols = sum(ncols), # no. of columns in array Q = Q, # no. of levels of random effects StrRows = strRows, # no. of rows required for storage qvec = ncols * c(rep(1, Q), 0, 0), # lengths of random effects # no. of groups at each level ### This looks wrong: ")" at wrong place: unlist(*, N, N) !! ngrps = c(unlist(lapply(lastRow, length), N, N)), ###?ok ngrps = c(lengths(lastRow), N, N),# no. of groups at each level DmOff = c(0, cumsum(ncols^2))[1:(Q+2)],# offsets into DmHalf array by level ncol = ncols, # no. of columns decomposed per level nrot = rev(c(0, cumsum(rev(ncols))))[-1L],# no. of columns rotated per level ZXoff = offsets(N, ncols, lastRow), # offsets into ZXy ZXlen = lapply(lastRow, glengths), # lengths of ZXy groups # storage array offsets SToff = offsets(strRows, ncols, lastStr, triangle = TRUE), # decomposition offsets DecOff = offsets(strRows, ncols, lastBlock), # decomposition lengths DecLen = lapply(lastBlock, glengths) ) } ### Methods for standard generics ACF.lme <- function(object, maxLag, resType = c("pearson", "response", "normalized"), ...) { resType <- match.arg(resType) res <- resid(object, type = resType, asList = TRUE) if(missing(maxLag)) { maxLag <- min(c(maxL <- max(lengths(res)) - 1, as.integer(10 * log10(maxL + 1)))) } val <- lapply(res, function(el, maxLag) { N <- maxLag + 1L tt <- double(N) nn <- integer(N) N <- min(c(N, n <- length(el))) nn[1:N] <- n + 1L - 1:N ## el <- el - mean(el) for(i in 1:N) { tt[i] <- sum(el[1:(n-i+1)] * el[i:n]) } array(c(tt,nn), c(length(tt), 2)) }, maxLag = maxLag) val0 <- rowSums(sapply(val, function(x) x[,2])) val1 <- rowSums(sapply(val, function(x) x[,1]))/val0 val2 <- val1/val1[1L] z <- data.frame(lag = 0:maxLag, ACF = val2) attr(z, "n.used") <- val0 class(z) <- c("ACF", "data.frame") z } anova.lme <- function(object, ..., test = TRUE, type = c("sequential", "marginal"), adjustSigma = TRUE, Terms, L, verbose = FALSE) { fixSig <- attr(object$modelStruct, "fixedSigma") fixSig <- !is.null(fixSig) && fixSig ## returns the likelihood ratio statistics, the AIC, and the BIC Lmiss <- missing(L) dots <- list(...) if ((rt <- length(dots) + 1L) == 1L) { ## just one object if (!inherits(object,"lme")) { stop("object must inherit from class \"lme\" ") } vFix <- attr(object$fixDF, "varFixFact") if (adjustSigma && object$method == "ML") ## using REML-like estimate of sigma under ML vFix <- sqrt(object$dims$N/(object$dims$N - ncol(vFix))) * vFix c0 <- solve(t(vFix), fixef(object)) assign <- attr(object$fixDF, "assign") nTerms <- length(assign) if (missing(Terms) && Lmiss) { ## returns the F.table (Wald) for the fixed effects type <- match.arg(type) Fval <- Pval <- double(nTerms) nDF <- integer(nTerms) dDF <- object$fixDF$terms for(i in 1:nTerms) { nDF[i] <- length(assign[[i]]) if (type == "sequential") { # type I SS c0i <- c0[assign[[i]]] } else { c0i <- c(qr.qty(qr(vFix[, assign[[i]], drop = FALSE]), c0))[1:nDF[i]] } Fval[i] <- sum(c0i^2)/nDF[i] Pval[i] <- 1 - pf(Fval[i], nDF[i], dDF[i]) } ## ## fixed effects F-values, df, and p-values ## aod <- data.frame(numDF= nDF, denDF= dDF, "F-value"= Fval, "p-value"= Pval, check.names = FALSE) rownames(aod) <- names(assign) attr(aod,"rt") <- rt } else { nX <- length(unlist(assign)) if (Lmiss) { # terms is given if (is.numeric(Terms) && all(Terms == as.integer(Terms))) { if (min(Terms) < 1 || max(Terms) > nTerms) { stop(gettextf("'Terms' must be between 1 and %d", nTerms), domain = NA) } } else { if (is.character(Terms)) { if (any(noMatch <- is.na(match(Terms, names(assign))))) { stop(sprintf(ngettext(sum(noMatch), "term %s not matched", "terms %s not matched"), paste(Terms[noMatch], collapse = ", ")), domain = NA) } } else { stop("terms can only be integers or characters") } } dDF <- unique(object$fixDF$terms[Terms]) if (length(dDF) > 1) { stop("terms must all have the same denominator DF") } lab <- paste("F-test for:",paste(names(assign[Terms]),collapse=", "),"\n") L <- diag(nX)[unlist(assign[Terms]),,drop=FALSE] } else { L <- as.matrix(L) if (ncol(L) == 1) L <- t(L) # single linear combination nrowL <- nrow(L) ncolL <- ncol(L) if (ncol(L) > nX) { stop(sprintf(ngettext(nX, "'L' must have at most %d column", "'L' must have at most %d columns"), nX), domain = NA) } dmsL1 <- rownames(L) L0 <- array(0, c(nrowL, nX), list(NULL, names(object$fixDF$X))) if (is.null(dmsL2 <- colnames(L))) { ## assume same order as effects L0[, 1:ncolL] <- L } else { if (any(noMatch <- is.na(match(dmsL2, colnames(L0))))) { stop(sprintf(ngettext(sum(noMatch), "effect %s not matched", "effects %s not matched"), paste(dmsL2[noMatch],collapse=", ")), domain = NA) } L0[, dmsL2] <- L } L <- L0[noZeroRowL <- as.logical((L0 != 0) %*% rep(1, nX)), , drop = FALSE] nrowL <- nrow(L) rownames(L) <- if(is.null(dmsL1)) 1:nrowL else dmsL1[noZeroRowL] dDF <- unique(object$fixDF$X[noZeroColL <- as.logical(c(rep(1,nrowL) %*% (L != 0)))]) if (length(dDF) > 1) { stop("L may only involve fixed effects with the same denominator DF") } lab <- "F-test for linear combination(s)\n" } nDF <- sum(svd.d(L) > 0) c0 <- c(qr.qty(qr(vFix %*% t(L)), c0))[1:nDF] Fval <- sum(c0^2)/nDF Pval <- pf(Fval, nDF, dDF, lower.tail=FALSE) aod <- data.frame(numDF = nDF, denDF = dDF, "F-value" = Fval, "p-value" = Pval, check.names=FALSE) attr(aod, "rt") <- rt attr(aod, "label") <- lab if (!Lmiss) { attr(aod, "L") <- if(nrow(L) > 1) L[, noZeroColL, drop = FALSE] else L[, noZeroColL] } } } ## ## Otherwise construct the likelihood ratio and information table ## objects in ... may inherit from gls, gnls, lm, lmList, lme, ## nlme, nlsList, and nls ## else { ancall <- sys.call() # yuck.. hack ancall$verbose <- ancall$test <- ancall$type <- NULL object <- list(object, ...) termsClass <- vapply(object, data.class, "") valid.cl <- c("gls", "gnls", "lm", "lmList", "lme","nlme","nlsList","nls") if(!all(match(termsClass, valid.cl, 0))) { valid.cl <- paste0('"', valid.cl, '"') stop(gettextf("objects must inherit from classes %s, or %s", paste(head(valid.cl, -1), collapse=", "), tail(valid.cl, 1)), domain=NA) } resp <- vapply(object, function(el) deparse(getResponseFormula(el)[[2L]]), "") ## checking if responses are the same subs <- as.logical(match(resp, resp[1L], FALSE)) if (!all(subs)) warning("some fitted objects deleted because response differs from the first model") if (sum(subs) == 1) stop("first model has a different response from the rest") object <- object[subs] rt <- length(object) termsModel <- lapply(object, function(el) formula(el)[-2]) estMeth <- vapply(object, function(el) if (is.null(val <- el[["method"]])) NA_character_ else val, "") ## checking consistency of estimation methods if(length(uEst <- unique(estMeth[!is.na(estMeth)])) > 1) { stop("all fitted objects must have the same estimation method") } estMeth[is.na(estMeth)] <- uEst ## checking if all models have same fixed effects when estMeth = "REML" REML <- uEst == "REML" if(REML) { aux <- vapply(termsModel, function(el) { tt <- terms(el) val <- paste(sort(attr(tt, "term.labels")), collapse = "&") if (attr(tt, "intercept") == 1) paste(val, "(Intercept)", sep = "&") else val }, ".") if(length(unique(aux)) > 1) { warning("fitted objects with different fixed effects. REML comparisons are not meaningful.") } } termsCall <- lapply(object, function(el) { if (is.null(val <- el$call) && is.null(val <- attr(el, "call"))) stop("objects must have a \"call\" component or attribute") val }) termsCall <- vapply(termsCall, function(el) paste(deparse(el), collapse =""), "") aux <- lapply(object, logLik, REML) if (length(unique(vapply(aux, attr, 1, "nall"))) > 1) { stop("all fitted objects must use the same number of observations") } dfModel <- vapply(aux, attr, 1, "df") logLik <- vapply(aux, c, 1.1) aod <- data.frame(call = termsCall, Model = 1:rt, df = dfModel, AIC = vapply(aux, AIC, 1.), BIC = vapply(aux, BIC, 1.), logLik = logLik, check.names = FALSE) if (test) { ddf <- diff(dfModel) if (sum(abs(ddf)) > 0) { effects <- rep("", rt) for(i in 2:rt) { if (ddf[i-1] != 0) { effects[i] <- paste(i - 1, i, sep = " vs ") } } pval <- rep(NA, rt - 1) ldf <- as.logical(ddf) lratio <- 2 * abs(diff(logLik)) lratio[!ldf] <- NA pval[ldf] <- pchisq(lratio[ldf], abs(ddf[ldf]), lower.tail=FALSE) aod <- data.frame(aod, Test = effects, "L.Ratio" = c(NA, lratio), "p-value" = c(NA, pval), check.names = FALSE, stringsAsFactors = TRUE) } } row.names(aod) <- vapply(as.list(ancall[-1L]), c_deparse, "") attr(aod, "rt") <- rt attr(aod, "verbose") <- verbose } class(aod) <- c("anova.lme", "data.frame") aod } ## (This is "cut'n'paste" similar to augPred.gls() in ./gls.R -- keep in sync!) augPred.lme <- function(object, primary = NULL, minimum = min(primary), maximum = max(primary), length.out = 51L, level = Q, ...) { data <- eval(object$call$data) if (!inherits(data, "data.frame")) { stop(gettextf("data in %s call must evaluate to a data frame", sQuote(substitute(object))), domain = NA) } if(is.null(primary)) { if (!inherits(data, "groupedData")) { stop(gettextf( "%s without \"primary\" can only be used with fits of \"groupedData\" objects", sys.call()[[1L]]), domain = NA) } primary <- getCovariate(data) pr.var <- getCovariateFormula(data)[[2L]] } else{ pr.var <- asOneSidedFormula(primary)[[2L]] primary <- eval(pr.var, data) } prName <- c_deparse(pr.var) newprimary <- seq(from = minimum, to = maximum, length.out = length.out) Q <- object$dims$Q # number of levels if (is.null(level)) level <- Q nL <- length(level) # number of requested levels maxLev <- max(c(level, 1)) groups <- getGroups(object, level = maxLev) if (!is.ordered(groups)) { groups <- ordered(groups, levels = unique(as.character(groups))) } grName <- ".groups" ugroups <- unique(groups) value <- data.frame(rep(rep(newprimary, length(ugroups)), nL), rep(rep(ugroups, rep(length(newprimary), length(ugroups))), nL)) names(value) <- c(prName, grName) ## recovering other variables in data that may be needed for predictions ## varying variables will be replaced by their means summData <- gsummary(data, groups = groups) if (any(toAdd <- is.na(match(names(summData), names(value))))) { summData <- summData[, toAdd, drop = FALSE] } value[, names(summData)] <- summData[value[, 2L], ] pred <- predict(object, value[seq_len(nrow(value)/nL), , drop = FALSE], level = level) if (nL > 1) { # multiple levels pred <- pred[, ncol(pred) - (nL - 1):0] # eliminating groups predNames <- rep(names(pred), rep(nrow(pred), nL)) pred <- c(unlist(pred)) } else { predNames <- rep("predicted", nrow(value)) } newvals <- cbind(value[, 1:2], pred) names(newvals)[3] <- respName <- deparse(resp.var <- getResponseFormula(object)[[2L]]) orig <- data.frame(primary, groups, getResponse(object)) names(orig) <- names(newvals) value <- rbind(orig, newvals) attributes(value[, 2]) <- attributes(groups) value[, ".type"] <- ordered(c(rep("original", nrow(data)), predNames), levels = c(unique(predNames), "original")) labs <- list(x = prName, y = respName) unts <- list(x = "", y = "") if(inherits(data, "groupedData")) { labs[names(attr(data, "labels"))] <- attr(data, "labels") unts[names(attr(data, "units"))] <- attr(data, "units") attr(value, "units") <- attr(data, "units") } structure(value, class = c("augPred", class(value)), labels = labs, units = unts, formula= eval(substitute(Y ~ X | G, list(Y = resp.var, X = pr.var, G = as.name(grName))))) } coef.lme <- function(object, augFrame = FALSE, level = Q, data, which = 1:ncol(data), FUN = mean, omitGroupingFactor = TRUE, subset = NULL, ...) { Q <- object$dims$Q if (length(level) > 1) { stop("only single level allowed") } fixed <- fixef(object) p <- length(fixed) value <- ranef(object, level = 1:level) grps <- object[["groups"]] if (Q > 1) { grpNames <- t(array(rep(rev(names(grps)), Q), c(Q, Q))) grpNames[lower.tri(grpNames)] <- "" grpNames <- rev(apply(grpNames, 1, function(x) paste(x[x != ""], collapse = " %in% ")))[level] } else { grpNames <- names(grps) } grps <- grps[, 1:level, drop = FALSE] grps <- gsummary(grps, groups = grps[, level]) if (level == 1) value <- list(value) effNams <- unlist(lapply(value, names)) grps <- grps[row.names(value[[level]]), , drop = FALSE] M <- nrow(grps) effNams <- unique(c(names(fixed), effNams)) effs <- array(0, c(M, length(effNams)), list(row.names(grps), effNams)) effs[, names(fixed)] <- array(rep(fixed, rep(M, p)), c(M, p)) for (i in 1:level) { nami <- names(value[[i]]) effs[, nami] <- as.matrix(effs[, nami] + value[[i]][as.character(grps[, i]), ]) } if (augFrame) { # can only do that for last level if (missing(data)) { data <- getData(object) } data <- as.data.frame(data) data <- data[, which, drop = FALSE] value <- ranef(object, TRUE, level, data, FUN = FUN, omitGroupingFactor = omitGroupingFactor, subset = subset) whichKeep <- is.na(match(names(value), effNams)) if (any(whichKeep)) { effs <- cbind(effs, value[, whichKeep, drop = FALSE]) } } effs <- as.data.frame(effs) attr(effs, "level") <- level attr(effs, "label") <- "Coefficients" attr(effs, "effectNames") <- effNams attr(effs, "standardized") <- FALSE attr(effs, "grpNames") <- grpNames class(effs) <- unique(c("coef.lme", "ranef.lme", class(effs))) effs } fitted.lme <- function(object, level = Q, asList = FALSE, ...) { Q <- object$dims$Q val <- object[["fitted"]] if (is.character(level)) { # levels must be given consistently nlevel <- match(level, names(val)) if (any(aux <- is.na(nlevel))) { stop(sprintf(ngettext(sum(aux), "nonexistent level %s", "nonexistent levels %s"), level[aux]), domain = NA) } level <- nlevel } else { # assuming integers level <- 1 + level } if (length(level) == 1L) { grp.nm <- row.names(object[["groups"]]) grps <- as.character(object[["groups"]][, max(c(1, level - 1))]) if (asList) { val <- as.list(split(val, ordered(grps, levels = unique(grps)))) } else { val <- napredict(object$na.action, val[, level]) names(val) <- grps[match(names(val), grp.nm)] } lab <- "Fitted values" if (!is.null(aux <- attr(object, "units")$y)) lab <- paste(lab, aux) attr(val, "label") <- lab val } else napredict(object$na.action, val[, level]) } formula.lme <- function(x, ...) eval(x$call$fixed) fixef.lme <- function(object, ...) object$coefficients$fixed getGroups.lme <- function(object, form, level = Q, data, sep) { Q <- object$dims$Q val <- object[["groups"]][, level] if (length(level) == 1) { # single group attr(val, "label") <- names(object[["groups"]])[level] } val } getGroupsFormula.lme <- function(object, asList = FALSE, sep) { getGroupsFormula(object$modelStruct$reStruct, asList) } getResponse.lme <- function(object, form) { val <- resid(object) + fitted(object) if (is.null(lab <- attr(object, "labels")$y)) { lab <- deparse(getResponseFormula(object)[[2L]]) } if (!is.null(aux <- attr(object, "units")$y)) { lab <- paste(lab, aux) } attr(val, "label") <- lab val } intervals.lme <- function(object, level = 0.95, which = c("all", "var-cov", "fixed"), ...) { which <- match.arg(which) val <- list() ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions fixSig <- attr(object$modelStruct, "fixedSigma") fixSig <- !is.null(fixSig) && fixSig if (which != "var-cov") { # fixed effects included est <- fixef(object) len <- -qt((1-level)/2, object$fixDF$X) * sqrt(diag(object$varFix)) vfix <- array(c(est - len, est, est + len), c(length(est), 3), list(names(est), c("lower", "est.", "upper"))) attr(vfix, "label") <- "Fixed effects:" val <- list(fixed = vfix) } if (which != "fixed") { # variance-covariance included if (is.character(aV <- object$apVar)) { stop(gettextf("cannot get confidence intervals on var-cov components: %s\n Consider '%s'", aV, "which = \"fixed\""), domain = NA) } est <- attr(aV, "Pars") nP <- length(est) len <- -qnorm((1-level)/2) * sqrt(diag(aV)) origInt <- # intervals in unconstrained parameters array(c(est - len, est, est + len), c(nP, 3), list(names(est), c("lower", "est.", "upper"))) lmeSt <- object$modelStruct if (!all(whichKeep <- apply(attr(lmeSt, "pmap"), 2, any))) { ## need to deleted components with fixed coefficients aux <- lmeSt[whichKeep] class(aux) <- class(lmeSt) attr(aux, "settings") <- attr(lmeSt, "settings") attr(aux, "pmap") <- attr(lmeSt, "pmap")[, whichKeep, drop = FALSE] lmeSt <- aux } cSt <- lmeSt[["corStruct"]] if (!is.null(cSt) && inherits(cSt, "corSymm") && attr(aV, "natural")) { ## converting to corNatural class(cSt) <- c("corNatural", "corStruct") lmeSt[["corStruct"]] <- cSt } pmap <- attr(lmeSt, "pmap") namL <- names(lmeSt) ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions if (fixSig) { natInt <- vector("list", length(namL)) names(natInt) <- namL } else { natInt <- vector("list", length(namL) + 1) names(natInt) <- c(namL, "sigma") # list of intervals in natural pars ## intervals for sigma are stored separately and dropped from origInt vsig <- exp(origInt[nP, ]) attr(vsig, "label") <- "Within-group standard error:" natInt[["sigma"]] <- vsig origInt <- origInt[ - nP,, drop = FALSE] } if (attr(aV, "natural")) { # convert any pdSymm's to pdNatural's for(i in seq_along(lmeSt$reStruct)) { if (inherits(s.i <- lmeSt$reStruct[[i]], "pdSymm")) { s.i <- pdNatural(s.i) } else if (inherits(s.i, "pdBlocked")) { for(j in seq_along(s.i)) if (inherits(s.i[[j]], "pdSymm")) s.i[[j]] <- pdNatural(s.i[[j]]) } lmeSt$reStruct[[i]] <- s.i } } rownames(origInt) <- # re-express names if necessary ## namP <- names(coef(lmeSt, unconstrained = FALSE)) for(i in 1:3) { # re-express intervals in constrained pars coef(lmeSt) <- origInt[,i] origInt[,i] <- coef(lmeSt, unconstrained = FALSE) } for(i in namL) { natInt[[i]] <- origInt[ pmap[ , i ], , drop = FALSE ] switch(i, "reStruct" = { plen <- attr( lmeSt$reStruct, "plen" ) natInt[[i]] <- rev(as.matrix( split( as.data.frame( natInt[[i]] ), rep( seq_along(plen), plen )))) names(natInt[[i]]) <- rev(names(plen)) for (j in names(plen)) { dimnames(natInt[[i]][[j]])[[1L]] <- names( coef( lmeSt[[i]][[j]], unconstrained = FALSE ) ) } }, "corStruct" =, "varStruct" = { dimnames(natInt[[i]])[[1L]] <- names(coef(lmeSt[[i]], unconstrained = FALSE)) } ) attr(natInt[[i]], "label") <- switch(i, reStruct = "Random Effects:", corStruct = "Correlation structure:", varStruct = "Variance function:", paste0(i,":")) } val <- c(val, natInt) } attr(val, "level") <- level class(val) <- "intervals.lme" val } logLik.lme <- function(object, REML, ...) { ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions fixSig <- attr(object[["modelStruct"]], "fixedSigma") fixSig <- !is.null(fixSig) && fixSig od <- object$dims p <- od$ncol[[od$Q + 1L]] N <- od$N ## Np <- N - p estM <- object$method if (missing(REML)) REML <- estM == "REML" val <- object[["logLik"]] if (REML && (estM == "ML")) { # have to correct logLik val <- val + (p * (log(2 * pi) + 1L) + (N - p) * log(1 - p/N) + sum(log(abs(svd.d(object$varFix))))) / 2 } if (!REML && (estM == "REML")) { # have to correct logLik val <- val - (p * (log(2*pi) + 1L) + N * log(1 - p/N) + sum(log(abs(svd.d(object$varFix))))) / 2 } structure(val, class = "logLik", nall = N, nobs = N - REML * p, ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions df = p + length(coef(object[["modelStruct"]])) + as.integer(!fixSig)) } nobs.lme <- function(object, ...) object$dims$N pairs.lme <- function(x, form = ~coef(.), label, id = NULL, idLabels = NULL, grid = FALSE, ...) { object <- x ## scatter plot matrix plots, generally based on coef or ranef if (!inherits(form, "formula")) { stop("'form' must be a formula") } if (length(form) != 2) { stop("'form' must be a one-sided formula") } ## constructing data allV <- all.vars(asOneFormula(form, id, idLabels)) allV <- allV[is.na(match(allV,c("T","F","TRUE","FALSE")))] if (length(allV) > 0) { data <- getData(object) if (is.null(data)) { # try to construct data alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(as.list(quote(data.frame)), alist) mode(alist) <- "call" data <- eval(alist, sys.parent(1)) } else { if (any(naV <- is.na(match(allV, names(data))))) { stop(sprintf(ngettext(sum(naV), "%s not found in data", "%s not found in data"), allV[naV]), domain = NA) } } } else data <- NULL ## argument list dots <- list(...) args <- if(length(dots) > 0) dots else list() ## covariate - must be present as a data.frame covF <- getCovariateFormula(form) .x <- eval(covF[[2L]], list(. = object)) # only function of "." if (!inherits(.x, "data.frame")) { stop("covariate must be a data frame") } level <- attr(.x, "level") if (!is.null(effNams <- attr(.x, "effectNames"))) { .x <- .x[, effNams, drop = FALSE] } ## eliminating constant effects isFixed <- vapply(.x, function(el) length(unique(el)) == 1L, NA) .x <- .x[, !isFixed, drop = FALSE] nc <- ncol(.x) if (nc == 1) { stop("cannot do pairs of just one variable") } if (!missing(label)) { names(.x) <- label } if (nc == 2) { ## will use xyplot argForm <- .y ~ .x argData <- .x names(argData) <- c(".x", ".y") if (is.null(args$xlab)) args$xlab <- names(.x)[1L] if (is.null(args$ylab)) args$ylab <- names(.x)[2L] } else { # splom argForm <- ~ .x argData <- list(.x = .x) } auxData <- list() ## groups - need not be present grpsF <- getGroupsFormula(form) if (!is.null(grpsF)) { gr <- splitFormula(grpsF, sep = "*") for(i in seq_along(gr)) { for(j in all.vars(gr[[i]])) { auxData[[j]] <- eval(as.name(j), data) } } argForm <- eval(substitute( if(length(argForm) == 2) ~ .x | R else .y ~ .x | R, list(R = grpsF[[2L]]))) } ## id and idLabels - need not be present if (!is.null(id)) { # identify points in plot N <- object$dims$N id <- switch(mode(id), numeric = { if ((id <= 0) || (id >= 1)) { stop("'id' must be between 0 and 1") } if (is.null(level)) { stop("covariate must have a level attribute when groups are present") } aux <- t(as.matrix(ranef(object, level = level))) aux <- as.logical(colSums( (solve(t(pdMatrix(object$modelStruct$reStruct, factor = TRUE)[[level]]), aux)/object$sigma)^2) > qchisq(1 - id, dim(aux)[1L])) aux }, call = eval(asOneSidedFormula(id)[[2L]], data), stop("'id' can only be a formula or numeric") ) if (length(id) == N) { ## id as a formula evaluated in data if (is.null(level)) { stop("covariate must have a level attribute when 'id' is a formula") } auxData[[".id"]] <- id } if (is.null(idLabels)) { idLabels <- row.names(.x) } else { if (mode(idLabels) == "call") { idLabels <- as.character(eval(asOneSidedFormula(idLabels)[[2L]], data)) } else if (is.vector(idLabels)) { if (length(idLabels <- unlist(idLabels)) != N) { stop("'idLabels' of incorrect length") } idLabels <- as.character(idLabels) } else { stop("'idLabels' can only be a formula or a vector") } } if (length(idLabels) == N) { ## idLabels as a formula evaluated in data if (is.null(level)) { stop("covariate must have a level attribute when 'idLabels' is a formula") } auxData[[".Lid"]] <- idLabels } } if (length(auxData)) { # need collapsing auxData <- gsummary(as.data.frame(auxData), groups = getGroups(object, level = level)) auxData <- auxData[row.names(.x), , drop = FALSE] if (!is.null(auxData[[".id"]])) { id <- auxData[[".id"]] } if (!is.null(auxData[[".Lid"]])) { idLabels <- auxData[[".Lid"]] } wchDat <- is.na(match(names(auxData), c(".id", ".idLabels"))) if (any(wchDat)) { argData <- c(argData, as.list(auxData[, wchDat, drop = FALSE])) } } if (!is.null(id)) id <- as.logical(as.character(id)) idLabels <- as.character(idLabels) ## adding to args list args <- c(list(argForm, data = argData), args) if (is.null(args$strip)) { args$strip <- function(...) strip.default(..., style = 1) } if (is.null(args$cex)) args$cex <- par("cex") if (is.null(args$adj)) args$adj <- par("adj") ## defining the type of plot if (length(argForm) == 3) { # xyplot plotFun <- "xyplot" if(is.null(args$panel)) args$panel <- function(x, y, subscripts, ...) { x <- as.numeric(x) y <- as.numeric(y) dots <- list(...) if (grid) panel.grid() panel.xyplot(x, y, ...) if (any(ids <- id[subscripts])){ ltext(x[ids], y[ids], idLabels[subscripts][ids], cex = dots$cex, adj = dots$adj) } } } else { # splom plotFun <- "splom" if(is.null(args$panel)) { args$panel <- function(x, y, subscripts, ...) { x <- as.numeric(x) y <- as.numeric(y) dots <- list(...) if (grid) panel.grid() panel.xyplot(x, y, ...) if (any(ids <- id[subscripts])){ ltext(x[ids], y[ids], idLabels[subscripts][ids], cex = dots$cex, adj = dots$adj) } } } } do.call(plotFun, as.list(args)) } plot.ranef.lme <- function(x, form = NULL, omitFixed = TRUE, level = Q, grid = TRUE, control, xlab = NULL, ylab = NULL, strip = NULL, ...) { plotControl <- function(drawLine = TRUE, span.loess = 2/3, degree.loess = 1) { list(drawLine = drawLine, span.loess = span.loess, degree.loess = degree.loess) } pControl <- plotControl() if (!missing(control)) pControl[names(control)] <- control if (!inherits(x, "data.frame")) { ## must be a list of data frames Q <- length(x) # the default for 'level' if (length(level) > 1) { stop("only single level allowed") } oAttr <- attributes(x)[c("label", "standardized", "namsEff")] x <- x[[level]] oAttr$namsEff <- oAttr$namsEff[level] attributes(x)[c("label", "standardized", "namsEff")] <- oAttr } if (omitFixed) { # eliminating constant effects isFixed <- vapply(x, function(el) length(unique(el)) == 1L, NA) if (any(isFixed)) { oattr <- attributes(x) oattr <- oattr[names(oattr) != "names"] x <- x[, !isFixed, drop = FALSE] oattr$effectNames <- oattr$effectNames[!is.na(match(oattr$effectNames, names(x)))] attributes(x)[names(oattr)] <- oattr } } eNames <- attr(x, "effectNames") if (is.null(form) || (inherits(form, "formula") && length(form) == 2)) { ## ~ x : dotplot eLen <- length(eNames) argData <- data.frame(.pars = as.vector(unlist(x[, eNames])), .enames = ordered(rep(eNames, rep(nrow(x), eLen)), level = eNames), check.names = FALSE) for(i in names(x)[is.na(match(names(x), eNames))]) { argData[[i]] <- rep(x[[i]], eLen) } argForm <- .groups ~ .pars | .enames argData[[".groups"]] <- rep(row.names(x), eLen) if (inherits(form, "formula")) { onames <- all.vars(form) if (any(whichNA <- is.na(match(onames, names(argData))))) { stop(sprintf(ngettext(sum(whichNA), "%s not available for plotting", "%s not available for plotting"), onames[whichNA], collapse = ", "), domain = NA) } argData[[".groups"]] <- as.character(argData[[as.character(onames[1L])]]) if (length(onames) > 1) { for(i in onames[-1L]) { argData[[".groups"]] <- paste(as.character(argData[[".groups"]]), as.character(argData[[i]])) } } } argData[[".groups"]] <- ordered(argData[[".groups"]], levels = unique(argData[[".groups"]])) args <- list(argForm, data = argData, ...) args$xlab <- xlab %||% attr(x, "label") args$ylab <- ylab %||% if (is.null(form)) attr(x, "grpNames") else deparse(form[[2L]]) if (is.null(args$scales)) { if (!is.null(attr(x, "standardized")) && !attr(x, "standardized")) { args$scales <- list(x = list(relation = "free")) } } args$strip <- strip %||% function(...) strip.default(..., style = 1) do.call(dotplot, args) } else { ## y ~ x ---> xyplot(): ------------------------------------------ if (!inherits(form, "formula")) stop("'form' must be a formula when not NULL") reName <- form[[2L]] if (length(reName) != 1 && substring(deparse(reName), nchar(deparse(reName), "c") - 10) != "(Intercept)") { stop("only single effects allowed in left side of 'form'") } reName <- deparse(reName) if (is.na(match(reName, eNames))) { stop(gettextf("%s is not a valid effect name", sQuote(reName)), domain = NA) } vNames <- all.vars(form[[3]]) # variable names if (any(!is.na(match(vNames, eNames)))) { stop("no effects allowed in right side of formula") } if (any(whichNA <- is.na(match(vNames, names(x))))) { stop(sprintf(ngettext(sum(whichNA), "%s not available for plotting", "%s not available for plotting"), onames[whichNA], collapse = ", "), domain = NA) } nV <- length(vNames) # number of variables nG <- nrow(x) # number of groups reVal <- vNam <- vVal <- vector("list", nV) vLevs <- vNam; names(vLevs) <- vNames vType <- character(nV); names(vType) <- vNames aux <- x[, reName] for(i in 1:nV) { obj <- x[, vNames[i]] if (inherits(obj, "factor") || is.character(obj)) { vType[i] <- "factor" obj <- as.factor(obj) vLevs[[i]] <- levels(obj) reVal[[i]] <- c(NA, NA, aux) vVal [[i]] <- c(0.5, length(levels(obj)) + 0.5, as.integer(obj)) vNam [[i]] <- rep(vNames[i], nG + 2) } else { # numeric vType[i] <- "numeric" reVal[[i]] <- aux vVal [[i]] <- obj vNam [[i]] <- rep(vNames[i], nG) } } vNam <- unlist(vNam) argData <- data.frame(y = unlist(reVal), x = unlist(vVal), g = ordered(vNam, levels = vNames)) ## this is a hack to make this work, it's probably possible to ## implement the whole thing much more succintly -- ds ## The idea here is that the limits component of scales$x is going ## to be a list -- and character vectors have special meaning as ## limits, controlling both limits and the tick mark ## positions/labels condvar <- eval(expression(g), argData) xscales.lim <- as.list(levels(condvar)) subsc <- seq_along(condvar) for (i in seq_along(xscales.lim)) { subscripts <- subsc[condvar == xscales.lim[[i]]] vN <- vNam[subscripts][1L] xscales.lim[[i]] <- if(vType[vN] == "numeric") range(argData$x[subscripts]) else vLevs[vN][[1L]] } ## --- further used from the panel() below: --- .drawLine <- pControl$drawLine .span <- pControl$span.loess .degree <- pControl$degree.loess ## assign("panel.bwplot2", panel.bwplot2, where = 1) ## assign(".cex", pControl$cex.axis)#, where = 1) ## assign(".srt", pControl$srt.axis)#, where = 1) ## assign(".mgp", pControl$mgp.axis)#, where = 1) xyplot(y ~ x | g, data = argData, subscripts = TRUE, scales = list(x = list(relation = "free", limits = xscales.lim)), panel = function(x, y, subscripts, ...) { vN <- vNam[subscripts][1L] if (grid) panel.grid() if (vType[vN] == "numeric") { panel.xyplot(x, y, ...) if (.drawLine) { panel.loess(x, y, span = .span, degree = .degree) } } else { panel.bwplot(x, y, horizontal = FALSE) if (.drawLine) { plot.line <- trellis.par.get("plot.line") panel.linejoin(x, y, fun = median, horizontal = FALSE, col.line = plot.line$col, lwd = plot.line$lwd, lty = plot.line$lty) } } }, xlab = xlab %||% "", ylab = ylab %||% reName, strip = strip %||% strip.default, ...) } } ## {plot.ranef.lme} predict.lme <- function(object, newdata, level = Q, asList = FALSE, na.action = na.fail, ...) { ## ## method for predict() designed for objects inheriting from class lme ## Q <- object$dims$Q if (missing(newdata)) { # will return fitted values val <- fitted(object, level, asList) if (length(level) == 1) return(val) return(data.frame(object[["groups"]][,level[level != 0], drop = FALSE], predict = val)) } maxQ <- max(level) # maximum level for predictions nlev <- length(level) mCall <- object$call fixed <- eval(eval(mCall$fixed)[-2]) # RHS Terms <- object$terms newdata <- as.data.frame(newdata) if (maxQ > 0) { # predictions with random effects whichQ <- Q - (maxQ-1):0 reSt <- object$modelStruct$reStruct[whichQ] lmeSt <- lmeStruct(reStruct = reSt) groups <- getGroupsFormula(reSt) if (any(is.na(match(all.vars(groups), names(newdata))))) { ## groups cannot be evaluated in newdata stop("cannot evaluate groups for desired levels on 'newdata'") } } else { reSt <- NULL } mfArgs <- list(formula = asOneFormula(formula(reSt), fixed), data = newdata, na.action = na.action, drop.unused.levels = TRUE) dataMix <- do.call(model.frame, mfArgs) origOrder <- row.names(dataMix) # preserve the original order whichRows <- match(origOrder, row.names(newdata)) if (maxQ > 0) { ## sort the model.frame by groups and get the matrices and parameters ## used in the estimation procedures grps <- getGroups(newdata, eval(substitute(~ 1 | GRPS, list(GRPS = groups[[2]])))) ## ordering data by groups if (inherits(grps, "factor")) { # single level grps <- grps[whichRows, drop = TRUE] oGrps <- data.frame(grps) ## checking if there are missing groups if (any(naGrps <- is.na(grps))) { grps[naGrps] <- levels(grps)[1L] # input with existing level } ord <- order(grps) #"order" treats a single named argument peculiarly grps <- data.frame(grps) row.names(grps) <- origOrder names(grps) <- names(oGrps) <- as.character(deparse((groups[[2L]]))) } else { grps <- oGrps <- do.call(data.frame, ## FIXME? better lapply(*, drop) ?? lapply(grps[whichRows, ], function(x) x[drop = TRUE])) ## checking for missing groups if (any(naGrps <- is.na(grps))) { ## need to input missing groups for(i in names(grps)) { grps[naGrps[, i], i] <- levels(grps[,i])[1L] } naGrps <- t(apply(naGrps, 1, cumsum)) # propagating NAs } ord <- do.call(order, grps) ## making group levels unique grps[, 1] <- grps[, 1][drop = TRUE] for(i in 2:ncol(grps)) { grps[, i] <- as.factor(paste(as.character(grps[, i-1]), as.character(grps[, i ]), sep = "/")) } } naGrps <- cbind(FALSE, naGrps)[ord, , drop = FALSE] grps <- grps[ord, , drop = FALSE] dataMix <- dataMix[ord, ,drop = FALSE] } ## making sure factor levels are the same as in contrasts contr <- object$contrasts for(i in names(dataMix)) { if (inherits(dataMix[,i], "factor") && !is.null(contr[[i]])) { levs <- levels(dataMix[,i]) levsC <- dimnames(contr[[i]])[[1L]] if (any(wch <- is.na(match(levs, levsC)))) { stop(sprintf(ngettext(sum(wch), "level %s not allowed for %s", "levels %s not allowed for %s"), paste(levs[wch], collapse = ",")), domain = NA) } ## if (length(levs) < length(levsC)) { ## if (inherits(dataMix[,i], "ordered")) { ## dataMix[,i] <- ordered(as.character(dataMix[,i]), levels = levsC) ## } else { ## dataMix[,i] <- factor(as.character(dataMix[,i]), levels = levsC) ## } ## } attr(dataMix[,i], "contrasts") <- contr[[i]][levs, , drop = FALSE] } } if (maxQ > 0) { revOrder <- match(origOrder, row.names(dataMix)) # putting in orig. order Z <- model.matrix(reSt, dataMix) ncols <- attr(Z, "ncols") Names(lmeSt$reStruct) <- attr(Z, "nams") } N <- nrow(dataMix) X <- if (length(all.vars(fixed)) > 0) { model.matrix(fixed, model.frame(delete.response(Terms), dataMix)) } else if(attr(terms(fixed), "intercept")) { array(1, c(N, 1), list(row.names(dataMix), "(Intercept)")) } else { array(, c(N, 0)) } if (maxQ == 0) { ## only population predictions val <- if(ncol(X)) c(X %*% fixef(object)) else rep(0, nrow(X)) attr(val, "label") <- "Predicted values" return(val) } ncols <- c(ncols, dim(X)[2L], 1) ## creating the condensed linear model attr(lmeSt, "conLin") <- list(Xy = array(c(Z, X, double(N)), c(N, sum(ncols)), list(row.names(dataMix), c(colnames(Z), colnames(X), "resp"))), dims = MEdims(grps, ncols)) ## Getting the appropriate BLUPs of the random effects re <- object$coefficients$random[1:maxQ] for(i in names(re)) { ugrps <- unique(as.character(grps[, i])) val <- array(NA, c(length(ugrps), ncol(re[[i]])), list(ugrps, dimnames(re[[i]])[[2L]])) mGrps <- match(ugrps, dimnames(re[[i]])[[1L]]) mGrps <- mGrps[!is.na(mGrps)] re[[i]] <- re[[i]][mGrps, , drop = FALSE] val[dimnames(re[[i]])[[1L]], ] <- re[[i]] re[[i]] <- val } attr(lmeSt, "lmeFit") <- list(beta = fixef(object), b = re) val <- fitted(lmeSt, level = 0:maxQ) val[as.logical(naGrps)] <- NA # setting missing groups to NA ## putting back in original order and extracting levels val <- val[revOrder, level + 1L] # predictions if (maxQ > 1) { # making groups unique for(i in 2:maxQ) oGrps[, i] <- as.factor(paste(as.character(oGrps[,i-1]), as.character(oGrps[,i ]), sep = "/")) } if (nlev == 1) { grps <- as.character(oGrps[, level]) if (asList) { val <- split(val, ordered(grps, levels = unique(grps))) } else { names(val) <- grps } lab <- "Predicted values" if (!is.null(aux <- attr(object, "units")$y)) { lab <- paste(lab, aux) } attr(val, "label") <- lab val } else { data.frame(oGrps, predict = val) } } print.anova.lme <- function(x, verbose = attr(x, "verbose"), ...) { ox <- x if ((rt <- attr(x,"rt")) == 1) { ## one object if (!is.null(lab <- attr(x, "label"))) { cat(lab) if (!is.null(L <- attr(x, "L"))) { print(zapsmall(L), ...) } } pval <- format(round(x[, "p-value"],4)) pval[as.double(pval) == 0] <- "<.0001" x[, "F-value"] <- format(zapsmall(x[, "F-value"])) x[, "p-value"] <- pval print(as.data.frame(x), ...) } else { ## several objects if (verbose) { cat("Call:\n") objNams <- row.names(x) for(i in 1:rt) { cat(" ",objNams[i],":\n", sep ="") cat(" ",as.character(x[i,"call"]),"\n") } cat("\n") } x <- as.data.frame(x[,-1]) for(i in names(x)) { xx <- x[[i]] if (i == "p-value") { xx <- round(xx, 4) xna <- is.na(xx) xx[!xna] <- format(xx[!xna]) xx[as.double(xx) == 0] <- "<.0001" xx[xna] <- "" } else { if (match(i, c("AIC", "BIC", "logLik", "L.Ratio"), 0)) { xna <- is.na(xx) xx <- zapsmall(xx) xx[xna] <- 0 xx <- format(xx) xx[xna] <- "" } } x[[i]] <- xx } print(as.data.frame(x), ...) } invisible(ox) } print.intervals.lme <- function(x, ...) { cat(paste0("Approximate ", attr(x,"level") *100, "% confidence intervals\n")) for(i in names(x)) { aux <- x[[i]] cat("\n ",attr(aux, "label"), "\n", sep = "") if (i == "reStruct") { for(j in names(aux)) { cat(" Level:", j, "\n") print(as.matrix(aux[[j]]), ...) } } else if (i == "sigma") print(c(aux), ...) else print(as.matrix(aux), ...) } invisible(x) } print.lme <- function(x, ...) { dd <- x$dims if (inherits(x, "nlme")) { # nlme object cat( "Nonlinear mixed-effects model fit by " ) cat( if(x$method == "REML") "REML\n" else "maximum likelihood\n") cat(" Model:", deparse(x$call$model),"\n") } else { # lme objects cat( "Linear mixed-effects model fit by " ) cat( if(x$method == "REML") "REML\n" else "maximum likelihood\n") } cat(" Data:", deparse( x$call$data ), "\n") if (!is.null(x$call$subset)) { cat(" Subset:", deparse(asOneSidedFormula(x$call$subset)[[2L]]),"\n") } cat(" Log-", if(x$method == "REML") "restricted-" else "", "likelihood: ", format(x$logLik), "\n", sep = "") fixF <- x$call$fixed cat(" Fixed:", deparse( if(inherits(fixF, "formula") || is.call(fixF) || is.name(fixF)) x$call$fixed else lapply(fixF, function(el) as.name(deparse(el)))), "\n") print(fixef(x), ...) cat("\n") print(summary(x$modelStruct), sigma = x$sigma, ...) cat("Number of Observations:", dd[["N"]]) cat("\nNumber of Groups: ") Ngrps <- dd$ngrps[1:dd$Q] if ((lNgrps <- length(Ngrps)) == 1) { # single nesting cat(Ngrps,"\n") } else { # multiple nesting sNgrps <- 1:lNgrps aux <- rep(names(Ngrps), sNgrps) aux <- split(aux, array(rep(sNgrps, lNgrps), c(lNgrps, lNgrps))[!lower.tri(diag(lNgrps))]) names(Ngrps) <- unlist(lapply(aux, paste, collapse = " %in% ")) cat("\n") print(rev(Ngrps), ...) } invisible(x) } print.ranef.lme <- function(x, ...) { if (!inherits(x[[1L]], "data.frame")) { print.data.frame(x, ...) } else { # list for(i in seq_along(x)) { cat("Level:", attr(x, "grpNames")[i],"\n") print.data.frame(x[[i]]) if (i < length(x)) cat("\n") } } invisible(x) } print.summary.lme <- function(x, verbose = FALSE, ...) { dd <- x$dims verbose <- verbose || attr(x, "verbose") if (inherits(x, "nlme")) { # nlme object cat( "Nonlinear mixed-effects model fit by " ) cat( if(x$method == "REML") "REML\n" else "maximum likelihood\n") cat(" Model:", deparse(x$call$model),"\n") } else { # lme objects cat( "Linear mixed-effects model fit by " ) cat( if(x$method == "REML") "REML\n" else "maximum likelihood\n") } ## method <- x$method cat(" Data:", deparse( x$call$data ), "\n") if (!is.null(x$call$subset)) { cat(" Subset:", deparse(asOneSidedFormula(x$call$subset)[[2L]]),"\n") } print(data.frame(AIC = x$AIC, BIC = x$BIC, logLik = c(x$logLik), row.names = " "), ...) if (verbose) { cat("Convergence at iteration:",x$numIter,"\n") } cat("\n") print(summary(x$modelStruct), sigma = x$sigma, reEstimates = x$coef$random, verbose = verbose, ...) cat("Fixed effects: ") fixF <- x$call$fixed if (inherits(fixF, "formula") || is.call(fixF)) { cat(deparse(x$call$fixed), "\n") } else { cat(deparse(lapply(fixF, function(el) as.name(deparse(el)))), "\n") } ## fixed effects t-table and correlations xtTab <- as.data.frame(x$tTable) wchPval <- match("p-value", names(xtTab)) for(i in names(xtTab)[-wchPval]) { xtTab[, i] <- format(zapsmall(xtTab[, i])) } xtTab[,wchPval] <- format(round(xtTab[,wchPval], 4)) if (any(wchLv <- (as.double(levels(xtTab[, wchPval])) == 0))) { levels(xtTab[, wchPval])[wchLv] <- "<.0001" } row.names(xtTab) <- dimnames(x$tTable)[[1L]] print(xtTab, ...) if (nrow(x$tTable) > 1) { corr <- x$corFixed class(corr) <- "correlation" print(corr, title = " Correlation:", ...) } cat("\nStandardized Within-Group Residuals:\n") print(x$residuals, ...) cat("\nNumber of Observations:",x$dims[["N"]]) cat("\nNumber of Groups: ") Ngrps <- dd$ngrps[1:dd$Q] if ((lNgrps <- length(Ngrps)) == 1) { # single nesting cat(Ngrps,"\n") } else { # multiple nesting sNgrps <- 1:lNgrps aux <- rep(names(Ngrps), sNgrps) aux <- split(aux, array(rep(sNgrps, lNgrps), c(lNgrps, lNgrps))[!lower.tri(diag(lNgrps))]) names(Ngrps) <- unlist(lapply(aux, paste, collapse = " %in% ")) cat("\n") print(rev(Ngrps), ...) } invisible(x) } ## coef(summary( obj )) # should work for "gls" or "lme" similarly as for lm(): getCTable <- function (object, ...) object$tTable qqnorm.lme <- function(y, form = ~ resid(., type = "p"), abline = NULL, id = NULL, idLabels = NULL, grid = FALSE, ...) ## normal probability plots for residuals and random effects { if (!inherits(form, "formula")) stop("'form' must be a formula") ## object <- y ## constructing data allV <- all.vars(asOneFormula(form, id, idLabels)) allV <- allV[is.na(match(allV,c("T","F","TRUE","FALSE")))] if (length(allV) > 0) { data <- getData(y) if (is.null(data)) { # try to construct data alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(as.list(quote(data.frame)), alist) mode(alist) <- "call" data <- eval(alist, sys.parent(1)) } else { if (any(naV <- is.na(match(allV, names(data))))) { stop(sprintf(ngettext(sum(naV), "%s not found in data", "%s not found in data"), allV[naV]), domain = NA) } } } else data <- NULL ## argument list args <- list(...) # may be empty list() ## appending object to data data <- as.list(c(as.list(data), . = list(y))) ## covariate - must always be present covF <- getCovariateFormula(form) .x <- eval(covF[[2L]], data) labs <- attr(.x, "label") type <- if (inherits(.x, "ranef.lme")) "reff" # random effects else if (!is.null(labs) && (labs == "Standardized residuals" || labs == "Normalized residuals" || substr(labs, 1, 9) == "Residuals")) "res" # residuals else stop("only residuals and random effects allowed") if (is.null(args$xlab)) args$xlab <- labs if (is.null(args$ylab)) args$ylab <- "Quantiles of standard normal" if(type == "res") { ## residuals ---------------------------------------- fData <- qqnorm(.x, plot.it = FALSE) data[[".y"]] <- fData$x data[[".x"]] <- fData$y dform <- if (!is.null(grp <- getGroupsFormula(form))) eval(substitute(.y ~ .x | G, list(G = grp[[2L]]))) else .y ~ .x if (!is.null(id)) { # identify points in plot id <- switch(mode(id), numeric = { if (any(id <= 0) || any(id >= 1)) { stop("'Id' must be between 0 and 1") } if (labs == "Normalized residuals") { as.logical(abs(resid(y, type="normalized")) > -qnorm(id / 2)) } else { as.logical(abs(resid(y, type="pearson")) > -qnorm(id / 2)) } }, call = eval(asOneSidedFormula(id)[[2L]], data), stop("'id' can only be a formula or numeric") ) if (is.null(idLabels)) { idLabels <- getGroups(y) if (length(idLabels) == 0) idLabels <- seq_len(y$dims$N) idLabels <- as.character(idLabels) } else { if (mode(idLabels) == "call") { idLabels <- as.character(eval(asOneSidedFormula(idLabels)[[2L]], data)) } else if (is.vector(idLabels)) { if (length(idLabels <- unlist(idLabels)) != length(id)) { stop("'idLabels' of incorrect length") } idLabels <- as.character(idLabels) } else { stop("'idLabels' can only be a formula or a vector") } } } } else { # type "ref" -- random.effects -------------------------------- level <- attr(.x, "level") std <- attr(.x, "standardized") if (!is.null(effNams <- attr(.x, "effectNames"))) { .x <- .x[, effNams, drop = FALSE] } nc <- ncol(.x) nr <- nrow(.x) fData <- lapply(as.data.frame(.x), qqnorm, plot.it = FALSE) fData <- data.frame(.x = unlist(lapply(fData, function(x) x[["y"]])), .y = unlist(lapply(fData, function(x) x[["x"]])), .g = ordered(rep(names(fData),rep(nr, nc)), levels = names(fData)), check.names = FALSE) if (!is.null(grp <- getGroupsFormula(form))) { dform <- substitute(.y ~ .x | .g * GG, list(GG = deparse(grp[[2L]]))) auxData <- data[is.na(match(names(data), "."))] } else { dform <- .y ~ .x | .g auxData <- list() } ## id and idLabels - need not be present if (!is.null(id)) { # identify points in plot N <- y$dims$N id <- switch(mode(id), numeric = { if ((id <= 0) || (id >= 1)) { stop("'id' must be between 0 and 1") } aux <- ranef(y, level = level, standard = TRUE) as.logical(abs(c(unlist(aux))) > -qnorm(id / 2)) }, call = eval(asOneSidedFormula(id)[[2L]], data), stop("'id' can only be a formula or numeric") ) if (length(id) == N) { ## id as a formula evaluated in data auxData[[".id"]] <- id } idLabels <- if (is.null(idLabels)) { rep(row.names(.x), nc) } else if (mode(idLabels) == "call") { as.character(eval(asOneSidedFormula(idLabels)[[2L]], data)) } else if (is.vector(idLabels)) { if (length(idLabels <- unlist(idLabels)) != N) stop("'idLabels' of incorrect length") as.character(idLabels) } else stop("'idLabels' can only be a formula or a vector") if (length(idLabels) == N) { ## idLabels as a formula evaluated in data auxData[[".Lid"]] <- idLabels } } data <- if (length(auxData)) { # need collapsing auxData <- gsummary(as.data.frame(auxData), groups = getGroups(y, level = level)) auxData <- auxData[row.names(.x), , drop = FALSE] if (!is.null(auxData[[".id"]])) id <- rep(auxData[[".id"]], nc) if (!is.null(auxData[[".Lid"]])) idLabels <- rep(auxData[[".Lid"]], nc) cbind(fData, do.call(rbind, rep(list(auxData), nc))) } else fData } id <- if (!is.null(id)) as.logical(as.character(id)) idLabels <- as.character(idLabels) abl <- abline if (is.null(args$strip)) args$strip <- function(...) strip.default(..., style = 1) if (is.null(args$cex)) args$cex <- par("cex") if (is.null(args$adj)) args$adj <- par("adj") args <- c(list(dform, data = substitute(data)), args) if (is.null(args$panel)) args$panel <- function(x, y, subscripts, ...) { x <- as.numeric(x) y <- as.numeric(y) dots <- list(...) if (grid) panel.grid() panel.xyplot(x, y, ...) if (any(ids <- id[subscripts])){ ltext(x[ids], y[ids], idLabels[subscripts][ids], cex = dots$cex, adj = dots$adj) } if (!is.null(abl)) { if (length(abl) == 2) panel.abline(a = abl, ...) else panel.abline(h = abl, ...) } } if(type == "reff" && !std) { args[["scales"]] <- list(x = list(relation = "free")) } do.call(xyplot, as.list(args)) } ranef.lme <- ## Extracts the random effects from an lme object. ## If aug.frame is true, the returned data frame is augmented with a ## values from the original data object, if available. The variables ## in the original data are collapsed over the cluster variable by the ## function fun. function(object, augFrame = FALSE, level = 1:Q, data, which = 1:ncol(data), FUN = mean, standard = FALSE , omitGroupingFactor = TRUE, subset = NULL, ...) { Q <- object$dims$Q effects <- object$coefficients$random if (Q > 1) { grpNames <- t(array(rep(rev(names(effects)), Q), c(Q, Q))) grpNames[lower.tri(grpNames)] <- "" grpNames <- rev(apply(grpNames, 1, function(x) paste(x[x != ""], collapse = " %in% "))) } else { grpNames <- names(effects) } effects <- effects[level] grpNames <- grpNames[level] if (standard) { for (i in names(effects)) { effects[[i]] <- t(t(effects[[i]]) / (object$sigma * sqrt(diag(as.matrix(object$modelStruct$reStruct[[i]]))))) } } effects <- lapply(effects, as.data.frame) if (augFrame) { if (length(level) > 1) { stop("augmentation of random effects only available for single level") } effects <- effects[[1L]] effectNames <- names(effects) if (missing(data)) { data <- getData(object) } data <- as.data.frame(data) subset <- if (is.null(subset)) { # nlme case eval(object$call[["naPattern"]]) } else { asOneSidedFormula(as.list(match.call())[["subset"]]) } if (!is.null(subset)) { subset <- eval(subset[[2L]], data) data <- data[subset, ,drop=FALSE] } data <- data[, which, drop = FALSE] ## eliminating columns with same names as effects data <- data[, is.na(match(names(data), effectNames)), drop = FALSE] grps <- as.character(object[["groups"]][, level]) data <- gsummary(data, FUN = FUN, groups = grps) if (omitGroupingFactor) { data <- data[, is.na(match(names(data), names(object$modelStruct$reStruct))), drop = FALSE] } if (length(data) > 0) { effects <- cbind(effects, data[row.names(effects),, drop = FALSE]) } attr(effects, "effectNames") <- effectNames } else { effects <- lapply(effects, function(el) { attr(el, "effectNames") <- names(el) el }) if (length(level) == 1) effects <- effects[[1L]] } structure(effects, class = c("ranef.lme", class(effects)), label= if (standard) "Standardized random effects" else "Random effects", level = max(level), standardized = standard, grpNames = grpNames) } residuals.lme <- function(object, level = Q, type = c("response", "pearson", "normalized"), asList = FALSE, ...) { type <- match.arg(type) Q <- object$dims$Q val <- object[["residuals"]] if (is.character(level)) { # levels must be given consistently nlevel <- match(level, names(val)) if (any(aux <- is.na(nlevel))) { stop(sprintf(ngettext(sum(aux), "nonexistent level %s", "nonexistent levels %s"), level[aux]), domain = NA) } level <- nlevel } else { # assuming integers level <- 1 + level } if (type != "response") { # standardize ## have to standardize properly for when corStruct neq NULL val <- val[, level]/attr(val, "std") } else { val <- val[, level] } if (type == "normalized") { if (!is.null(cSt <- object$modelStruct$corStruct)) { ## normalize according to inv-trans factor val <- recalc(cSt, list(Xy = as.matrix(val)))$Xy[, seq_along(level)] } else { # will just standardized type <- "pearson" } } if (length(level) == 1) { grps <- as.character(object[["groups"]][, max(c(1, level - 1))]) if (asList) { val <- as.list(split(val, ordered(grps, levels = unique(grps)))) } else { grp.nm <- row.names(object[["groups"]]) val <- naresid(object$na.action, val) names(val) <- grps[match(names(val), grp.nm)] } attr(val, "label") <- switch(type, response = { if (!is.null(aux <- attr(object, "units")$y)) paste("Residuals", aux) else "Residuals" }, pearson = "Standardized residuals", normalized = "Normalized residuals" ) val } else naresid(object$na.action, val) } summary.lme <- function(object, adjustSigma = TRUE, verbose = FALSE, ...) { ## variance-covariance estimates for fixed effects fixed <- fixef(object) stdFixed <- sqrt(diag(as.matrix(object$varFix))) object$corFixed <- array(t(object$varFix/stdFixed)/stdFixed, dim(object$varFix), list(names(fixed),names(fixed))) if (adjustSigma && object$method == "ML") stdFixed <- stdFixed * sqrt(object$dims$N/(object$dims$N - length(stdFixed))) ## fixed effects coefficients, std. deviations and t-ratios ## fDF <- object$fixDF[["X"]] tVal <- fixed/stdFixed object$tTable <- cbind(Value = fixed, Std.Error = stdFixed, DF = fDF, "t-value" = tVal, "p-value" = 2 * pt(-abs(tVal), fDF)) ## ## residuals ## resd <- resid(object, type = "pearson") if (length(resd) > 5) { resd <- quantile(resd, na.rm = TRUE) # might have NAs from na.exclude names(resd) <- c("Min","Q1","Med","Q3","Max") } object$residuals <- resd ## ## generating the final object ## aux <- logLik(object) object$BIC <- BIC(aux) object$AIC <- AIC(aux) structure(object, verbose = verbose, oClass = class(object), class = c("summary.lme", class(object))) } ## based on R's update.default update.lme <- function (object, fixed., ..., evaluate = TRUE) { call <- object$call if (is.null(call)) stop("need an object with call component") extras <- match.call(expand.dots = FALSE)$... if (!missing(fixed.)) call$fixed <- update.formula(formula(object), fixed.) if(length(extras) > 0) { existing <- !is.na(match(names(extras), names(call))) ## do these individually to allow NULL to remove entries. for (a in names(extras)[existing]) call[[a]] <- extras[[a]] if(any(!existing)) call <- as.call(c(as.list(call), extras[!existing])) } if(evaluate) eval(call, parent.frame()) else call } ## update.lme <- ## function(object, fixed, data, random, correlation, weights, subset, ## method, na.action, control, contrasts, ...) ## { ## thisCall <- as.list(match.call())[-(1:2)] ## if (is.null(nextCall <- object$origCall) || ## !is.null(thisCall$fixed) || ## is.null(thisCall$random)) { ## nextCall <- object$call ## } ## nextCall <- as.list(nextCall)[-1L] ## if (is.null(thisCall$random) && is.null(thisCall$subset)) { ## ## no changes in ranef model and no subsetting ## thisCall$random <- object$modelStruct$reStruct ## } ## if (is.na(match("correlation", names(thisCall))) && ## !is.null(thCor <- object$modelStruct$corStruct)) { ## thisCall$correlation <- thCor ## } ## if (is.na(match("weights", names(thisCall))) && ## !is.null(thWgt <- object$modelStruct$varStruct)) { ## thisCall$weights <- thWgt ## } ## argNams <- unique( c(names(nextCall), names(thisCall)) ) ## args <- vector("list", length(argNams)) ## names(args) <- argNams ## args[ names(nextCall) ] <- nextCall ## nextCall <- args ## if (!is.null(thisCall$fixed)) { ## thisCall$fixed <- update(as.formula(nextCall$fixed), fixed) ## } ## nextCall[names(thisCall)] <- thisCall ## do.call(lme, nextCall) ## } Variogram.lme <- function(object, distance, form = ~1, resType = c("pearson", "response", "normalized"), data, na.action = na.fail, maxDist, length.out = 50, collapse = c("quantiles", "fixed", "none"), nint = 20, breaks, robust = FALSE, metric = c("euclidean", "maximum", "manhattan"), ...) { resType <- match.arg(resType) grps <- getGroups(object, level = object$dims$Q) ## checking if object has a corSpatial element csT <- object$modelStruct$corStruct wchRows <- NULL if (missing(distance)) { if (missing(form) && inherits(csT, "corSpatial")) { distance <- getCovariate(csT) } else { metric <- match.arg(metric) if (missing(data)) { data <- getData(object) } if (is.null(data)) { # will try to construct allV <- all.vars(form) if (length(allV) > 0) { alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(as.list(quote(data.frame)), alist) mode(alist) <- "call" data <- eval(alist, sys.parent(1)) } } covForm <- getCovariateFormula(form) if (length(all.vars(covForm)) > 0) { if (attr(terms(covForm), "intercept") == 1) { covForm <- eval(substitute( ~ cFORM - 1, list(cFORM = covForm[[2L]]))) } covar <- model.frame(covForm, data, na.action = na.action) ## making sure grps is consistent wchRows <- !is.na(match(row.names(data), row.names(covar))) grps <- grps[wchRows, drop = TRUE] covar <- as.data.frame(unclass(model.matrix(covForm, covar))) } else { covar <- data.frame(dist = unlist(tapply(rep(1, nrow(data)), grps, cumsum))) } covar <- split(covar, grps) ## getting rid of 1-observation groups covar <- covar[sapply(covar, function(el) nrow(as.matrix(el))) > 1] distance <- lapply(covar, function(el, metric) dist(as.matrix(el), metric), metric = metric) } } res <- resid(object, type = resType) if (!is.null(wchRows)) { res <- res[wchRows] } res <- split(res, grps) res <- res[lengths(res) > 1L] # no 1-observation groups ## levGrps <- levels(grps) val <- lapply(seq_along(res), function(i) Variogram(res[[i]], distance[[i]])) names(val) <- names(res) val <- do.call(rbind, val) if (!missing(maxDist)) { val <- val[val$dist <= maxDist, ] } collapse <- match.arg(collapse) if (collapse != "none") { # will collapse values dst <- val$dist udist <- sort(unique(dst)) ludist <- length(udist) if (!missing(breaks)) { if (min(breaks) > udist[1L]) breaks <- c(udist[1L], breaks) if (max(breaks) < udist[2L]) breaks <- c(breaks, udist[2L]) if (!missing(nint) && nint != (length(breaks) - 1L)) { stop("'nint' is not consistent with 'breaks'") } nint <- length(breaks) - 1 } cutDist <- if (nint < ludist) { if (missing(breaks)) breaks <- if (collapse == "quantiles") { # break into equal groups unique(quantile(dst, seq(0, 1, 1/nint), names=FALSE)) } else { # fixed length intervals seq(udist[1L], udist[length(udist)], length = nint + 1L) } cut(dst, breaks) } else dst val <- lapply(split(val, cutDist), function(el) { vrg <- el$variog vrg <- if (robust) ((mean(vrg^0.25))^4) / (0.457+ 0.494/nrow(el)) else mean(vrg) data.frame(variog = vrg, dist = median(el$dist)) }) val <- do.call(rbind, val) val$n.pairs <- as.vector(table(na.omit(cutDist))) val <- na.omit(val) # getting rid of NAs } row.names(val) <- 1:nrow(val) if (inherits(csT, "corSpatial") && resType != "normalized") { ## will keep model variogram sig2 <- if (resType == "pearson") 1 else object$sigma^2 attr(val, "modelVariog") <- Variogram(csT, sig2 = sig2, length.out = length.out) } structure(val, class = c("Variogram", "data.frame"), collapse = (collapse != "none")) } ###*### lmeStruct - a model structure for lme fits lmeStruct <- ## constructor for lmeStruct objects function(reStruct, corStruct = NULL, varStruct = NULL) { val <- list(reStruct = reStruct, corStruct = corStruct, varStruct = varStruct) structure(val[!vapply(val, is.null, NA)], # removing NULL components settings = attr(val$reStruct, "settings"), class = c("lmeStruct", "modelStruct")) } ##*## lmeStruct methods for standard generics fitted.lmeStruct <- function(object, level = Q, conLin = attr(object, "conLin"), lmeFit = attr(object, "lmeFit"), ...) { if (is.null(conLin)) { stop("no condensed linear model") } if (is.null(lmeFit)) { stop("no fitted \"lme\" object") } dd <- conLin$dims Q <- dd$Q Qp1 <- Q + 1L nc <- dd$ncol fit <- array(0, c(dd$N, Qp1), list(dimnames(conLin$Xy)[[1L]], c("fixed", rev(names(object$reStruct))))) ZXstart <- rev(cumsum(c(1, nc[1:Q]))) ZXend <- rev(cumsum(nc[1:Qp1])) ZXlen <- dd$ZXlen[Q:1] ZXngrps <- dd$ngrps[Q:1] ZXb <- lmeFit$b nc <- nc[Q:1] if(ZXstart[1L] <= ZXend[1L]) fit[, "fixed"] <- # population fitted values conLin$Xy[, ZXstart[1L]:ZXend[1L], drop = FALSE] %*% lmeFit$beta for(i in 1:Q) { j <- i + 1L fit[, j] <- fit[, i] + (conLin$Xy[, ZXstart[j]:ZXend[j], drop = FALSE] * ZXb[[i]][rep(1:ZXngrps[i], ZXlen[[i]]),,drop = FALSE]) %*% rep(1, nc[i]) } ## this is documented to return a vector for one level, matrix for more. ## So it should be a matrix if there is only one row, but not if ## there is only one columns. if(length(level) > 1) fit[, level + 1L, drop = FALSE] else fit[, level+1] } Initialize.lmeStruct <- function(object, data, groups, conLin = attr(object, "conLin"), control= list(niterEM = 20, gradHess = TRUE), ...) { object[] <- lapply(object, Initialize, data, conLin, control) theta <- lapply(object, coef) len <- lengths(theta) pmap <- if (sum(len) > 0) { num <- seq_along(len) outer(rep(num, len), num, "==") } else { array(FALSE, c(1, length(len))) } dimnames(pmap) <- list(NULL, names(object)) attr(object, "pmap") <- pmap if (length(object) == 1 && # only reStruct all(attr(object, "settings")[-(1:3)] >= 0) && # known pdMat class control[["gradHess"]]) { ## can use numerical derivatives attr(object, "settings")[2:3] <- c(0, 1) class(object) <- c("lmeStructInt", class(object)) } if (needUpdate(object)) { attr(object, "lmeFit") <- MEestimate(object, groups) update(object, data) } else { object } } logLik.lmeStruct <- function(object, Pars, conLin = attr(object, "conLin"), ...) { coef(object) <- Pars # updating parameter values recalc(object, conLin)[["logLik"]] # updating conLin } logLik.lmeStructInt <- function(object, Pars, conLin = attr(object, "conLin"), ...) { ## logLik for objects with reStruct parameters only, with ## internally defined class q <- length(Pars) settings <- as.integer(attr(object, "settings")) aux <- .C(mixed_loglik, # >> ../src/nlmefit.c as.double(conLin[["Xy"]]), # ZXy as.integer(unlist(conLin$dims)), # pdims[] as.double(Pars), # pars[] settings, # settings val = double(1 + q * (q + 1)), # logLik[] = (value, gradient, Hessian) double(1), # lRSS as.double(conLin$sigma) # sigma (17-11-2015; Fixed sigma patch ..) )[["val"]] val <- aux[1L] attr(val, "gradient") <- -aux[1 + (1:q)] attr(val, "hessian") <- -array(aux[-(1:(q+1))], c(q, q)) val } residuals.lmeStruct <- function(object, level = conLin$dims$Q, conLin = attr(object, "conLin"), lmeFit = attr(object, "lmeFit"), ...) { conLin$Xy[, conLin$dims$ZXcols] - fitted(object, level, conLin, lmeFit) } varWeights.lmeStruct <- function(object) { if (is.null(object$varStruct)) rep(1, attr(object, "conLin")$dims$N) else varWeights(object$varStruct) } ## Auxiliary control functions lmeControl <- ## Control parameters for lme function(maxIter = 50, msMaxIter = 50, tolerance = 1e-6, niterEM = 25, msMaxEval = 200, msTol = 1e-7, msVerbose = FALSE, returnObject = FALSE, gradHess = TRUE, apVar = TRUE, .relStep = .Machine$double.eps^(1/3), minAbsParApVar = 0.05, opt = c("nlminb", "optim"), optimMethod = "BFGS", natural = TRUE, sigma = NULL, ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions allow.n.lt.q = FALSE, # 23-01-2019 (NA would be back compatible) ...) { if(is.null(sigma)) sigma <- 0 else if(!is.finite(sigma) || length(sigma) != 1 || sigma < 0) stop("Within-group std. dev. must be a positive numeric value") list(maxIter = maxIter, msMaxIter = msMaxIter, tolerance = tolerance, niterEM = niterEM, msMaxEval = msMaxEval, msTol = msTol, msVerbose = msVerbose, returnObject = returnObject, gradHess = gradHess , apVar = apVar, .relStep = .relStep, opt = match.arg(opt), optimMethod = optimMethod, minAbsParApVar = minAbsParApVar, natural = natural, sigma = sigma, allow.n.lt.q = allow.n.lt.q, ...) } ## Local Variables: ## ess-indent-offset: 2 ## End: nlme/R/newGenerics.R0000644000176200001440000001220712454433071014007 0ustar liggesusers### New generics used with corStruct, varFunc, groupedData, and reStruct ### ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates # Copyright 2007-2011 The R Core team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # ACF <- ## autocorrelation function - needed not exist if acf were generic function(object, maxLag, ...) UseMethod("ACF") asTable <- ## Return the object in a tabular form function(object) UseMethod("asTable") augPred <- ## Return the data used to fit the model augmented with the predictions function(object, primary = NULL, minimum = min(primary), maximum = max(primary), length.out = 51, ...) UseMethod("augPred") "coef<-" <- "coefficients<-" <- ## Assignment of the unconstrained parameter function(object, ..., value) UseMethod("coef<-") collapse <- ## collapse a data frame according to a factor, or several nested factors function(object, ...) UseMethod("collapse") comparePred <- ## compare predictions from different fitted objects function(object1, object2, primary = NULL, minimum = min(primary), maximum = max(primary), length.out = 51, level = NULL, ...) UseMethod("comparePred") "covariate<-" <- ## Assignment of the primary covariate function(object, value) UseMethod("covariate<-") Dim <- ## Extract dimensions of an object. Not needed if "dims" were generic function(object, ...) UseMethod("Dim") fixed.effects <- ## Generic extractor for estimates of fixed effects function(object, ...) UseMethod("fixef") fixef <- ## Short form for generic extractor for estimates of fixed effects function(object, ...) UseMethod("fixef") getCovariate <- ## Return the primary covariate associated with object according to form function(object, form = formula(object), data) UseMethod("getCovariate") getData <- ## Return the data.frame used to fit an object, if any was given in ## the call that produced it function(object) UseMethod("getData") getGroups <- ## Return the groups associated with object according to form. function(object, form = formula(object), level, data, sep = "/") UseMethod("getGroups") getGroupsFormula <- ## Return the formula(s) for the groups associated with object. ## The result is a one-sided formula unless asList is TRUE in which case ## it is a list of formulas, one for each level. function(object, asList = FALSE, sep = "/") UseMethod("getGroupsFormula") getResponse <- ## Return the response associated with object according to form. function(object, form = formula(object)) UseMethod("getResponse") isBalanced <- ## Check for balance, especially in a groupedData object function(object, countOnly = FALSE, level) UseMethod("isBalanced") isInitialized <- ## Determine if the object has been assigned a value function(object) UseMethod("isInitialized") Initialize <- ## Initialize objects function(object, data, ...) UseMethod("Initialize") intervals <- ## generate confidence intervals for the parameters in object function(object, level = 0.95, ...) UseMethod("intervals") logDet <- ## Returns the negative of the sum of the logarithm of the determinant function(object, ...) UseMethod("logDet") "matrix<-" <- ## Assignment of the matrix in an object representing special types of matrices function(object, value) UseMethod("matrix<-") Names <- ## Extract names of an object. Not needed if "names" were generic function(object, ...) UseMethod("Names") "Names<-" <- ## Assignment of names. Not needed if "names<-" were generic function(object, ..., value) UseMethod("Names<-") needUpdate <- ## Checks if model plug-in needs to be updated after an estimation cycle function(object) UseMethod("needUpdate") #pruneLevels <- # ## Returns the factor with the levels attribute truncated to only those # ## levels occuring in the factor # function(object) UseMethod("pruneLevels") random.effects <- ## Generic function for extracting the random effects ## If aug.frame is true, the returned data frame is augmented with ## values from the original data object, if available. The variables ## in the original data are collapsed over the groups variable by the ## function fun. function(object, ...) UseMethod("ranef") ranef <- ## Short form for generic function for extracting the random effects function(object, ...) UseMethod("ranef") recalc <- ## Recalculate condensed linear object, according to model plug-in function(object, conLin, ...) UseMethod("recalc") Variogram <- ## calculates variogram of a vector according to a distance matrix function(object, distance, ...) UseMethod("Variogram") nlme/R/VarCorr.R0000644000176200001440000001111013210262210013066 0ustar liggesusers### Extract variance components of lme models. ### ### Copyright 2007-2017 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of the GNU General Public License as published by ### the Free Software Foundation; either version 2 of the License, or ### (at your option) any later version. ### ### This program is distributed in the hope that it will be useful, ### but WITHOUT ANY WARRANTY; without even the implied warranty of ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ### GNU General Public License for more details. ### ### A copy of the GNU General Public License is available at ### http://www.r-project.org/Licenses/ if(getRversion() < "3.2.0") { lengths <- function (x, use.names = TRUE) vapply(x, length, 1L, USE.NAMES = use.names) } VarCorr <- function(x, sigma = 1, ...) UseMethod("VarCorr") VarCorr.lme <- function(x, sigma = x$sigma, rdig = 3, ...) { m <- lapply(rev(x$modelStruct$reStruct), VarCorr, sigma = sigma, rdig = rdig, ...) Q <- length( m ) if (Q <= 1) { nm <- names(m) m <- m[[1]] mm <- rbind(m, Residual = c(Variance = sigma^2, StdDev = sigma)) v <- array( "", dim(mm), dimnames(mm) ) v[, 1] <- format( mm[, 1] ) v[, 2] <- format( mm[, 2] ) if (!is.null(corr <- attr(m, "corr"))) { v <- cbind(v, rbind(corr, Residual = rep("", ncol(corr)))) } return(structure(v, title = paste(nm, "=", attr( m, "formStr" )), class = "VarCorr.lme")) } ## multiple nested levels case: Q >= 2 nrows <- vapply(m, nrow, 1L) trows <- 1L + c(0L, cumsum(1L + nrows))[1:Q] bd <- rbind(do.call(rbind, m), c(Variance = sigma^2, StdDev = sigma) ) corr <- lapply( m, attr, which = "corr") colnames <- colnames(bd) maxCorr <- 0L if (!all( Nulls <- vapply(corr, is.null, NA) )) { maxCorr <- max(vapply(corr[!Nulls], ncol, 1L)) colnames <- c( colnames, "Corr", rep("", maxCorr - 1L) ) } v <- array("", c(sum(nrows) + Q + 1L, 2L + maxCorr), list(NULL, colnames)) v[-trows, 1] <- format(bd[, 1]) v[-trows, 2] <- format(bd[, 2]) v[trows, 1] <- sapply( m, attr, which = "formStr" ) rownames <- rep("", sum(nrows) + Q) rownames[trows] <- paste( names( m ), "=" ) rr <- 1L for (i in seq_along( m ) ) { ri <- rr + seq_len(nrows[i]) rownames[ri] <- rownames(m[[i]]) if (!is.null(corr[[i]])) { v[ri, 2L + (1:ncol(corr[[i]])) ] <- corr[[i]] } rr <- rr + nrows[i] + 1L } rownames(v) <- c(rownames, "Residual") class(v) <- "VarCorr.lme" v } print.VarCorr.lme <- function(x, ...) { if(hasT <- !is.null(tit <- attr(x, "title"))) { cat(tit, "\n") xo <- x ## print(x, *) must return 'x' unchanged attr(x, "title") <- NULL } print(unclass(x), ..., quote = FALSE) invisible(if(hasT) xo else x) } VarCorr.pdMat <- function( x, sigma = 1., rdig = 3, ...) { sx <- summary( x ) sd <- sigma * attr( sx, "stdDev" ) var <- sd^2 p <- dim(sx)[2] v <- array(c(var, sd), c(p, 2), list( names(sd), c( "Variance", "StdDev" ))) # attr(v, "formStr") <- deparse(as.call(list(as.name(class(x)[[1]]), # as.vector(attr(x, "formula"))))) # ## puts in an extra blank. We'll do it the clunky way instead attr(v, "formStr") <- if ( inherits( attr(x, "formula"), "listForm" ) ) {# an nlme'ism paste0(class(x)[[1]], "(list(", paste( sapply(attr(x, "formula"), function(x) as.character(deparse(x))), collapse=","), "))") } else { paste0(class(x)[[1]], "(", substring(deparse(attr(x, "formula")), 2), ")") } if (p >= 2L && !attr(sx, "noCorrelation")) { ll <- lower.tri(sx) sx[ll] <- format(round(sx[ll], digits = rdig)) sx[!ll] <- "" if (!is.null(colnames(sx))) { sx[1,] <- abbreviate(colnames(sx), minlength = rdig + 3) } dimnames(sx) <- list(names(sd), c("Corr", rep("", p - 1L))) attr(v, "corr") <- sx[, -p, drop = FALSE ] } v } VarCorr.pdBlocked <- function( x, sigma = 1., rdig = 3, ...) { m <- lapply(X=x, FUN=VarCorr, sigma = sigma, rdig = rdig, ...) bd <- do.call(rbind, m) ## the following code does not appear to be used at all ## corr <- lapply( m, attr, which = "corr") ## maxCorr <- 0 ## if ( !all( Nulls <- sapply( corr, is.null ) ) ) { ## maxCorr <- max( sapply( corr[!Nulls], ncol ) ) ## } attr(bd, "formStr") <- paste( sapply( m, attr, which = "formStr" ), collapse = ", ") bd } nlme/R/VarCov.R0000644000176200001440000001100712672266072012742 0ustar liggesusers## Contributed by Mary Lindstrom # Copyright 2007-2016 The R Core team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # getVarCov <- function(obj, ...) UseMethod("getVarCov") getVarCov.lme <- function(obj, individuals, type= c("random.effects","conditional","marginal"), ...) { type <- match.arg(type) if(any("nlme" == class(obj))) stop("not implemented for \"nlme\" objects") if(length(obj$group) > 1) stop("not implemented for multiple levels of nesting") sigma <- obj$sigma D <- as.matrix(obj$modelStruct$reStruct[[1]]) * sigma^2 if (type=="random.effects") { result <- D } else { result <- list() groups <- obj$groups[[1]] ugroups <- unique(groups) if (missing(individuals)) individuals <- as.matrix(ugroups)[1,] if (is.numeric(individuals)) individuals <- ugroups[individuals] for (individ in individuals) { indx <- which(individ == ugroups) if (!length(indx)) stop(gettextf("individual %s was not used in the fit", sQuote(individ)), domain = NA) if (is.na(indx)) stop(gettextf("individual %s was not used in the fit", sQuote(individ)), domain = NA) ind <- groups == individ if(!is.null(obj$modelStruct$corStruct)) { V <- corMatrix(obj$modelStruct$corStruct)[[as.character(individ)]] } else V <- diag(sum(ind)) if(!is.null(obj$modelStruct$varStruct)) sds <- 1/varWeights(obj$modelStruct$varStruct)[ind] else sds <- rep(1, sum(ind)) sds <- obj$sigma * sds cond.var <- t(V * sds) * sds dimnames(cond.var) <- list(1:nrow(cond.var),1:ncol(cond.var)) if (type=="conditional") result[[as.character(individ)]] <- cond.var else { Z <- model.matrix(obj$modelStruct$reStruc, getData(obj))[ind, , drop = FALSE] result[[as.character(individ)]] <- cond.var + Z %*% D %*% t(Z) } } } class(result) <- c(type,"VarCov") attr(result,"group.levels") <- names(obj$groups) result } getVarCov.gls <- function(obj, individual = 1, ...) { S <- corMatrix(obj$modelStruct$corStruct)[[individual]] if (!is.null( obj$modelStruct$varStruct)) { ind <- obj$groups==individual vw <- 1/varWeights(obj$modelStruct$varStruct)[ind] } else vw <- rep(1,nrow(S)) vars <- (obj$sigma * vw)^2 result <- t(S * sqrt(vars))*sqrt(vars) class(result) <- c("marginal","VarCov") attr(result,"group.levels") <- names(obj$groups) result } print.VarCov <- function(x, corr = FALSE, stdevs = TRUE, digits = 5, ...) { pvc <- function(x, type, corr, stdevs, digits) { cat(c("Random effects","Conditional", "Marginal")[match(type, c("random.effects","conditional", "marginal"))], " ", sep = "") x <- as.matrix(x) class(x) <- NULL attr(x,"group.levels") <- NULL if (corr) { cat("correlation matrix\n") sds <- sqrt(diag(x)) print(signif(t(x/sds)/sds,digits)) } else { cat("variance covariance matrix\n") print(signif(x,digits)) if(stdevs) sds <- sqrt(diag(x)) } if (stdevs) cat(" Standard Deviations:",signif(sds,digits),"\n") } if (!is.list(x)) pvc(x,class(x)[1],corr,stdevs,digits) else { for (nm in names(x)) { cat(attr(x,"group.levels"),nm,"\n") pvc(x[[nm]],class(x)[1],corr,stdevs,digits) } } invisible(x) } nlme/R/simulate.R0000644000176200001440000004434612672266072013401 0ustar liggesusers### Fit a general linear mixed effects model ### ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates ### Copyright 2006-2015 The R Core team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # createConLin <- function(fixed, data = sys.frame(sys.parent()), random = pdSymm(eval(as.call(fixed[-2]))), ...) { if(!inherits(fixed, "formula") || length(fixed) != 3) stop("\nfixed-effects model must be a formula of the form \"resp ~ pred\"") REML <- FALSE reSt <- reStruct(random, REML = REML, data = NULL) groups <- getGroupsFormula(reSt) if(is.null(groups)) { if(inherits(data, "groupedData")) { groups <- getGroupsFormula(data) groupsL <- rev(getGroupsFormula(data, asList = TRUE)) Q <- length(groupsL) if(length(reSt) != Q) { # may need to repeat reSt if(length(reSt) != 1) { stop("incompatible lengths for 'random' and grouping factors") } auxForm <- eval(parse(text = paste("~", deparse(formula(random)[[2]]), "|", deparse(groups[[2]])))) reSt <- reStruct(auxForm, REML = REML, data = NULL) } else { names(reSt) <- names(groupsL) } } else { stop("'data' must inherit from \"groupedData\" class if 'random' does not define groups") } } ## create an lme structure containing the random effects model lmeSt <- lmeStruct(reStruct = reSt) ## extract a data frame with enough information to evaluate ## fixed, groups, reStruct, corStruct, and varStruct dataMix <- model.frame(formula = asOneFormula(formula(lmeSt), fixed, groups), data = data, drop.unused.levels = TRUE) origOrder <- row.names(dataMix) # preserve the original order ## sort the model.frame by groups and get the matrices and parameters ## used in the estimation procedures grps <- getGroups(dataMix, eval(parse(text = paste("~1", deparse(groups[[2]]), sep = "|")))) ## ordering data by groups if(inherits(grps, "factor")) { # single level ##"order" treats a single named argument peculiarly so must split this off ord <- order(grps) grps <- data.frame(grps) row.names(grps) <- origOrder names(grps) <- as.character(deparse((groups[[2]]))) } else { ord <- do.call(order, grps) ## making group levels unique for(i in 2:ncol(grps)) { grps[, i] <- as.factor(paste(as.character(grps[, i - 1]), as.character(grps[, i ]), sep = "/")) } } grps <- grps[ord, , drop = FALSE] dataMix <- dataMix[ord, , drop = FALSE] ## revOrder <- match(origOrder, row.names(dataMix)) # putting in orig. order ## obtaining basic model matrices N <- nrow(grps) Z <- model.matrix(reSt, dataMix) ncols <- attr(Z, "ncols") Names(lmeSt$reStruct) <- attr(Z, "nams") ## keeping the contrasts for later use in predict contr <- attr(Z, "contr") X <- model.frame(fixed, dataMix) auxContr <- lapply(X, function(el) if(inherits(el, "factor")) contrasts(el)) contr <- c(contr, auxContr[is.na(match(names(auxContr), names(contr)))]) contr <- contr[!vapply(contr, is.null, NA)] X <- model.matrix(fixed, X) y <- eval(fixed[[2]], dataMix) ncols <- c(ncols, dim(X)[2], 1) ## Q <- ncol(grps) ## creating the condensed linear model : list(Xy = array(c(Z, X, y), c(N, sum(ncols)), list(row.names(dataMix), c(colnames(Z), colnames(X), deparse(fixed[[2]])))), dims = MEdims(grps, ncols), logLik = 0, sigma = 0) # <- no "fixed Sigma" yet } simulate.lme <- function(object, nsim = 1, seed = as.integer(runif(1, 0, .Machine$integer.max)), m2, method = c("REML", "ML"), niterEM = c(40, 200), useGen, ...) { ## object is a list of arguments to lme, or an lme object from which the ## call is extracted, to define the null model ## m2 is an option list of arguments to lme to define the feared model if (inherits(nsim, "lm") || inherits(nsim, "lme")) stop("order of arguments in 'simulate.lme' has changed to conform with generic in R-2.2.0", domain = NA) ### FIXME? if(!ALT) behave like a regular simulate() method --> return 'base2' (see below) getResults1 <- function(conLin, nIter, pdClass, REML, ssq, p, pp1) { unlist(.C(mixed_combined, as.double(conLin$Xy), as.integer(unlist(conLin$dims)), double(ssq), as.integer(nIter), as.integer(pdClass), as.integer(REML), logLik = double(1), R0 = double(pp1), lRSS = double(1), info = integer(1), sigma = as.double(conLin$sigma))[c("info", "logLik")]) } getResults2 <- function(conLin, reSt, REML, control) { lmeSt <- lmeStruct(reStruct = reStruct(reSt, REML = REML)) attr(lmeSt, "conLin") <- conLin lmeSt <- Initialize(lmeSt, data = NULL, groups = NULL, control = control) attr(lmeSt, "conLin") <- MEdecomp(attr(lmeSt, "conLin")) aMs <- nlminb(c(coef(lmeSt)), function(lmePars) -logLik(lmeSt, lmePars), control = list(iter.max = control$msMaxIter, eval.max = control$msMaxEval, trace = control$msVerbose)) c(info = aMs$flags[1], logLik = -aMs$value) } if(!exists(".Random.seed", envir = .GlobalEnv)) runif(1) # initialize the RNG if necessary RNGstate <- get(".Random.seed", envir = .GlobalEnv) on.exit(assign(".Random.seed", RNGstate, envir = .GlobalEnv)) set.seed(seed) if (inherits(object, "lme")) { # given as an lme object fit1 <- object object <- as.list(object$call[-1]) } else { object <- as.list(match.call(lme, substitute(object))[ -1 ]) fit1 <- do.call(lme, object) } if (length(fit1$modelStruct) > 1) stop("models with \"corStruct\" and/or \"varFunc\" objects not allowed") reSt1 <- fit1$modelStruct$reStruct condL1 <- do.call(createConLin, object) pdClass1 <- vapply(reSt1, data.class, "") pdClass1 <- match(pdClass1, c("pdSymm", "pdDiag", "pdIdent", "pdCompSymm", "pdLogChol"), 0) - 1 control1 <- lmeControl() if (!is.null(object$control)) { control1[names(object$control)] <- object$control } control1$niterEM <- niterEM[1] sig <- fit1$sigma DeltaInv <- pdMatrix(reSt1, factor = TRUE) for(i in names(DeltaInv)) { DeltaInv[[i]] <- sig * DeltaInv[[i]] } if (missing(useGen)) { useGen <- any(pdClass1 == -1) } nullD <- condL1$dims N <- nullD$N Q <- nullD$Q p1 <- nullD$ncol[Q + 1] pp11 <- p1 * (p1 + 1) ycol1 <- sum(nullD$ncol) qvec <- nullD$qvec[1:Q] ssq1 <- sum(qvec^2) csq1 <- cumsum(c(1, qvec[ - Q])) csq2 <- cumsum(qvec) ngrp <- nullD$ngrps ## base for creating response base <- condL1$Xy[, ycol1 - (nullD$ncol[Q + 1]:1), drop = FALSE] %*% fixef(fit1) ind <- lapply(1:Q, function(i) rep(1:ngrp[i], nullD$ZXlen[[i]])) if (ML <- !is.na(match("ML", method))) nML <- array(0, c(nsim, 2), list(1:nsim, c("info", "logLik"))) if (REML <- !is.na(match("REML", method))) nREML <- array(0, c(nsim, 2), list(1:nsim, c("info", "logLik"))) if ((ALT <- !missing(m2))) { if (inherits(m2, "lme")) { # given as an lme object fit2 <- m2 m2 <- as.list(m2$call[-1]) } else { m2 <- as.list(match.call(lme, substitute(m2))[ -1 ]) if (is.null(m2$random)) { m2$random <- asOneSidedFormula(object$fixed[-2]) } aux <- object aux[names(m2)] <- m2 m2 <- aux fit2 <- do.call(lme, m2) } if (length(fit2$modelStruct) > 1) { stop("models with \"corStruct\" and/or \"varFunc\" objects not allowed") } condL2 <- do.call(createConLin, m2) reSt2 <- fit2$modelStruct$reStruct control2 <- lmeControl() if (!is.null(m2$control)) { control2[names(m2$control)] <- m2$control } control2$niterEM <- niterEM[2] pdClass2 <- vapply(fit2$modelStruct$reStruct, data.class, "") pdClass2 <- match(pdClass2, c("pdSymm", "pdDiag", "pdIdent", "pdCompSymm", "pdLogChol"), 0) - 1 useGen <- useGen || any(pdClass2 == -1) altD <- condL2$dims ssq2 <- sum((altD$qvec[1:altD$Q])^2) p2 <- altD$ncol[altD$Q + 1] pp12 <- p2 * (p2 + 1) ycol2 <- sum(altD$ncol) if (ML) aML <- nML if (REML) aREML <- nREML } for(i in 1:nsim) { base2 <- base + rnorm(N, sd = sig) ## = X beta + eps ## now add 'Z b' as Q different terms \sum_{j=1}^Q Z_j b_j : for(j in 1:Q) { base2 <- base2 + ((array(rnorm(ngrp[j] * qvec[j]), c(ngrp[j], qvec[j]), list(1:ngrp[j], NULL)) %*% DeltaInv[[j]])[ind[[j]], , drop = FALSE] * condL1$Xy[,csq1[j]:csq2[j], drop = FALSE]) %*% rep(1, qvec[j]) } condL1$Xy[, ycol1] <- base2 if (REML) { nREML[i,] <- if (useGen) getResults2(condL1, reSt1, TRUE, control1) else getResults1(condL1, niterEM[1], pdClass1, TRUE, ssq1, p1, pp11) } if (ML) { nML[i,] <- if (useGen) getResults2(condL1, reSt1, FALSE, control1) else getResults1(condL1, niterEM[1], pdClass1, FALSE, ssq1, p1, pp11) } if (ALT) { condL2$Xy[, ycol2] <- base2 if (REML) { aREML[i,] <- if (useGen) getResults2(condL2, reSt2, TRUE, control2) else getResults1(condL2, niterEM[2], pdClass2, TRUE, ssq2, p2, pp12) } if (ML) { aML[i,] <- if (useGen) getResults2(condL2, reSt2, FALSE, control2) else getResults1(condL2, niterEM[2], pdClass2, FALSE, ssq2, p2, pp12) } } } ## for i = 1,..,nsim v.null <- v.alt <- list() if (ML) { nML[, "logLik"] <- nML[, "logLik"] + N * (log(N) - (1 + log(2*pi)))/2 v.null$ML <- nML if (ALT) { aML[, "logLik"] <- aML[, "logLik"] + N * (log(N) - (1 + log(2*pi)))/2 v.alt$ML <- aML } } if (REML) { nREML[, "logLik"] <- nREML[, "logLik"] + (N - p1) * (log(N - p1) - (1 + log(2*pi)))/2 v.null$REML <- nREML if (ALT) { aREML[, "logLik"] <- aREML[, "logLik"] + (N - p2) * (log(N - p2) - (1 + log(2*pi)))/2 v.alt$REML <- aREML } } df <- p1 + length(coef(reSt1)) + 1 if (ALT) df <- abs(df - (p2 + length(coef(reSt2)) + 1)) ## return : structure(if(ALT && (ML || REML)) list(null = v.null, alt = v.alt) else list(null = v.null), class = "simulate.lme", call = match.call(), seed = seed, df = df, useGen = useGen) } print.simulate.lme <- function(x, ...) { ox <- x if (is.null(attr(x, "useGen"))) { # from simulate.lme attr(x$null, "dims") <- NULL if (!is.null(x$alt)) { attr(x$alt, "dims") <- NULL } } else { attr(x, "useGen") <- attr(x, "df") <- NULL } attr(x, "seed") <- attr(x, "call") <- NULL NextMethod() invisible(ox) } plot.simulate.lme <- function(x, form = y ~ x | df * method, df = attr(x, "df"), weights, xlab = "Empirical p-value", ylab = "Nominal p-value", xlim = c(0.037, 0.963), ylim = c(0.037, 0.963), aspect = 1, strip = function(...) strip.default(..., style = 1), ...) { if (is.null(df)) stop("no degrees of freedom specified") ML <- !is.null(x$null$ML) if(ML) { if (is.null(x$alt$ML)) stop("plot method only implemented for comparing models") okML <- x$null$ML[, "info"] < 8 & x$alt$ML[, "info"] < 8 } REML <- !is.null(x$null$REML) if(REML) { if (is.null(x$alt$REML)) stop("plot method only implemented for comparing models") okREML <- x$null$REML[, "info"] < 8 & x$alt$REML[, "info"] < 8 } if ((ldf <- length(df)) > 1) { df <- sort(unique(df)) if (missing(weights)) { weights <- rep.int(1/ldf, ldf) } else { if (!identical(weights,FALSE) && length(weights) != ldf) stop("degrees of freedom and weights must have the same length") } } else { weights <- FALSE } useWgts <- (length(weights) != 1) if (any(df < 0)) { stop("negative degrees of freedom not allowed") } else { if ((ldf == 1) && (df == 0)) { stop("more than one degree of freedom is needed when one them is zero.") } } if (ML) { MLstat <- rev(sort(2 * pmax(0, x$alt$ML[okML, "logLik"] - x$null$ML[okML,"logLik"]))) MLy <- lapply(df, function(df, x) { if (df > 0) pchisq(x, df, lower.tail=FALSE) else 1*(x == 0) }, x = MLstat) dfC <- paste("df",df,sep="=") if (useWgts) { # has weights if (ldf == 2) { # will interpolate MLy <- c(MLy[[1]], weights[1] * MLy[[1]] + weights[2] * MLy[[2]], MLy[[2]]) MLdf <- rep(c(dfC[1], paste("Mix(",df[1],",",df[2],")",sep=""), dfC[2]), rep(length(MLstat), ldf + 1)) } else { aux <- weights[1] * MLy[[1]] auxNam <- paste("Mix(",df[1],sep="") for(i in 2:ldf) { aux <- aux + weights[i] * MLy[[i]] auxNam <- paste(auxNam, ",", df[i],sep="") } auxNam <- paste(auxNam, ")",sep="") MLy <- c(unlist(MLy), aux) MLdf <- rep(c(dfC, auxNam), rep(length(MLstat), ldf + 1)) } MLx <- rep((seq_along(MLstat) - 0.5)/length(MLstat), ldf + 1) } else { MLy <- unlist(MLy) MLdf <- rep(dfC, rep(length(MLstat), ldf)) MLx <- rep((seq_along(MLstat) - 0.5)/length(MLstat), ldf) } auxInd <- MLdf != "df=0" meth <- rep("ML", length(MLy)) Mdf <- MLdf } else { MLy <- MLdf <- MLx <- auxInd <- meth <- Mdf <- NULL } if (REML) { REMLstat <- rev(sort(2 * pmax(0, x$alt$REML[okREML, "logLik"] - x$null$REML[okREML, "logLik"]))) REMLy <- lapply(df, function(df, x) { if (df > 0) { pchisq(x, df, lower.tail = FALSE) } else { 1*(x == 0) } }, x = REMLstat) dfC <- paste("df",df,sep="=") if (useWgts) { # has weights if (ldf == 2) { # will interpolate REMLy <- c(REMLy[[1]], weights[1] * REMLy[[1]] + weights[2] * REMLy[[2]], REMLy[[2]]) REMLdf <- rep(c(dfC[1], paste("Mix(",df[1],",",df[2],")",sep=""), dfC[2]), rep(length(REMLstat), ldf + 1)) } else { aux <- weights[1] * REMLy[[1]] auxNam <- paste("Mix(",df[1],sep="") for(i in 2:ldf) { aux <- aux + weights[i] * REMLy[[i]] auxNam <- paste(auxNam, ",", df[i],sep="") } auxNam <- paste(auxNam, ")",sep="") REMLy <- c(unlist(REMLy), aux) REMLdf <- rep(c(dfC, auxNam), rep(length(REMLstat), ldf + 1)) } REMLx <- rep((seq_along(REMLstat) - 0.5)/length(REMLstat), ldf + 1) } else { REMLy <- unlist(REMLy) REMLdf <- rep(dfC, rep(length(REMLstat), ldf)) REMLx <- rep((seq_along(REMLstat) - 0.5)/length(REMLstat), ldf) } auxInd <- c(auxInd, REMLdf != "df=0") meth <- c(meth, rep("REML", length(REMLy))) Mdf <- c(Mdf, REMLdf) } else { REMLy <- REMLdf <- REMLx <- NULL } meth <- meth[auxInd] Mdf <- Mdf[auxInd] Mdf <- ordered(Mdf, levels = unique(Mdf)) frm <- data.frame(x = c(MLx, REMLx)[auxInd], y = c(MLy, REMLy)[auxInd], df = Mdf, method = meth) ## names(frm$x) <- rep(1, nrow(frm)) ## if (df[1] == 0) { ## names(frm$x)[substring(frm$df,1,3) == "Mix"] <- 1 - weights[1] ## if (missing(ylim)) { ## ylim <- c(0.0384, 1) ## } ## } xyplot(form, data = frm, type = c('g', 'l'), ## panel = function(x, y, ...) { ## panel.grid() ## panel.xyplot(x, y, type = "l", ...) ## if ((dfType <- as.double(names(x)[1])) == 1) { ## panel.abline( 0, as.double(names(x)[1]), lty = 2 ) ## } else { ## panel.xyplot(c(0,dfType,dfType,1), c(0,dfType,1,1), ## type="l", lty = 2, col = 1) ## } ## }, strip = strip, xlab = xlab, ylab = ylab, aspect = aspect, xlim = xlim, ylim = ylim, ...) } nlme/R/nlme.R0000644000176200001440000014660513336503465012510 0ustar liggesusers### Fit a general nonlinear mixed effects model ### ### Copyright 2006-2018 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of the GNU General Public License as published by ### the Free Software Foundation; either version 2 of the License, or ### (at your option) any later version. ### ### This program is distributed in the hope that it will be useful, ### but WITHOUT ANY WARRANTY; without even the implied warranty of ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ### GNU General Public License for more details. ### ### A copy of the GNU General Public License is available at ### http://www.r-project.org/Licenses/ nlme <- function(model, data = sys.frame(sys.parent()), fixed, random = fixed, groups, start, correlation = NULL, weights = NULL, subset, method = c("ML", "REML"), na.action = na.fail, naPattern, control = list(), verbose= FALSE) { UseMethod("nlme") } nlme.nlsList <- function(model, data = sys.frame(sys.parent()), fixed, random = fixed, groups, start, correlation = NULL, weights = NULL, subset, method = c("ML", "REML"), na.action = na.fail, naPattern, control = list(), verbose= FALSE) { ## control parameters controlvals <- nlmeControl() controlvals[names(control)] <- control thisCall <- as.list(match.call())[-1] ## checking the use of arguments defined within the function if (any(!is.na(match(names(thisCall), c("fixed", "data", "start"))))) { warning("'nlme.nlsList' will redefine 'fixed', 'data', and 'start'") } method <- match.arg(method) REML <- method == "REML" ## add model, data, and optionally groups from the call that created model last.call <- as.list(attr(model, "call"))[-1] last.call$control <- NULL last.call$pool <- NULL thisCall[names(last.call)] <- last.call thisModel <- last.call[["model"]] thisCall[["model"]] <- eval(parse(text=paste( deparse (getResponseFormula (thisModel)[[2]]), c_deparse(getCovariateFormula(thisModel)[[2]]),sep="~"))) ## create "fixed" and "start" cf <- na.omit(coef(model)) start <- list(fixed = unlist(lapply(cf, median, na.rm = TRUE))) pnames <- names(start$fixed) <- names(cf) thisCall[["fixed"]] <- lapply(as.list(pnames), function(el) eval(parse(text = paste(el, 1, sep = "~")))) if (missing(random)) { random <- thisCall[["fixed"]] } reSt <- reStruct(random, data = NULL) if (missing(groups)) { thisCall[["groups"]] <- groups <- getGroupsFormula(model) } if (length(reSt) > 1 || length(groups[[2]]) > 1) { stop("can only fit \"nlsList\" objects with single grouping variable") } ranForm <- formula(reSt)[[1]] if (!is.list(ranForm)) { ranForm <- list(ranForm) } mData <- thisCall[["data"]] if (is.null(mData)) { # will try to construct allV <- unique(unlist(lapply(ranForm, function(el) all.vars(el[[3]])))) if (length(allV) > 0) { alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(as.list(quote(data.frame)), alist) mode(alist) <- "call" mData <- eval(alist, sys.parent(1)) } } else if (mode(mData) == "name" || mode(mData) == "call") { mData <- eval(mData) } reSt <- reStruct(random, REML = REML, data = mData) names(reSt) <- deparse(groups[[2]]) ## convert list of "name" objects to "character" vector rnames <- sapply(lapply(ranForm, `[[`, 2L), deparse) ## if the random effects are a subset of the coefficients, ## construct initial estimates for their var-cov matrix if (all(match(rnames, pnames, 0))) { madRes <- mad(resid(model), na.rm = TRUE) madRan <- unlist(lapply(cf, mad, na.rm = TRUE)) madRan <- madRan[rnames] if (isInitialized(reSt)) { warning("initial value for 'reStruct' overwritten in 'nlme.nlsList'") } matrix(reSt) <- diag((madRan/madRes)^2, ncol = length(rnames)) } thisCall[["start"]] <- start thisCall[["random"]] <- reSt val <- do.call(nlme.formula, thisCall) val$origCall <- match.call() val } nlme.formula <- function(model, data = sys.frame(sys.parent()), fixed, random, groups, start, correlation = NULL, weights = NULL, subset, method = c("ML", "REML"), na.action = na.fail, naPattern, control = list(), verbose= FALSE) { ## This is the method that actually does the fitting finiteDiffGrad <- function(model, data, pars) { dframe <- data.frame(data, pars) base <- eval(model, dframe) nm <- colnames(pars) grad <- array(base, c(length(base), length(nm)), list(NULL, nm)) ssize <- sqrt(.Machine$double.eps) for (i in nm) { diff <- pp <- pars[ , i] diff[pp == 0] <- ssize diff[pp != 0] <- pp[pp != 0] * ssize dframe[[i]] <- pp + diff grad[ , i] <- (base - eval(model, dframe))/diff dframe[[i]] <- pp } grad } ## keeping the call Call <- match.call() ## control parameters controlvals <- nlmeControl() if (!missing(control)) { controlvals[names(control)] <- control } ## ## checking arguments ## if (!inherits(model, "formula")) stop("'model' must be a formula") if (length(model)!=3) stop("model formula must be of the form \"resp ~ pred\"") method <- match.arg(method) REML <- method == "REML" if (missing(random)) { random <- fixed } reSt <- reStruct(random, REML = REML, data = NULL) if (missing(groups)) { groups <- getGroupsFormula(reSt) } if (is.null(groups)) { if (inherits(data, "groupedData")) { groups <- getGroupsFormula(data) namGrp <- rev(names(getGroupsFormula(data, asList = TRUE))) Q <- length(namGrp) if (length(reSt) != Q) { # may need to repeat reSt if (length(reSt) != 1) stop("incompatible lengths for 'random' and grouping factors") randL <- vector("list", Q) names(randL) <- rev(namGrp) for(i in 1:Q) randL[[i]] <- random reSt <- reStruct(randL, REML = REML, data = NULL) } } else { ## will assume single group groups <- ~ 1 names(reSt) <- namGrp <- "1" } } else { g.exp <- eval(parse(text = paste0("~1 |", deparse(groups[[2]])))) namGrp <- rev(names(getGroupsFormula(g.exp, asList = TRUE))) } names(reSt) <- namGrp ## ## checking if self-starting formula is given ## if (missing(start) && !is.null(attr(eval(model[[3]][[1]]), "initial"))) { nlmeCall <- Call nlsLCall <- nlmeCall[c("","model","data","groups")] nlsLCall[[1]] <- quote(nlme::nlsList) names(nlsLCall)[2] <- "model" nm <- names(nlmeCall) for(i in c("fixed", "data", "groups", "start")) if(i %in% nm) nlmeCall[[i]] <- NULL nlmeCall[[1]] <- quote(nlme::nlme.nlsList) ## checking if "data" is not equal to sys.frame(sys.parent()) if (is.null(dim(data))) { stop("'data' must be given explicitly to use 'nlsList'") } nlsLObj <- eval(nlsLCall) nlsLObj # -NOTE(codetools) nlmeCall[["model"]] <- quote(nlsLObj) nlmeCall <- as.call(nlmeCall) val <- eval(nlmeCall) val$origCall <- NULL return(val) } if (is.numeric(start)) { # assume it is the fixed effects start <- list(fixed = start) } nlmeModel <- call("-", model[[2]], model[[3]]) ## ## save writing list(...) when only one element ## if (!is.list(fixed)) fixed <- list(fixed) fixed <- do.call(c, lapply(fixed, function(fix.i) { if (is.name(fix.i[[2]])) list(fix.i) else ## multiple parameters on left hand side eval(parse(text = paste0("list(", paste(paste(all.vars(fix.i[[2]]), deparse (fix.i[[3]]), sep = "~"), collapse = ","), ")"))) })) fnames <- lapply(fixed, function(fix.i) { this <- eval(fix.i) if (!inherits(this, "formula")) stop ("'fixed' must be a formula or list of formulae") if (length(this) != 3) stop ("formulae in 'fixed' must be of the form \"parameter ~ expr\"") if (!is.name(this[[2]])) stop ("formulae in 'fixed' must be of the form \"parameter ~ expr\"") as.character(this[[2]]) }) names(fixed) <- fnames ranForm <- formula(reSt) # random effects formula(s) Q <- length(ranForm) # number of groups names(ranForm) <- namGrp rnames <- vector("list", Q) names(rnames) <- namGrp for(i in 1:Q) { rnames[[i]] <- character(length(ranForm[[i]])) for (j in seq_along(ranForm[[i]])) { this <- eval(ranForm[[i]][[j]]) if (!inherits(this, "formula")) stop ("'random' must be a formula or list of formulae") if (length(this) != 3) stop ("formulae in 'random' must be of the form \"parameter ~ expr\"") if (!is.name(this[[2]])) stop ("formulae in 'random' must be of the form \"parameter ~ expr\"") rnames[[i]][j] <- deparse(this[[2]]) } names(ranForm[[i]]) <- rnames[[i]] } ## all parameter names pnames <- unique(c(fnames, unlist(rnames))) ## ## If data is a pframe, copy the parameters in the frame to frame 1 ## Doesn't exist in R ## if (inherits(data, "pframe")) { ## pp <- parameters(data) ## for (i in names(pp)) { ## assign(i, pp[[i]]) ## } ## attr(data,"parameters") <- NULL ## class(data) <- "data.frame" ## } ## check if corStruct is present and assign groups to its formula, ## if necessary if (!is.null(correlation)) { if(!is.null(corGrpsForm <- getGroupsFormula(correlation, asList = TRUE))) { corGrpsForm <- unlist(lapply(corGrpsForm, function(el) deparse(el[[2]]))) corQ <- length(corGrpsForm) lmeGrpsForm <- unlist(lapply(splitFormula(groups), function(el) deparse(el[[2]]))) lmeQ <- length(lmeGrpsForm) if (corQ <= lmeQ) { if (any(corGrpsForm != lmeGrpsForm[1:corQ])) { stop("incompatible formulas for groups in \"random\" and \"correlation\"") } if (corQ < lmeQ) { warning("cannot use smaller level of grouping for \"correlation\" than for \"random\". Replacing the former with the latter.") frm <- paste("~", c_deparse(getCovariateFormula(formula(correlation))[[2]]), "|", deparse(groups[[2]])) attr(correlation, "formula") <- eval(parse(text = frm)) } } else { if (any(lmeGrpsForm != corGrpsForm[1:lmeQ])) { stop("incompatible formulas for groups in \"random\" and \"correlation\"") } } } else { ## using the same grouping as in random frm <- paste("~", c_deparse(getCovariateFormula(formula(correlation))[[2]]), "|", deparse(groups[[2]])) attr(correlation, "formula") <- eval(parse(text = frm)) corQ <- lmeQ <- 1 } } else { corQ <- lmeQ <- 1 } ## create an nlme structure containing the random effects model and plug-ins nlmeSt <- nlmeStruct(reStruct = reSt, corStruct = correlation, varStruct = varFunc(weights)) ## extract a data frame with enough information to evaluate ## form, fixed, random, groups, correlation, and weights mfArgs <- list(formula = asOneFormula(formula(nlmeSt), model, fixed, groups, omit = c(pnames, "pi")), data = data, na.action = na.action) if (!missing(subset)) { mfArgs[["subset"]] <- asOneSidedFormula(Call[["subset"]])[[2]] } mfArgs$drop.unused.levels <- TRUE dataMix <- do.call(model.frame, mfArgs) origOrder <- row.names(dataMix) # preserve the original order ## ## Evaluating the groups expression ## grps <- getGroups(dataMix, eval(parse(text = paste("~1", deparse(groups[[2]]), sep = "|")))) N <- dim(dataMix)[1] # number of observations ## ## evaluating the naPattern expression, if any ## if (missing(naPattern)) naPat <- rep(TRUE, N) else naPat <- as.logical(eval(asOneSidedFormula(naPattern)[[2]], dataMix)) origOrderShrunk <- origOrder[naPat] ## ordering data by groups if (inherits(grps, "factor")) { # single level ord <- order(grps) #"order" treats a single named argument peculiarly grps <- data.frame(grps) row.names(grps) <- origOrder names(grps) <- as.character(deparse((groups[[2]]))) } else { ord <- do.call(order, grps) ## making group levels unique for(i in 2:ncol(grps)) { grps[, i] <- as.factor(paste(as.character(grps[, i-1]), as.character(grps[,i]), sep = "/")) } } if (corQ > lmeQ) { ## may have to reorder by the correlation groups ord <- do.call(order, getGroups(dataMix, getGroupsFormula(correlation))) } grps <- grps[ord, , drop = FALSE] dataMix <- dataMix[ord, ,drop = FALSE] ## revOrder <- match(origOrder, row.names(dataMix)) # putting in orig. order naPat <- naPat[ord] # ordered naPat dataMixShrunk <- dataMix[naPat, , drop=FALSE] ## ordShrunk <- ord[naPat] grpShrunk <- grps[naPat,, drop = FALSE] revOrderShrunk <- match(origOrderShrunk, row.names(dataMixShrunk)) yShrunk <- eval(model[[2]], dataMixShrunk) ## ## defining list with parameter information ## contr <- list() plist <- vector("list", length(pnames)) names(plist) <- pnames for (nm in pnames) { this <- list(fixed = !is.null(fixed[[nm]]), random = as.list(lapply(ranForm, function(el, nm) !is.null(el[[nm]]), nm = nm))) if (this[["fixed"]]) { ## Peter Dalgaard claims the next line should be this[["fixed"]][[3]][[1]] != "1" ## but the current version seems to work ok. if (fixed[[nm]][[3]] != "1") { as1F <- asOneSidedFormula(fixed[[nm]][[3]]) this[["fixed"]] <- model.matrix(as1F, model.frame(as1F, dataMix)) auxContr <- attr(this[["fixed"]], "contrasts") contr <- c(contr, auxContr[is.na(match(names(auxContr), names(contr)))]) } } if (any(unlist(this[["random"]]))) { for(i in 1:Q) { wch <- which(!is.na(match(rnames[[i]], nm))) if (length(wch) == 1) { # only one formula for nm at level i if ((rF.i <- ranForm[[i]][[nm]][[3]]) != "1") { this[["random"]][[i]] <- model.matrix(asOneSidedFormula(rF.i), model.frame(asOneSidedFormula(rF.i), dataMix)) auxContr <- attr(this[["random"]][[i]], "contrasts") contr <- c(contr, auxContr[is.na(match(names(auxContr), names(contr)))]) } } else if (length(wch) > 0) { # multiple formulas this[["random"]][[i]] <- th.ran.i <- as.list(lapply(ranForm[[i]][wch], function(el, data) { if (el[[3]] == "1") TRUE else model.matrix(asOneSidedFormula(el[[3]]), model.frame(asOneSidedFormula(el[[3]]), data)) }, data = dataMix)) for(j in seq_along(th.ran.i)) { if (is.matrix(th.ran.i[[j]])) { auxContr <- attr(th.ran.i[[j]], "contrasts") contr <- c(contr, auxContr[is.na(match(names(auxContr), names(contr)))]) } } } } } plist[[nm]] <- this } ## Ensure that all elements of are matrices contrMat <- function(nm, contr, data) { ## nm is a term in a formula, and can be a call x <- eval(parse(text=nm), data) levs <- levels(x) val <- do.call(contr[[nm]], list(n = length(levs))) rownames(val) <- levs val } nms <- names(contr)[sapply(contr, is.character)] contr[nms] <- lapply(nms, contrMat, contr = contr, data = dataMix) if (is.null(sfix <- start$fixed)) stop ("'start' must have a component called 'fixed'") ## ## Fixed effects names ## fn <- character(0) currPos <- 0 fixAssign <- list() for(nm in fnames) { if (is.logical(f <- plist[[nm]]$fixed)) { currPos <- currPos + 1 currVal <- list(currPos) if (all(unlist(lapply(plist[[nm]]$random, is.logical)))) { fn <- c(fn, nm) names(currVal) <- nm } else { aux <- paste(nm, "(Intercept)", sep=".") fn <- c(fn, aux) names(currVal) <- aux } fixAssign <- c(fixAssign, currVal) } else { currVal <- attr(f, "assign") fTerms <- terms(asOneSidedFormula(fixed[[nm]][[3]]), data=data) namTerms <- attr(fTerms, "term.labels") if (attr(fTerms, "intercept") > 0) { namTerms <- c("(Intercept)", namTerms) } namTerms <- factor(currVal, labels = namTerms) currVal <- split(order(currVal), namTerms) names(currVal) <- paste(nm, names(currVal), sep = ".") fixAssign <- c(fixAssign, lapply(currVal, function(el) el + currPos )) currPos <- currPos + length(unlist(currVal)) fn <- c(fn, paste(nm, colnames(f), sep = ".")) } } fLen <- length(fn) if (fLen == 0L || length(sfix) != fLen) stop ("starting values for the 'fixed' component are not the correct length") names(sfix) <- fn ## ## Random effects names ## rn <- wchRnames <- vector("list", Q) names(rn) <- names(wchRnames) <- namGrp for(i in 1:Q) { rn[[i]] <- character(0) uRnames <- unique(rnames[[i]]) wchRnames[[i]] <- integer(length(uRnames)) names(wchRnames[[i]]) <- uRnames for(j in seq_along(rnames[[i]])) { nm <- rnames[[i]][j] wchRnames[[i]][nm] <- wchRnames[[i]][nm] + 1 r <- plist[[nm]]$random[[i]] if (data.class(r) == "list") r <- r[[wchRnames[[i]][nm]]] if (is.logical(r)) { if (r) { rn[[i]] <- c(rn[[i]], if (is.logical(plist[[nm]]$fixed)) nm else paste(nm,"(Intercept)",sep=".")) } # else: keep rn[[i]] } else { rn[[i]] <- c(rn[[i]], paste(nm, colnames(r), sep = ".")) } } } Names(nlmeSt$reStruct) <- rn rNam <- unlist(rn) # unlisted names of random effects rlength <- lengths(rn) # number of random effects per stratum rLen <- sum(rlength) # total number of random effects pLen <- rLen + fLen # total number of parameters ncols <- c(rlength, fLen, 1) Dims <- MEdims(grpShrunk, ncols) if (max(Dims$ZXlen[[1]]) < Dims$qvec[1]) { warning(gettextf("fewer observations than random effects in all level %s groups", Q), domain = NA) } sran <- vector("list", Q) names(sran) <- namGrp if (!is.null(sran0 <- start$random)) { if (inherits(sran0, "data.frame")) { sran0 <- list(as.matrix(sran0)) } else { if (!is.list(sran0)) { if (!is.matrix(sran0)) { stop("starting values for random effects should be a list, or a matrix") } sran0 <- list(as.matrix(sran0)) } } if (is.null(namSran <- names(sran0))) { if (length(sran) != Q) { stop(gettextf("list with starting values for random effects must have names or be of length %d", Q), domain = NA) } names(sran0) <- rev(namGrp) # assume given in outer-inner order } else { if (any(noMatch <- is.na(match(namSran, namGrp)))) { stop(sprintf(ngettext(sum(noMatch), "group name not matched in starting values for random effects: %s", "group names not matched in starting values for random effects: %s"), paste(namSran[noMatch], collapse=", ")), domain = NA) } } } for(i in 1:Q) { if (is.null(sran[[i]] <- sran0[[namGrp[i]]])) { sran[[i]] <- array(0, c(rlength[i], Dims$ngrps[i]), list(rn[[i]], unique(as.character(grps[, Q-i+1])))) } else { if (!is.matrix(sran[[i]])) stop("starting values for the random components should be a list of matrices") dimsran <- dim(sran[[i]]) if (dimsran[1] != Dims$ngrps[i]) { stop(gettextf("number of rows in starting values for random component at level %s should be %d", namGrp[i], Dims$ngrps[i]), domain = NA) } if (dimsran[2] != rlength[i]) { stop(gettextf("number of columns in starting values for random component at level %s should be %d", namGrp[i], rlength[i]), domain = NA) } dnamesran <- dimnames(sran[[i]]) if (is.null(dnamesran[[1]])) { stop("starting values for random effects must include group levels") } else { levGrps <- unique(as.character(grps[, Q-i+1])) if(!all(sort(dnamesran[[1]]) == sort(levGrps))) { stop(gettextf("groups levels mismatch in 'random' and starting values for 'random' at level %s", namGrp[i]), domain = NA) } sran[[i]] <- sran[[i]][levGrps, , drop = FALSE] } if (!is.null(dnamesran[[2]])) { if(!all(sort(dnamesran[[2]]) == sort(rn[[i]]))) { ## first try to resolve it for(j in seq_len(rlength[i])) { if (is.na(match(dnamesran[[2]][j], rn[[i]]))) { if (!is.na(mDn <- match(paste(dnamesran[[2]][j], "(Intercept)", sep="."), rn[[i]]))) { dnamesran[[2]][j] <- rn[[i]][mDn] } else { if (!is.na(mDn <- match(dnamesran[[2]][j], paste(rn[[i]], "(Intercept)", sep = ".")))) { dnamesran[[2]][j] <- rn[[i]][mDn] } else { stop (gettextf("names mismatch in 'random' and starting values for 'random' at level %s", namGrp[i]), domain = NA) } } } } dimnames(sran[[i]]) <- dnamesran } sran[[i]] <- sran[[i]][, rn[[i]], drop = FALSE] } else { dimnames(sran[[i]])[[2]] <- rn[[i]] } sran[[i]] <- t(sran[[i]]) } } names(sran) <- namGrp nPars <- length(unlist(sran)) + fLen # total number of PNLS parameters ## ## defining values of constants used in calculations ## NReal <- sum(naPat) ## ## Creating the fixed and random effects maps ## fmap <- list() n1 <- 1 for(nm in fnames) { if (is.logical(f <- plist[[nm]]$fixed)) { fmap[[nm]] <- n1 n1 <- n1 + 1 } else { fmap[[nm]] <- n1:(n1+ncol(f) - 1) n1 <- n1 + ncol(f) } } rmap <- rmapRel <- vector("list", Q) names(rmap) <- names(rmapRel) <- namGrp n1 <- 1 startRan <- 0 for(i in 1:Q) { wchRnames[[i]][] <- 0 rmap[[i]] <- rmapRel[[i]] <- list() for(nm in rnames[[i]]) { wchRnames[[i]][nm] <- wchRnames[[i]][nm] + 1 r <- plist[[nm]]$random[[i]] if (data.class(r) == "list") { r <- r[[wchRnames[[i]][nm]]] } if (is.logical(r)) { val <- n1 n1 <- n1 + 1 } else { val <- n1:(n1+ncol(r) - 1) n1 <- n1 + ncol(r) } if (is.null(rmap[[i]][[nm]])) { rmap[[i]][[nm]] <- val rmapRel[[i]][[nm]] <- val - startRan } else { rmap[[i]][[nm]] <- c(rmap[[i]][[nm]], list(val)) rmapRel[[i]][[nm]] <- c(rmapRel[[i]][[nm]], list(val - startRan)) } } startRan <- startRan + ncols[i] } ## ## defining the nlFrame, i.e., nlEnv, an environment in R : ## grpsRev <- rev(lapply(grps, as.character)) bmap <- c(0, cumsum(unlist(lapply(sran, function(el) length(as.vector(el)))))) nlEnv <- list2env( list(model = nlmeModel, data = dataMix, groups = grpsRev, plist = plist, beta = as.vector(sfix), bvec = unlist(sran), b = sran, X = array(0, c(N, fLen), list(NULL, fn)), Z = array(0, c(N, rLen), list(NULL, rNam)), fmap = fmap, rmap = rmap, rmapRel = rmapRel, bmap = bmap, level = Q, N = N, Q = Q, naPat = naPat, .parameters = c("bvec", "beta"), finiteDiffGrad = finiteDiffGrad)) modelExpression <- ~ { pars <- getParsNlme(plist, fmap, rmapRel, bmap, groups, beta, bvec, b, level, N) res <- eval(model, data.frame(data, pars)) if (!length(grad <- attr(res, "gradient"))) { grad <- finiteDiffGrad(model, data, pars) } for (nm in names(plist)) { gradnm <- grad[, nm] if (is.logical(f <- plist[[nm]]$fixed)) { if(f) X[, fmap[[nm]]] <- gradnm # else f == FALSE =^= 0 } else X[, fmap[[nm]]] <- gradnm * f for(i in 1:Q) { if (is.logical(r <- plist[[nm]]$random[[i]])) { if (r) Z[, rmap[[i]][[nm]]] <- gradnm # else r == FALSE =^= 0 } else { rm.i <- rmap[[i]][[nm]] if (data.class(rm.i) != "list") { Z[, rm.i] <- gradnm * r } else { for(j in seq_along(rm.i)) { Z[, rm.i[[j]]] <- if (is.logical(rr <- r[[j]])) gradnm else gradnm * rr } } } } } result <- c(Z[naPat, ], X[naPat, ], res[naPat]) result[is.na(result)] <- 0 result }## {modelExpression} modelResid <- ~ eval(model, data.frame(data, getParsNlme(plist, fmap, rmapRel, bmap, groups, beta, bvec, b, level, N)))[naPat] ww <- eval(modelExpression[[2]], envir = nlEnv) w <- ww[NReal * pLen + (1:NReal)] ZX <- array(ww[1:(NReal*pLen)], c(NReal, pLen), list(row.names(dataMixShrunk), c(rNam, fn))) w <- w + as.vector(ZX[, rLen + (1:fLen), drop = FALSE] %*% sfix) if (!is.null(start$random)) { startRan <- 0 for(i in 1:Q) { w <- w + as.vector((ZX[, startRan + 1:ncols[i], drop = FALSE] * t(sran[[i]])[as.character(grpShrunk[, Q-i+1]),,drop = FALSE]) %*% rep(1, ncols[i])) startRan <- startRan + ncols[i] } } ## creating the condensed linear model attr(nlmeSt, "conLin") <- list(Xy = array(c(ZX, w), dim = c(NReal, sum(ncols)), dimnames = list(row.names(dataMixShrunk), c(colnames(ZX), deparse(model[[2]])))), dims = Dims, logLik = 0, ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions sigma = controlvals$sigma, auxSigma = 0) ## additional attributes of nlmeSt attr(nlmeSt, "resp") <- yShrunk attr(nlmeSt, "model") <- modelResid attr(nlmeSt, "local") <- nlEnv attr(nlmeSt, "NReal") <- NReal ## initialization nlmeSt <- Initialize(nlmeSt, dataMixShrunk, grpShrunk, control = controlvals) parMap <- attr(nlmeSt, "pmap") decomp <- length(coef(nlmeSt)) == length(coef(nlmeSt$reStruct)) && !needUpdate(nlmeSt) if(decomp) { # can do one decomposition ## need to save conLin for calculating updating between steps oldConLin <- attr(nlmeSt, "conLin") } numIter <- 0 # number of iterations pnlsSettings <- c(controlvals$pnlsMaxIter, controlvals$minScale, controlvals$pnlsTol, 0, 0, 0) nlModel <- nonlinModel(modelExpression, nlEnv) ##---------------------------------------------------------------------------- repeat { ## alternating algorithm numIter <- numIter + 1 ## LME step if (needUpdate(nlmeSt)) { # updating varying weights nlmeSt <- update(nlmeSt, dataMixShrunk) } if (decomp) { attr(nlmeSt, "conLin") <- MEdecomp(oldConLin) } oldPars <- coef(nlmeSt) if (controlvals$opt == "nlminb") { control <- list(trace = controlvals$msVerbose, iter.max = controlvals$msMaxIter) keep <- c("eval.max", "abs.tol", "rel.tol", "x.tol", "xf.tol", "step.min", "step.max", "sing.tol", "scale.init", "diff.g") control <- c(control, controlvals[names(controlvals) %in% keep]) optRes <- nlminb(c(coef(nlmeSt)), function(nlmePars) -logLik(nlmeSt, nlmePars), control = control) aConv <- coef(nlmeSt) <- optRes$par convIter <- optRes$iterations if(optRes$convergence && controlvals$msWarnNoConv) warning(paste(sprintf( "Iteration %d, LME step: nlminb() did not converge (code = %d).", numIter, optRes$convergence), if(convIter >= control$iter.max) "Do increase 'msMaxIter'!" else if(!is.null(msg <- optRes$message)) paste("PORT message:", msg))) } else { ## nlm(.) aNlm <- nlm(f = function(nlmePars) -logLik(nlmeSt, nlmePars), p = c(coef(nlmeSt)), hessian = TRUE, print.level = controlvals$msVerbose, gradtol = if(numIter == 1) controlvals$msTol else 100*.Machine$double.eps, iterlim = if(numIter < 10) 10 else controlvals$msMaxIter, check.analyticals = FALSE) aConv <- coef(nlmeSt) <- aNlm$estimate convIter <- aNlm$iterations if(aNlm$code > 2 && controlvals$msWarnNoConv) warning(paste(sprintf( "Iteration %d, LME step: nlm() did not converge (code = %d).", numIter, aNlm$code), if(aNlm$code == 4) "Do increase 'msMaxIter'!")) } nlmeFit <- attr(nlmeSt, "lmeFit") <- MEestimate(nlmeSt, grpShrunk) if (verbose) { cat("\n**Iteration", numIter) cat(sprintf("\nLME step: Loglik: %s, %s iterations: %d\n", format(nlmeFit$logLik), controlvals$opt, convIter)) print(nlmeSt) } ## PNLS step if (is.null(correlation)) { cF <- 1.0 cD <- 1 } else { cF <- corFactor(nlmeSt$corStruct) cD <- Dim(nlmeSt$corStruct) } vW <- if(is.null(weights)) 1.0 else varWeights(nlmeSt$varStruct) if (verbose) cat(" Beginning PNLS step: .. ") work <- .C(fit_nlme, thetaPNLS = as.double(c(as.vector(unlist(sran)), sfix)), pdFactor = as.double(pdFactor(nlmeSt$reStruct)), as.integer(unlist(rev(grpShrunk))), as.integer(unlist(Dims)), as.integer(attr(nlmeSt$reStruct, "settings"))[-(1:3)], as.double(cF), as.double(vW), as.integer(unlist(cD)), settings = as.double(pnlsSettings), additional = double(NReal * (pLen + 1)), as.integer(!is.null(correlation)), as.integer(!is.null(weights)), ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions as.double(controlvals$sigma), nlModel, NAOK = TRUE) if (verbose) cat(" completed fit_nlme() step.\n") if (work$settings[4] == 1) { ## convResult <- 2 msg <- "step halving factor reduced below minimum in PNLS step" if (controlvals$returnObject) warning(msg) else stop(msg) } ## dim(work$pdFactor) <- dim(pdMatrix(nlmeSt$reStruct[[1]])) ## matrix(nlmeSt$reStruct[[1]]) <- crossprod(work$pdFactor) ## fix from Setzer.Woodrow@epamail.epa.gov for nested grouping factors i.pdF <- 1 for (i in seq_along(nlmeSt$reStruct)) { d.i <- dim(pdMatrix(nlmeSt$reStruct[[i]])) ni.pdF <- i.pdF + prod(d.i) pdF <- array(work$pdFactor[i.pdF:(ni.pdF -1)], dim = d.i) matrix(nlmeSt$reStruct[[i]]) <- crossprod(pdF) i.pdF <- ni.pdF } oldPars <- c(sfix, oldPars) for(i in 1:Q) sran[[i]][] <- work$thetaPNLS[(bmap[i]+1):bmap[i+1]] sfix[] <- work$thetaPNLS[nPars + 1 - (fLen:1)] if (verbose) { cat("PNLS step: RSS = ", format(work$settings[6]), "\n fixed effects: ") for (i in 1:fLen) cat(format(sfix[i])," ") cat("\n iterations:", work$settings[5],"\n") } aConv <- c(sfix, coef(nlmeSt)) # 2nd part added by SDR 04/19/2002 w[] <- work$additional[(NReal * pLen) + 1:NReal] ZX[] <- work$additional[1:(NReal * pLen)] w <- w + as.vector(ZX[, rLen + (1:fLen), drop = FALSE] %*% sfix) startRan <- 0 for(i in 1:Q) { gr.i <- as.character(grpShrunk[, Q-i+1]) w <- w + as.vector((ZX[, startRan + 1:ncols[i], drop = FALSE] * t(sran[[i]])[gr.i,, drop = FALSE]) %*% rep(1, ncols[i])) startRan <- startRan + ncols[i] } if (decomp) { oldConLin$Xy[] <- c(ZX, w) oldConLin$logLik <- 0 } else { attr(nlmeSt, "conLin")$Xy[] <- c(ZX, w) attr(nlmeSt, "conLin")$logLik <- 0 } conv <- abs((oldPars - aConv)/ ifelse(abs(aConv) < controlvals$tolerance, 1, aConv)) aConv <- c(fixed = max(conv[1:fLen])) conv <- conv[-(1:fLen)] for(i in names(nlmeSt)) { if (any(parMap[,i])) { aConv <- c(aConv, max(conv[parMap[,i]])) names(aConv)[length(aConv)] <- i } } if (verbose) { cat(sprintf("Convergence crit. (must all become <= tolerance = %g):\n", controlvals$tolerance)) print(aConv) } if ((max(aConv) <= controlvals$tolerance) || (aConv["fixed"] <= controlvals$tolerance && convIter == 1)) { ## convResult <- 0 break } if (numIter >= controlvals$maxIter) { ## convResult <- 1 msg <- gettextf( "maximum number of iterations (maxIter = %d) reached without convergence", controlvals$maxIter) if (controlvals$returnObject) { warning(msg, domain=NA) ; break } else stop(msg, domain=NA) } } ## end{ repeat } (nlme steps) ---------------------------------------------- ## wrapping up nlmeFit <- if (decomp) MEestimate(nlmeSt, grpShrunk, oldConLin) else MEestimate(nlmeSt, grpShrunk) ## degrees of freedom for fixed effects tests fixDF <- getFixDF(ZX[, rLen + (1:fLen), drop = FALSE], grpShrunk, attr(nlmeSt, "conLin")$dims$ngrps, fixAssign) ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions attr(fixDF, "varFixFact") <- varFix <- nlmeFit$sigma * nlmeFit$varFix varFix <- crossprod(varFix) dimnames(varFix) <- list(fn, fn) ## ## fitted.values and residuals (in original order) ## Resid <- if (decomp) resid(nlmeSt, level = 0:Q, oldConLin)[revOrderShrunk, ] else resid(nlmeSt, level = 0:Q)[revOrderShrunk, ] Fitted <- yShrunk[revOrderShrunk] - Resid rownames(Resid) <- rownames(Fitted) <- origOrderShrunk grpShrunk <- grpShrunk[revOrderShrunk, , drop = FALSE] attr(Resid, "std") <- nlmeFit$sigma/(varWeights(nlmeSt)[revOrderShrunk]) ## inverting back reStruct nlmeSt$reStruct <- solve(nlmeSt$reStruct) attr(nlmeSt, "fixedSigma") <- (controlvals$sigma > 0) ## saving part of dims dims <- attr(nlmeSt, "conLin")$dims[c("N", "Q", "qvec", "ngrps", "ncol")] ## getting the approximate var-cov of the parameters apVar <- if (controlvals$apVar) lmeApVar(nlmeSt, nlmeFit$sigma, .relStep = controlvals[[".relStep"]], minAbsPar = controlvals[["minAbsParApVar"]], natural = controlvals[["natural"]]) else "Approximate variance-covariance matrix not available" ## putting sran in the right format sran <- lapply(sran, t) ## getting rid of condensed linear model, fit, and other attributes ###- oClass <- class(nlmeSt) attributes(nlmeSt) <- attributes(nlmeSt)[ c("names", "class", "pmap", "fixedSigma")] ##- class(nlmeSt) <- oClass ## ## creating the nlme object ## isGrpd <- inherits(data, "groupedData") structure(class = c("nlme", "lme"), list(modelStruct = nlmeSt, dims = dims, contrasts = contr, coefficients = list(fixed = sfix, random = rev(sran)), varFix = varFix, sigma = nlmeFit$sigma, apVar = apVar, logLik = nlmeFit$logLik, numIter = numIter, groups = grpShrunk, call = Call, method = method, fitted = Fitted, residuals = Resid, plist = plist, map = list(fmap=fmap,rmap=rmap,rmapRel=rmapRel,bmap=bmap), fixDF = fixDF), ## saving labels and units for plots units = if(isGrpd) attr(data, "units"), labels = if(isGrpd) attr(data, "labels")) } ## {nlme.formula} ### ##' Calculate the parameters from the fixed and random effects getParsNlme <- function(plist, fmap, rmapRel, bmap, groups, beta, bvec, b, level, N) { pars <- array(0, c(N, length(plist)), list(NULL, names(plist))) ## for random effects below iQ <- if (level > 0) { Q <- length(groups) (Q - level + 1L):Q } else integer() # empty for (nm in names(plist)) { ## 1) Fixed effects if (is.logical(f <- plist[[nm]]$fixed)) { if (f) pars[, nm] <- beta[fmap[[nm]]] ## else pars[, nm] <- 0 (as f == FALSE) } else pars[, nm] <- f %*% beta[fmap[[nm]]] ## 2) Random effects for(i in iQ) if(!is.null(rm.i. <- rmapRel[[i]][[nm]])) { b.i <- b[[i]] b.i[] <- bvec[(bmap[i] + 1):bmap[i+1]] ## NB: some groups[[i]] may be *new* levels, i.e. non-matching: gr.i <- match(groups[[i]], colnames(b.i)) # column numbers + NA if (is.logical(r <- plist[[nm]]$random[[i]])) { if (r) pars[, nm] <- pars[, nm] + b.i[rm.i., gr.i] ## else r == FALSE =^= 0 } else if (data.class(r) != "list") { pars[, nm] <- pars[, nm] + (r * t(b.i)[gr.i, rm.i., drop=FALSE]) %*% rep(1, ncol(r)) } else { b.i.gi <- b.i[, gr.i, drop=FALSE] for(j in seq_along(rm.i.)) { if (is.logical(rr <- r[[j]])) { if(rr) pars[, nm] <- pars[, nm] + b.i.gi[rm.i.[[j]], ] ## else rr == FALSE =^= 0 } else pars[, nm] <- pars[, nm] + (rr * t(b.i.gi[rm.i.[[j]], , drop=FALSE])) %*% rep(1, ncol(rr)) } } } # for( i ) if(!is.null(rm.i. ..)) } pars } ### ### Methods for standard generics ### formula.nlme <- function(x, ...) eval(x$call[["model"]]) predict.nlme <- function(object, newdata, level = Q, asList = FALSE, na.action = na.fail, naPattern = NULL, ...) { ## ## method for predict() designed for objects inheriting from class nlme ## Q <- object$dims$Q if (missing(newdata)) { # will return fitted values val <- fitted(object, level, asList) if (length(level) == 1) return(val) return(data.frame(object[["groups"]][,level[level != 0], drop = FALSE], predict = val)) } maxQ <- max(level) # maximum level for predictions nlev <- length(level) newdata <- as.data.frame(newdata) if (maxQ > 0) { # predictions with random effects whichQ <- Q - (maxQ-1):0 reSt <- object$modelStruct$reStruct[whichQ] ## nlmeSt <- nlmeStruct(reStruct = reSt) groups <- getGroupsFormula(reSt) if (any(is.na(match(all.vars(groups), names(newdata))))) { ## groups cannot be evaluated in newdata stop("cannot evaluate groups for desired levels on 'newdata'") } } else { reSt <- NULL } mfArgs <- list(formula = asOneFormula( formula(object), object$call$fixed, formula(reSt), naPattern, omit = c(names(object$plist), "pi", deparse(getResponseFormula(object)[[2]]))), data = newdata, na.action = na.action, drop.unused.levels = TRUE) dataMix <- do.call(model.frame, mfArgs) origOrder <- row.names(dataMix) # preserve the original order whichRows <- match(origOrder, row.names(newdata)) if (maxQ > 0) { ## sort the model.frame by groups and get the matrices and parameters ## used in the estimation procedures grps <- getGroups(newdata, eval(substitute(~ 1 | GRPS, list(GRPS = groups[[2]])))) ## ordering data by groups if (inherits(grps, "factor")) { # single level grps <- grps[whichRows, drop = TRUE] oGrps <- data.frame(grps) ## checking if there are missing groups if (any(naGrps <- is.na(grps))) { grps[naGrps] <- levels(grps)[1L] # input with existing level } ord <- order(grps) #"order" treats a single named argument peculiarly grps <- data.frame(grps) row.names(grps) <- origOrder names(grps) <- names(oGrps) <- as.character(deparse((groups[[2L]]))) } else { grps <- oGrps <- do.call(data.frame, ## FIXME? better lapply(*, drop) ?? lapply(grps[whichRows, ], function(x) x[drop = TRUE])) ## checking for missing groups if (any(naGrps <- is.na(grps))) { ## need to input missing groups for(i in names(grps)) { grps[naGrps[, i], i] <- levels(grps[,i])[1L] } naGrps <- t(apply(naGrps, 1, cumsum)) # propagating NAs } ord <- do.call(order, grps) ## making group levels unique grps[, 1] <- grps[, 1][drop = TRUE] for(i in 2:ncol(grps)) { grps[, i] <- as.factor(paste(as.character(grps[, i-1]), as.character(grps[, i ]), sep = "/")) } } ## if (match(0, level, nomatch = 0)) { ## naGrps <- cbind(FALSE, naGrps) ## } ## naGrps <- as.matrix(naGrps)[ord, , drop = FALSE] naGrps <- cbind(FALSE, naGrps)[ord, , drop = FALSE] grps <- grps[ord, , drop = FALSE] dataMix <- dataMix[ord, ,drop = FALSE] revOrder <- match(origOrder, row.names(dataMix)) # putting in orig. order } ## making sure factor levels are the same as in contrasts contr <- object$contrasts for(i in names(dataMix)) { if (inherits(dataMix[,i], "factor") && !is.null(contr[[i]])) { levs <- levels(dataMix[,i]) levsC <- dimnames(contr[[i]])[[1L]] if (any(wch <- is.na(match(levs, levsC)))) { stop(sprintf(ngettext(sum(wch), "level %s not allowed for %s", "levels %s not allowed for %s"), paste(levs[wch], collapse = ",")), domain = NA) } ## if (length(levs) < length(levsC)) { ## if (inherits(dataMix[,i], "ordered")) { ## dataMix[,i] <- ordered(as.character(dataMix[,i]), levels = levsC) ## } else { ## dataMix[,i] <- factor(as.character(dataMix[,i]), levels = levsC) ## } ## } attr(dataMix[,i], "contrasts") <- contr[[i]][levs, , drop = FALSE] } } N <- nrow(dataMix) ## ## evaluating the naPattern expression, if any ## naPat <- if(is.null(naPattern)) rep(TRUE, N) else as.logical(eval(asOneSidedFormula(naPattern)[[2]], dataMix)) ## ## Getting the plist for the new data frame ## plist <- object$plist fixed <- eval(object$call$fixed) if (!is.list(fixed)) fixed <- list(fixed) fixed <- do.call(c, lapply(fixed, function(fix.i) { if (is.name(fix.i[[2]])) list(fix.i) else ## multiple parameters on left hand side eval(parse(text = paste0("list(", paste(paste(all.vars(fix.i[[2]]), deparse (fix.i[[3]]), sep = "~"), collapse = ","), ")"))) })) fnames <- unlist(lapply(fixed, function(el) deparse(el[[2]]))) names(fixed) <- fnames fix <- fixef(object) ## fn <- names(fix) for(nm in fnames) { if (!is.logical(plist[[nm]]$fixed)) { oSform <- asOneSidedFormula(fixed[[nm]][[3]]) plist[[nm]]$fixed <- model.matrix(oSform, model.frame(oSform, dataMix)) } } if (maxQ > 0) { grpsRev <- lapply(rev(grps), as.character) ranForm <- formula(reSt)[whichQ] namGrp <- names(ranForm) rnames <- lapply(ranForm, function(el) unlist(lapply(el, function(el1) deparse(el1[[2]])))) for(i in seq_along(ranForm)) { names(ranForm[[i]]) <- rnames[[i]] } ran <- ranef(object) ran <- if(is.data.frame(ran)) list(ran) else rev(ran) ## rn <- lapply(ran[whichQ], names) ran <- lapply(ran, t) ranVec <- unlist(ran) for(nm in names(plist)) { for(i in namGrp) { if (!is.logical(plist[[nm]]$random[[i]])) { wch <- which(!is.na(match(rnames[[i]], nm))) plist[[nm]]$random[[i]] <- if (length(wch) == 1) { # only one formula for nm oSform <- asOneSidedFormula(ranForm[[i]][[nm]][[3]]) model.matrix(oSform, model.frame(oSform, dataMix)) } else { # multiple formulae lapply(ranForm[[i]][wch], function(el) { if (el[[3]] == "1") { TRUE } else { oSform <- asOneSidedFormula(el[[3]]) model.matrix(oSform, model.frame(oSform, dataMix)) } }) } } } } } else { namGrp <- "" grpsRev <- ranVec <- ran <- NULL } val <- vector("list", nlev) modForm <- getCovariateFormula(object)[[2]] omap <- object$map for(i in 1:nlev) { val[[i]] <- eval(modForm, data.frame(dataMix, getParsNlme(plist, omap$fmap, omap$rmapRel, omap$bmap, grpsRev, fix, ranVec, ran, level[i], N)))[naPat] } names(val) <- c("fixed", rev(namGrp))[level + 1] val <- as.data.frame(val) if (maxQ > 0) { val <- val[revOrder, , drop = FALSE] if (any(naGrps)) { val[naGrps] <- NA } } ## putting back in original order if (maxQ > 1) { # making groups unique for(i in 2:maxQ) oGrps[, i] <- as.factor(paste(as.character(oGrps[,i-1]), as.character(oGrps[,i ]), sep = "/")) } if (length(level) == 1) { val <- val[,1] ## ?? not in predict.lme() if (level > 0) { # otherwise 'oGrps' are typically undefined grps <- as.character(oGrps[, level]) if (asList) { val <- split(val, ordered(grps, levels = unique(grps))) } else { names(val) <- grps } } lab <- "Predicted values" if (!is.null(aux <- attr(object, "units")$y)) { lab <- paste(lab, aux) } attr(val, "label") <- lab val } else { data.frame(oGrps, predict = val) } } ## based on R's update.default update.nlme <- function (object, model., ..., evaluate = TRUE) { if (is.null(call <- object$call)) stop("need an object with call component") extras <- match.call(expand.dots = FALSE)$... if (!missing(model.)) call$model <- update.formula(formula(object), model.) if(length(extras) > 0) { existing <- !is.na(match(names(extras), names(call))) ## do these individually to allow NULL to remove entries. for (a in names(extras)[existing]) call[[a]] <- extras[[a]] if(any(!existing)) { call <- c(as.list(call), extras[!existing]) call <- as.call(call) } } if(evaluate) eval(call, parent.frame()) else call } ## update.nlme <- ## function(object, model, data, fixed, random, groups, start, correlation, ## weights, subset, method, na.action, naPattern, control, ## verbose, ...) ## { ## thisCall <- as.list(match.call())[-(1:2)] ## if (!is.null(thisCall$start) && is.numeric(start)) { ## thisCall$start <- list(fixed = start) ## } ## if (!is.null(nextCall <- object$origCall) && ## (is.null(thisCall$fixed) && !is.null(thisCall$random))) { ## nextCall <- as.list(nextCall)[-1] ## } else { ## nextCall <- as.list(object$call)[-1] ## if (is.null(thisCall$fixed)) { # no changes in fixef model ## if (is.null(thisCall$start)) { ## thisCall$start <- list(fixed = fixef(object)) ## } else { ## if (is.null(thisCall$start$fixed)) { ## thisCall$start$fixed <- fixef(object) ## } ## } ## } ## if (!is.null(thisCall$start$random)) { # making start random NULL ## thisCall$start$random <- NULL ## } ## if (is.null(thisCall$random) && is.null(thisCall$subset)) { ## ## no changes in ranef model and no subsetting ## thisCall$random <- object$modelStruct$reStruct ## } ## } ## if (!is.null(thisCall$model)) { ## thisCall$model <- update(formula(object), model) ## } ## if (is.na(match("correlation", names(thisCall))) && ## !is.null(thCor <- object$modelStruct$corStruct)) { ## thisCall$correlation <- thCor ## } ## if (is.na(match("weights", names(thisCall))) && ## !is.null(thWgt <- object$modelStruct$varStruct)) { ## thisCall$weights <- thWgt ## } ## nextCall[names(thisCall)] <- thisCall ## do.call(nlme, nextCall) ## } ###*### nlmeStruct - a model structure for nlme fits nlmeStruct <- ## constructor for nlmeStruct objects function(reStruct, corStruct = NULL, varStruct = NULL)#, resp = NULL, ## model = NULL, local = NULL, N = NULL, naPat = NULL) { val <- list(reStruct = reStruct, corStruct = corStruct, varStruct = varStruct) structure(val[!vapply(val, is.null, NA)], # removing NULL components settings = attr(val$reStruct, "settings"), ## attr(val, "resp") <- resp ## attr(val, "model") <- model ## attr(val, "local") <- local ## attr(val, "N") <- N ## attr(val, "naPat") <- naPat class = c("nlmeStruct", "lmeStruct", "modelStruct")) } ##*## nlmeStruct methods for standard generics fitted.nlmeStruct <- function(object, level = Q, conLin = attr(object, "conLin"), ...) { Q <- attr(object, "conLin")$dims[["Q"]] attr(object, "resp") - resid(object, level, conLin) } residuals.nlmeStruct <- function(object, level = Q, conLin = attr(object, "conLin"), ...) { Q <- conLin$dims[["Q"]] stopifnot(length(level) >= 1) loc <- attr(object, "local") oLev <- get("level", envir = loc) on.exit(assign("level", oLev, envir = loc)) dn <- c("fixed", rev(names(object$reStruct)))[level + 1] val <- array(0, c(attr(object, "NReal"), length(level)), list(dimnames(conLin$Xy)[[1]], dn)) for(i in seq_along(level)) { assign("level", level[i], envir = loc, immediate = TRUE) val[, i] <- c(eval(attr(object, "model")[[2]], envir = loc)) } val } nlmeControl <- ## Set control values for iterations within nlme function(maxIter = 50, pnlsMaxIter = 7, msMaxIter = 50, minScale = 0.001, tolerance = 1e-5, niterEM = 25, pnlsTol = 0.001, msTol = 0.000001, returnObject = FALSE, msVerbose = FALSE, msWarnNoConv = TRUE, gradHess = TRUE, apVar = TRUE, .relStep = .Machine$double.eps^(1/3), minAbsParApVar = 0.05, opt = c("nlminb", "nlm"), natural = TRUE, sigma = NULL, ...) { if(is.null(sigma)) sigma <- 0 else if(!is.finite(sigma) || length(sigma) != 1 || sigma < 0) stop("Within-group std. dev. must be a positive numeric value") list(maxIter = maxIter, pnlsMaxIter = pnlsMaxIter, msMaxIter = msMaxIter, minScale = minScale, tolerance = tolerance, niterEM = niterEM, pnlsTol = pnlsTol, msTol = msTol, returnObject = returnObject, msVerbose = msVerbose, msWarnNoConv = msWarnNoConv, gradHess = gradHess, apVar = apVar, .relStep = .relStep, minAbsParApVar = minAbsParApVar, opt = match.arg(opt), natural = natural, sigma=sigma, ...) } nonlinModel <- function(modelExpression, env, paramNames = get(".parameters", envir = env)) { modelExpression <- modelExpression[[2]] thisEnv <- environment() offset <- 0 ind <- vector("list", length(paramNames)) names(ind) <- paramNames for( i in paramNames ) { v.i <- get(i, envir = env) ind[[ i ]] <- offset + seq_along(v.i) offset <- offset + length(v.i) } modelValue <- eval(modelExpression, env) rm(i, offset, paramNames) function (newPars) { if(!missing(newPars)) { for(i in names(ind)) assign( i, unname(newPars[ ind[[i]] ]), envir = env) assign("modelValue", eval(modelExpression, env), envir = thisEnv) } modelValue } } ## Local Variables: ## ess-indent-offset: 2 ## End: nlme/R/gls.R0000644000176200001440000014645113336503465012341 0ustar liggesusers### Fit a linear model with correlated errors and/or heteroscedasticity ### ### Copyright 2005-2018 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # gls <- ## fits linear model with serial correlation and variance functions, ## by maximum likelihood using a Newton-Raphson algorithm. function(model, data = sys.frame(sys.parent()), correlation = NULL, weights = NULL, subset, method = c("REML", "ML"), na.action = na.fail, control = list(), verbose = FALSE) { Call <- match.call() ## control parameters controlvals <- glsControl() if (!missing(control)) controlvals[names(control)] <- control ## ## checking arguments ## if (!inherits(model, "formula") || length(model) != 3L) { stop("\nmodel must be a formula of the form \"resp ~ pred\"") } method <- match.arg(method) REML <- method == "REML" ## check if correlation is present and has groups groups <- if (!is.null(correlation)) getGroupsFormula(correlation) ## else NULL ## create a gls structure containing the plug-ins glsSt <- glsStruct(corStruct = correlation, varStruct = varFunc(weights)) ## we need to resolve '.' in the formula here model <- terms(model, data=data) ## extract a data frame with enough information to evaluate ## formula, groups, corStruct, and varStruct mfArgs <- list(formula = asOneFormula(formula(glsSt), model, groups), data = data, na.action = na.action) if (!missing(subset)) { mfArgs[["subset"]] <- asOneSidedFormula(Call[["subset"]])[[2L]] } mfArgs$drop.unused.levels <- TRUE dataMod <- do.call(model.frame, mfArgs) origOrder <- row.names(dataMod) # preserve the original order if (!is.null(groups)) { ## sort the model.frame by groups and get the matrices and parameters ## used in the estimation procedures ## always use innermost level of grouping groups <- eval(substitute(~ 1 | GR, list(GR = groups[[2L]]))) grps <- getGroups(dataMod, groups, level = length(getGroupsFormula(groups, asList = TRUE))) ## ordering data by groups ord <- order(grps) grps <- grps[ord] dataMod <- dataMod[ord, ,drop = FALSE] revOrder <- match(origOrder, row.names(dataMod)) # putting in orig. order } else grps <- NULL ## obtaining basic model matrices X <- model.frame(model, dataMod) ## keeping the contrasts for later use in predict contr <- lapply(X, function(el) if (inherits(el, "factor")) contrasts(el)) contr <- contr[!unlist(lapply(contr, is.null))] X <- model.matrix(model, X) if(ncol(X) == 0L) stop("no coefficients to fit") y <- eval(model[[2L]], dataMod) N <- nrow(X) p <- ncol(X) # number of coefficients parAssign <- attr(X, "assign") fTerms <- terms(as.formula(model), data=data) namTerms <- attr(fTerms, "term.labels") if (attr(fTerms, "intercept") > 0) { namTerms <- c("(Intercept)", namTerms) } namTerms <- factor(parAssign, labels = namTerms) parAssign <- split(order(parAssign), namTerms) fixedSigma <- (controlvals$sigma > 0) ## 17-11-2015; Fixed sigma patch ## creating the condensed linear model attr(glsSt, "conLin") <- list(Xy = array(c(X, y), c(N, ncol(X) + 1L), list(row.names(dataMod), c(colnames(X), deparse(model[[2]])))), dims = list(N = N, p = p, REML = as.integer(REML)), logLik = 0, ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions sigma = controlvals$sigma, fixedSigma = fixedSigma) ## initialization glsEstControl <- controlvals["singular.ok"] glsSt <- Initialize(glsSt, dataMod, glsEstControl) parMap <- attr(glsSt, "pmap") ## ## getting the fitted object, possibly iterating for variance functions ## numIter <- numIter0 <- 0L repeat { oldPars <- c(attr(glsSt, "glsFit")[["beta"]], coef(glsSt)) if (length(coef(glsSt))) { # needs ms() optRes <- if (controlvals$opt == "nlminb") { nlminb(c(coef(glsSt)), function(glsPars) -logLik(glsSt, glsPars), control = list(trace = controlvals$msVerbose, iter.max = controlvals$msMaxIter)) } else { optim(c(coef(glsSt)), function(glsPars) -logLik(glsSt, glsPars), method = controlvals$optimMethod, control = list(trace = controlvals$msVerbose, maxit = controlvals$msMaxIter, reltol = if(numIter == 0L) controlvals$msTol else 100*.Machine$double.eps)) } coef(glsSt) <- optRes$par } else { optRes <- list(convergence = 0) } attr(glsSt, "glsFit") <- glsEstimate(glsSt, control = glsEstControl) ## checking if any updating is needed if (!needUpdate(glsSt)) { if (optRes$convergence) stop(optRes$message) break } ## updating the fit information numIter <- numIter + 1L glsSt <- update(glsSt, dataMod) ## calculating the convergence criterion aConv <- c(attr(glsSt, "glsFit")[["beta"]], coef(glsSt)) conv <- abs((oldPars - aConv)/ifelse(aConv == 0, 1, aConv)) aConv <- c("beta" = max(conv[1:p])) conv <- conv[-(1:p)] for(i in names(glsSt)) { if (any(parMap[,i])) { aConv <- c(aConv, max(conv[parMap[,i]])) names(aConv)[length(aConv)] <- i } } if (verbose) { cat("\nIteration:",numIter) cat("\nObjective:", format(optRes$value), "\n") print(glsSt) cat("\nConvergence:\n") print(aConv) } if (max(aConv) <= controlvals$tolerance) { break } if (numIter > controlvals$maxIter) { stop("maximum number of iterations reached without convergence") } } ## wrapping up glsFit <- attr(glsSt, "glsFit") namBeta <- names(glsFit$beta) ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions attr(glsSt, "fixedSigma") <- fixedSigma attr(parAssign, "varBetaFact") <- varBeta <- glsFit$sigma * glsFit$varBeta * sqrt((N - REML * p)/(N - p)) varBeta <- crossprod(varBeta) dimnames(varBeta) <- list(namBeta, namBeta) ## ## fitted.values and residuals (in original order) ## Fitted <- fitted(glsSt) ## putting groups back in original order, if present if (!is.null(grps)) { grps <- grps[revOrder] Fitted <- Fitted[revOrder] Resid <- y[revOrder] - Fitted attr(Resid, "std") <- glsFit$sigma/varWeights(glsSt)[revOrder] } else { Resid <- y - Fitted attr(Resid, "std") <- glsFit$sigma/varWeights(glsSt) } names(Resid) <- names(Fitted) <- origOrder ## getting the approximate var-cov of the parameters apVar <- if (controlvals$apVar) glsApVar(glsSt, glsFit$sigma, .relStep = controlvals[[".relStep"]], minAbsPar = controlvals[["minAbsParApVar"]], natural = controlvals[["natural"]]) else "Approximate variance-covariance matrix not available" ## getting rid of condensed linear model and fit dims <- attr(glsSt, "conLin")[["dims"]] dims[["p"]] <- p attr(glsSt, "conLin") <- NULL attr(glsSt, "glsFit") <- NULL attr(glsSt, "fixedSigma") <- fixedSigma ## 17-11-2015; Fixed sigma patch; .. grpDta <- inherits(data, "groupedData") ## ## creating the gls object ## structure(class = "gls", list(modelStruct = glsSt, dims = dims, contrasts = contr, coefficients = glsFit[["beta"]], varBeta = varBeta, ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions sigma = if(fixedSigma) controlvals$sigma else glsFit$sigma, apVar = apVar, logLik = glsFit$logLik, numIter = if (needUpdate(glsSt)) numIter else numIter0, groups = grps, call = Call, method = method, fitted = Fitted, residuals = Resid, parAssign = parAssign, na.action = attr(dataMod, "na.action")), namBetaFull = colnames(X), ## saving labels and units for plots units = if(grpDta) attr(data, "units"), labels= if(grpDta) attr(data, "labels")) } ### Auxiliary functions used internally in gls and its methods glsApVar.fullGlsLogLik <- function(Pars, object, conLin, dims, N) { fixedSigma <- attr(object, "fixedSigma") ## logLik as a function of sigma and coef(glsSt) npar <- length(Pars) if (!fixedSigma) { lsigma <- Pars[npar] # within-group std. dev. Pars <- Pars[-npar] sigma <- 0 } else { sigma <- conLin$sigma } coef(object) <- Pars conLin <- recalc(object, conLin) val <- .C(gls_loglik, as.double(conLin$Xy), as.integer(unlist(dims)), logLik = double(1L), lRSS = double(1L), sigma = as.double(sigma), NAOK = TRUE)[c("logLik", "lRSS")] if (!fixedSigma) { aux <- 2 * (val[["lRSS"]] - lsigma) conLin[["logLik"]] + val[["logLik"]] + (N * aux - exp(aux))/2 } else { val[["logLik"]] } } glsApVar <- function(glsSt, sigma, conLin = attr(glsSt, "conLin"), .relStep = .Machine$double.eps^(1/3), minAbsPar = 0, natural = TRUE) { fixedSigma <- attr(glsSt, "fixedSigma") ## calculate approximate variance-covariance matrix of all parameters ## except the coefficients if (length(glsCoef <- coef(glsSt)) > 0L) { cSt <- glsSt[["corStruct"]] if (natural && !is.null(cSt) && inherits(cSt, "corSymm")) { cStNatPar <- coef(cSt, unconstrained = FALSE) class(cSt) <- c("corNatural", "corStruct") coef(cSt) <- log((1 + cStNatPar)/(1 - cStNatPar)) glsSt[["corStruct"]] <- cSt glsCoef <- coef(glsSt) } dims <- conLin$dims N <- dims$N - dims$REML * dims$p conLin[["logLik"]] <- 0 # making sure Pars <- if(fixedSigma) glsCoef else c(glsCoef, lSigma = log(sigma)) val <- fdHess(Pars, glsApVar.fullGlsLogLik, glsSt, conLin, dims, N, .relStep = .relStep, minAbsPar = minAbsPar)[["Hessian"]] if (all(eigen(val, only.values=TRUE)$values < 0)) { ## negative definite - OK val <- solve(-val) nP <- names(Pars) dimnames(val) <- list(nP, nP) attr(val, "Pars") <- Pars attr(val, "natural") <- natural val } else { ## problem - solution is not a maximum "Non-positive definite approximate variance-covariance" } } # else NULL } glsEstimate <- function(object, conLin = attr(object, "conLin"), control = list(singular.ok = FALSE)) { dd <- conLin$dims p <- dd$p oXy <- conLin$Xy fixSig <- conLin$fixedSigma ## 17-11-2015; Fixed sigma patch; .. sigma <- conLin$sigma conLin <- recalc(object, conLin) # updating for corStruct and varFunc val <- .C(gls_estimate, as.double(conLin$Xy), as.integer(unlist(dd)), beta = double(p), sigma = as.double(sigma), ## 17-11-2015; Fixed sigma patch; .. logLik = double(1L), varBeta = double(p * p), rank = integer(1), pivot = as.integer(1:(p + 1L)), NAOK = TRUE)[c("beta","sigma","logLik","varBeta", "rank", "pivot")] rnk <- val[["rank"]] rnkm1 <- rnk - 1 if (!control$singular.ok && rnkm1 < p) { stop(gettextf("computed \"gls\" fit is singular, rank %s", rnk), domain = NA) } N <- dd$N - dd$REML * p namCoef <- colnames(oXy)[val[["pivot"]][1:rnkm1] + 1L] # coef names varBeta <- t(array(val[["varBeta"]], c(rnkm1, rnkm1), list(namCoef, namCoef))) beta <- val[["beta"]][1:rnkm1] names(beta) <- namCoef fitted <- c(oXy[, namCoef, drop = FALSE] %*% beta) resid <- oXy[, p + 1] - fitted ll <- conLin$logLik + val[["logLik"]] logLik <- if (!fixSig) { (N * (logb(N) - (1 + logb(2 * pi))))/2 + ll ## formula 2.21 on page 70 if sigma is estimated ML formula or 2.23 page 76 with REML } else { (-N/2) * logb(2*pi) + ll } list(logLik = logLik, beta = beta, sigma = val[["sigma"]], varBeta = varBeta, fitted = fitted, resid = resid, auxSigma = sqrt(sum((resid)^2))/sqrt(N)) } ### Methods for standard generics ACF.gls <- function(object, maxLag, resType = c("pearson", "response", "normalized"), form = ~1, na.action = na.fail, ...) { resType <- match.arg(resType) res <- resid(object, type = resType) wchRows <- NULL if (is.null(grps <- getGroups(object))) { ## check if formula defines groups if (!is.null(grpsF <- getGroupsFormula(form))) { if (is.null(data <- getData(object))) { ## will try to construct allV <- all.vars(grpsF) if (length(allV) > 0L) { alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(as.list(quote(data.frame)), alist) mode(alist) <- "call" data <- eval(alist, sys.parent(1)) } } grps <- model.frame(grpsF, data, na.action = na.action) wchRows <- !is.na(match(row.names(data), row.names(grps))) grps <- getGroups(grps, grpsF) } } if (!is.null(grps)) { if (!is.null(wchRows)) { res <- res[wchRows] } res <- split(res, grps) } else { res <- list(res) } if(missing(maxLag)) { maxLag <- min(c(maxL <- max(lengths(res)) - 1L, as.integer(10 * log10(maxL + 1)))) } val <- lapply(res, function(el, maxLag) { N <- maxLag + 1L tt <- double(N) nn <- integer(N) N <- min(c(N, n <- length(el))) nn[1:N] <- n + 1L - 1:N ## el <- el - mean(el) for(i in 1:N) { el1 <- el[1:(n-i+1L)] el2 <- el[i:n] tt[i] <- sum(el1 * el2) } array(c(tt,nn), c(length(tt), 2L)) }, maxLag = maxLag) val0 <- apply(sapply(val, function(x) x[,2L]), 1, sum) val1 <- apply(sapply(val, function(x) x[,1L]), 1, sum)/val0 val2 <- val1/val1[1L] structure(data.frame(lag = 0:maxLag, ACF = val2), n.used = val0, class = c("ACF", "data.frame")) } anova.gls <- function(object, ..., test = TRUE, type = c("sequential", "marginal"), adjustSigma = NA, Terms, L, verbose = FALSE) { fixSig <- attr(object$modelStruct, "fixedSigma") fixSig <- !is.null(fixSig) && fixSig Lmiss <- missing(L) ## returns the likelihood ratio statistics, the AIC, and the BIC dots <- list(...) if ((rt <- length(dots) + 1L) == 1L) { ## just one object if (!inherits(object,"gls")) stop("object must inherit from class \"gls\"") if(is.na(adjustSigma)) ## REML correction already applied to gnls objects adjustSigma <- inherits(object, "gnls") dims <- object$dims N <- dims$N p <- dims$p REML <- dims$REML assign <- object$parAssign vBeta <- attr(assign, "varBetaFact") if (!REML && adjustSigma) ## using REML-like estimate of sigma under ML vBeta <- sqrt((N - p)/N) * vBeta c0 <- solve(t(vBeta), coef(object)) nTerms <- length(assign) dDF <- N - p lab <- paste("Denom. DF:", dDF,"\n") if (missing(Terms) && Lmiss) { ## returns the F.table (Wald) for the fixed effects type <- match.arg(type) Fval <- Pval <- double(nTerms) nDF <- integer(nTerms) for(i in 1:nTerms) { nDF[i] <- length(assign[[i]]) c0i <- if (type == "sequential") # type I SS c0[assign[[i]]] else ## "marginal" qr.qty(qr(vBeta[, assign[[i]], drop = FALSE]), c0)[1:nDF[i]] Fval[i] <- sum(c0i^2)/nDF[i] Pval[i] <- pf(Fval[i], nDF[i], dDF, lower.tail=FALSE) } ## ## fixed effects F-values, df, and p-values ## aod <- data.frame(numDF = nDF, "F-value" = Fval, "p-value" = Pval, check.names=FALSE) rownames(aod) <- names(assign) } else { if (Lmiss) { # terms is given if (is.numeric(Terms) && all(Terms == as.integer(Terms))) { if (min(Terms) < 1 || max(Terms) > nTerms) { stop(gettextf("'Terms' must be between 1 and %d", nTerms), domain = NA) } } else { if (is.character(Terms)) { if (any(noMatch <- is.na(match(Terms, names(assign))))) { stop(sprintf(ngettext(sum(noMatch), "term %s not matched", "terms %s not matched"), paste(Terms[noMatch], collapse = ", ")), domain = NA) } } else { stop("terms can only be integers or characters") } } lab <- paste(lab, "F-test for:", paste(names(assign[Terms]),collapse=", "),"\n") L <- diag(p)[unlist(assign[Terms]),,drop=FALSE] } else { L <- as.matrix(L) if (ncol(L) == 1L) L <- t(L) # single linear combination nrowL <- nrow(L) ncolL <- ncol(L) if (ncol(L) > p) { stop(sprintf(ngettext(ncol(L), "'L' must have at most %d column", "'L' must have at most %d columns"), ncol(L)), domain = NA) } dmsL1 <- rownames(L) L0 <- array(0, c(nrowL, p), list(NULL, names(coef(object)))) if (is.null(dmsL2 <- colnames(L))) { ## assume same order as effects L0[, 1:ncolL] <- L } else { if (any(noMatch <- is.na(match(dmsL2, colnames(L0))))) { stop(sprintf(ngettext(sum(noMatch), "effect %s not matched", "effects %s not matched"), paste(dmsL2[noMatch],collapse=", ")), domain = NA) } L0[, dmsL2] <- L } L <- L0[noZeroRowL <- as.logical((L0 != 0) %*% rep(1, p)), , drop = FALSE] nrowL <- nrow(L) noZeroColL <- as.logical(c(rep(1,nrowL) %*% (L != 0))) rownames(L) <- if(is.null(dmsL1)) 1:nrowL else dmsL1[noZeroRowL] lab <- paste(lab, "F-test for linear combination(s)\n") } nDF <- sum(svd.d(L) > 0) c0 <- c(qr.qty(qr(vBeta %*% t(L)), c0))[1:nDF] Fval <- sum(c0^2)/nDF Pval <- pf(Fval, nDF, dDF, lower.tail=FALSE) aod <- data.frame(numDF = nDF, "F-value" = Fval, "p-value" = Pval, check.names=FALSE) if (!Lmiss) { attr(aod, "L") <- if(nrow(L) > 1) L[, noZeroColL, drop = FALSE] else L[, noZeroColL] } } attr(aod, "label") <- lab attr(aod,"rt") <- rt class(aod) <- c("anova.lme", "data.frame") aod } ## ## Otherwise construct the likelihood ratio and information table ## objects in ... may inherit from gls, lm, lmList, and lme (for now) ## else { Call <- match.call() Call[[1]] <- quote(nlme::anova.lme) eval.parent(Call) } } ## (This is "cut'n'paste" similar to augPred.lme() in ./lme.R -- keep in sync!) augPred.gls <- function(object, primary = NULL, minimum = min(primary), maximum = max(primary), length.out = 51L, ...) { data <- eval(object$call$data) if (!inherits(data, "data.frame")) { stop(gettextf("data in %s call must evaluate to a data frame", sQuote(substitute(object))), domain = NA) } if(is.null(primary)) { if (!inherits(data, "groupedData")) { stop(gettextf("%s without \"primary\" can only be used with fits of \"groupedData\" objects", sys.call()[[1L]]), domain = NA) } primary <- getCovariate(data) pr.var <- getCovariateFormula(data)[[2L]] } else { pr.var <- asOneSidedFormula(primary)[[2L]] primary <- eval(pr.var, data) } prName <- c_deparse(pr.var) newprimary <- seq(from = minimum, to = maximum, length.out = length.out) groups <- getGroups(object) # much simpler here than in augPred.lme grName <- ".groups" value <- if (noGrp <- is.null(groups)) { # no groups used groups <- rep("1", length(primary)) data.frame(newprimary, rep("1", length(newprimary))) } else { ugroups <- unique(groups) data.frame(rep(newprimary, length(ugroups)), rep(ugroups, rep(length(newprimary), length(ugroups)))) } names(value) <- c(prName, grName) ## recovering other variables in data that may be needed for predictions ## varying variables will be replaced by their means summData <- gsummary(data, groups = groups) if (any(toAdd <- is.na(match(names(summData), names(value))))) { summData <- summData[, toAdd, drop = FALSE] } value[, names(summData)] <- summData[value[, 2L], ] pred <- predict(object, value) newvals <- cbind(value[, 1:2], pred) names(newvals)[3] <- respName <- deparse(resp.var <- getResponseFormula(object)[[2L]]) orig <- data.frame(primary, groups, getResponse(object)) names(orig) <- names(newvals) value <- rbind(orig, newvals) attributes(value[, 2]) <- attributes(groups) value[, ".type"] <- ordered(c(rep("original", nrow(data)), rep("predicted", nrow(newvals))), levels = c("predicted", "original")) labs <- list(x = prName, y = respName) unts <- list(x = "", y = "") if(inherits(data, "groupedData")) { labs[names(attr(data, "labels"))] <- attr(data, "labels") unts[names(attr(data, "units"))] <- attr(data, "units") } subL <- list(Y = resp.var, X = pr.var, G = as.name(grName)) structure(value, class = c("augPred", class(value)), labels = labs, units = unts, formula= if(noGrp) eval (substitute(Y ~ X, subL)) else eval(substitute(Y ~ X | G, subL))) } coef.gls <- function(object, allCoef = FALSE, ...) { val <- object$coefficients if (allCoef) { namFull <- attr(object, "namBetaFull") if (length(val) != (lF <- length(namFull))) { aux <- rep(NA, lF) names(aux) <- namFull aux[names(val)] <- val val <- aux } } val } comparePred.gls <- function(object1, object2, primary = NULL, minimum = min(primary), maximum = max(primary), length.out = 51L, level = NULL, ...) { if (length(level) > 1L) { stop("only one level allowed for predictions") } args <- list(object = object1, primary = primary, level = level, length.out = length.out) if (!is.null(primary)) { ## need to do this before forcing the evaluations primary <- eval(asOneSidedFormula(primary)[[2]], eval(object1$call$data)) args[["minimum"]] <- minimum args[["maximum"]] <- maximum } val1 <- do.call(augPred, args) dm1 <- dim(val1) c1 <- deparse(substitute(object1)) levels(val1[,4])[1] <- c1 args[["object"]] <- object2 val2 <- do.call(augPred, args) dm2 <- dim(val2) c2 <- deparse(substitute(object2)) levels(val2[, 4L])[1] <- c2 val2 <- val2[val2[, 4L] != "original", , drop = FALSE] names(val2) <- names(val1) if (dm1[1L] == dm2[1L]) { lv1 <- sort(levels(val1[, 2L])) lv2 <- sort(levels(val2[, 2L])) if ((length(lv1) != length(lv2)) || any(lv1 != lv2)) { stop(gettextf("%s and %s must have the same group levels", c1, c2), domain = NA) } val <- rbind(val1[, -4L], val2[, -4L]) val[, ".type"] <- ordered(c(as.character(val1[,4L]), as.character(val2[,4L])), levels = c(c1, c2, "original")) attr(val, "formula") <- attr(val1, "formula") } else { # one may have just "fixed" if (dm1[1L] > dm2[1L]) { mult <- dm1[1L] %/% dm2[1L] if ((length(levels(val2[, 2])) != 1L) || (length(levels(val1[, 2])) != mult)) { stop("wrong group levels") } val <- data.frame(c(val1[,1L], rep(val2[,1L], mult)), rep(val1[,1L], 2L), c(val1[,3L], rep(val2[,3L], mult)), ordered(c(as.character(val1[,4L]), rep(as.character(val2[,4L]), mult)), levels = c(c1, c2, "original"))) attr(val, "formula") <- attr(val1, "formula") } else { mult <- dm2[1L] %/% dm1[1L] if ((length(levels(val1[, 2])) != 1L) || (length(levels(val2[, 2])) != mult)) { stop("wrong group levels") } val <- data.frame(c(rep(val1[,1L], mult), val2[,1L]), rep(val2[,1L], 2L), c(rep(val1[,3L], mult), val2[,3L]), ordered(c(rep(as.character(val1[,4L]), mult), as.character(val1[,4L])), levels = c(c1, c2, "original"))) attr(val, "formula") <- attr(val2, "formula") } } class(val) <- c("comparePred", "augPred", class(val)) attr(val, "labels") <- attr(val1, "labels") attr(val, "units") <- attr(val1, "units") val } fitted.gls <- function(object, ...) { val <- napredict(object$na.action, object$fitted) lab <- "Fitted values" if (!is.null(aux <- attr(object, "units")$y)) { lab <- paste(lab, aux) } attr(val, "label") <- lab val } formula.gls <- function(x, ...) eval(x$call$model) getGroups.gls <- function(object, form, level, data, sep) object$groups getGroupsFormula.gls <- function(object, asList = FALSE, sep) { if (!is.null(cSt <- object$modelStruct$corStruct)) getGroupsFormula(cSt, asList) ## else NULL } getResponse.gls <- function(object, form) { val <- resid(object) + fitted(object) if (is.null(lab <- attr(object, "labels")$y)) { lab <- deparse(getResponseFormula(object)[[2]]) } if (!is.null(aux <- attr(object, "units")$y)) { lab <- paste(lab, aux) } attr(val, "label") <- lab val } intervals.gls <- function(object, level = 0.95, which = c("all", "var-cov", "coef"), ...) { which <- match.arg(which) val <- list() dims <- object$dims ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions fixSig <- attr(object$modelStruct, "fixedSigma") fixSig <- !is.null(fixSig) && fixSig if (which != "var-cov") { # coefficients included len <- -qt((1-level)/2, dims$N - dims$p) * sqrt(diag(object$varBeta)) est <- coef(object) val[["coef"]] <- array(c(est - len, est, est + len), c(length(est), 3L), list(names(est), c("lower", "est.", "upper"))) attr(val[["coef"]], "label") <- "Coefficients:" } if (which != "coef") { # variance-covariance included if (is.null(aV <- object$apVar)) { # only sigma Nr <- if (inherits(object, "gnls")) { #always REML-like sigma dims$N - dims$p } else { dims$N - dims$REML * dims$p } ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions if(!fixSig) { est <- object$sigma * sqrt(Nr) val[["sigma"]] <- structure(c(lower = est/sqrt(qchisq((1+level)/2, Nr)), "est."= object$sigma, upper = est/sqrt(qchisq((1-level)/2, Nr))), label = "Residual standard error:") } else { est <- 1 val[["sigma"]] <- structure(setNames(rep(object$sigma, 3), c("lower", "est.", "upper")), label = "Fixed Residual standard error:") } } else { if (is.character(aV)) { stop(gettextf("cannot get confidence intervals on var-cov components: %s", aV), domain = NA) } len <- -qnorm((1-level)/2) * sqrt(diag(aV)) est <- attr(aV, "Pars") nP <- length(est) glsSt <- object[["modelStruct"]] pmap <- attr(glsSt, "pmap") if (!all(whichKeep <- apply(pmap, 2, any))) { ## need to deleted components with fixed coefficients aux <- glsSt[whichKeep] class(aux) <- class(glsSt) attr(aux, "settings") <- attr(glsSt, "settings") attr(aux, "pmap") <- pmap[, whichKeep, drop = FALSE] glsSt <- aux } cSt <- glsSt[["corStruct"]] if (!is.null(cSt) && inherits(cSt, "corSymm") && attr(aV, "natural")) { ## converting to corNatural class(cSt) <- c("corNatural", "corStruct") glsSt[["corStruct"]] <- cSt } namG <- names(glsSt) auxVal <- vector("list", length(namG) + 1L) names(auxVal) <- c(namG, "sigma") aux <- array(c(est - len, est, est + len), c(nP, 3), list(NULL, c("lower", "est.", "upper"))) auxVal[["sigma"]] <- structure(if(!fixSig) { # last param. = log(sigma) s <- exp(aux[nP, ]) aux <- aux[-nP,, drop = FALSE] s } else c(object$sigma, object$sigma, object$sigma), label = "Residual standard error:") rownames(aux) <- names(coef(glsSt, FALSE)) for(i in 1:3) { coef(glsSt) <- aux[,i] aux[,i] <- coef(glsSt, unconstrained = FALSE) } for(i in namG) { au.i <- aux[pmap[,i], , drop = FALSE] dimnames(au.i)[[1]] <- substring(dimnames(au.i)[[1]], nchar(i, "c") + 2L) attr(au.i, "label") <- switch(i, corStruct = "Correlation structure:", varStruct = "Variance function:", paste0(i, ":")) auxVal[[i]] <- au.i } val <- c(val, auxVal) } } structure(val, level = level, class = "intervals.gls") } logLik.gls <- function(object, REML, ...) { ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions fixSig <- attr(object[["modelStruct"]], "fixedSigma") fixSig <- !is.null(fixSig) && fixSig p <- object$dims$p N <- object$dims$N Np <- N - p estM <- object$method if (missing(REML)) REML <- estM == "REML" val <- object[["logLik"]] if (REML && estM == "ML") { # have to correct logLik val <- val + (p * (log(2 * pi) + 1) + Np * log(1 - p/N) + sum(log(abs(svd.d(object$varBeta))))) / 2 } else if (!REML && (estM == "REML")) { # have to correct logLik val <- val - (p * (log(2*pi) + 1) + N * log(1 - p/N) + sum(log(abs(svd.d(object$varBeta))))) / 2 } structure(val, nall = N, nobs = N - REML * p, ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions df = p + length(coef(object[["modelStruct"]])) + as.integer(!fixSig), class = "logLik") } nobs.gls <- function(object, ...) object$dims$N plot.gls <- function(x, form = resid(., type = "pearson") ~ fitted(.), abline, id = NULL, idLabels = NULL, idResType = c("pearson", "normalized"), grid, ...) ## Diagnostic plots based on residuals and/or fitted values { plot.lme(x, form=form, abline=abline, id=id, idLabels=idLabels, idResType=idResType, grid=grid, ...) } predict.gls <- function(object, newdata, na.action = na.fail, ...) { ## ## method for predict() designed for objects inheriting from class gls ## if (missing(newdata)) { # will return fitted values return(fitted(object)) } form <- getCovariateFormula(object) mfArgs <- list(formula = form, data = newdata, na.action = na.action) mfArgs$drop.unused.levels <- TRUE dataMod <- do.call(model.frame, mfArgs) ## making sure factor levels are the same as in contrasts contr <- object$contrasts for(i in names(dataMod)) { if (inherits(dataMod[,i], "factor") && !is.null(contr[[i]])) { levs <- levels(dataMod[,i]) levsC <- dimnames(contr[[i]])[[1]] if (any(wch <- is.na(match(levs, levsC)))) { stop(sprintf(ngettext(sum(wch), "level %s not allowed for %s", "levels %s not allowed for %s"), paste(levs[wch], collapse = ",")), domain = NA) } attr(dataMod[,i], "contrasts") <- contr[[i]][levs, , drop = FALSE] ## if (length(levs) < length(levsC)) { ## if (inherits(dataMod[,i], "ordered")) { ## dataMod[,i] <- ordered(as.character(dataMod[,i]), levels = levsC) ## } else { ## dataMod[,i] <- factor(as.character(dataMod[,i]), levels = levsC) ## } ## } } } N <- nrow(dataMod) if (length(all.vars(form)) > 0) { ## X <- model.matrix(form, dataMod, contr) X <- model.matrix(form, dataMod) } else { X <- array(1, c(N, 1), list(row.names(dataMod), "(Intercept)")) } cf <- coef(object) val <- c(X[, names(cf), drop = FALSE] %*% cf) lab <- "Predicted values" if (!is.null(aux <- attr(object, "units")$y)) { lab <- paste(lab, aux) } structure(val, label = lab) } print.intervals.gls <- function(x, ...) { cat(paste0("Approximate ", attr(x, "level") * 100, "% confidence intervals\n")) for(i in names(x)) { aux <- x[[i]] cat("\n ",attr(aux, "label"), "\n", sep = "") print(if(i == "sigma") c(aux) else as.matrix(aux), ...) } invisible(x) } print.gls <- ## method for print() used for gls objects function(x, ...) { ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions fixSig <- attr(x[["modelStruct"]], "fixedSigma") fixSig <- !is.null(fixSig) && fixSig dd <- x$dims mCall <- x$call if (inherits(x, "gnls")) { cat("Generalized nonlinear least squares fit\n") } else { cat("Generalized least squares fit by ") cat(if(x$method == "REML") "REML\n" else "maximum likelihood\n") } cat(" Model:", deparse(mCall$model), "\n") cat(" Data:", deparse( mCall$data ), "\n") if (!is.null(mCall$subset)) { cat(" Subset:", deparse(asOneSidedFormula(mCall$subset)[[2]]),"\n") } if (inherits(x, "gnls")) { cat(" Log-likelihood: ", format(x$logLik), "\n", sep = "") } else { cat(" Log-", if(x$method == "REML") "restricted-" else "", "likelihood: ", format(x$logLik), "\n", sep = "") } cat("\nCoefficients:\n") print(coef(x), ...) cat("\n") if (length(x$modelStruct) > 0L) { print(summary(x$modelStruct), ...) } cat("Degrees of freedom:", dd[["N"]],"total;",dd[["N"]] - dd[["p"]], "residual\n") cat("Residual standard error:", format(x$sigma),"\n") invisible(x) } print.summary.gls <- function(x, verbose = FALSE, digits = .Options$digits, ...) { dd <- x$dims fixSig <- attr(x[["modelStruct"]], "fixedSigma") fixSig <- !is.null(fixSig) && fixSig verbose <- verbose || attr(x, "verbose") mCall <- x$call if (inherits(x, "gnls")) { cat("Generalized nonlinear least squares fit\n") } else { cat("Generalized least squares fit by ") cat(if(x$method == "REML") "REML\n" else "maximum likelihood\n") } cat(" Model:", deparse(mCall$model), "\n") cat(" Data:", deparse( mCall$data ), "\n") if (!is.null(mCall$subset)) { cat(" Subset:", deparse(asOneSidedFormula(mCall$subset)[[2]]),"\n") } print(data.frame(AIC=x$AIC, BIC=x$BIC, logLik=as.vector(x$logLik), row.names = " "), ...) if (verbose) { cat("Convergence at iteration:",x$numIter,"\n") } if (length(x$modelStruct)) { cat("\n") print(summary(x$modelStruct), ...) } cat("\nCoefficients:\n") xtTab <- as.data.frame(x$tTable) wchPval <- match("p-value", names(xtTab)) for(i in names(xtTab)[-wchPval]) { xtTab[, i] <- format(zapsmall(xtTab[, i])) } xtTab[,wchPval] <- format(round(xtTab[,wchPval], 4L)) if (any(wchLv <- (as.double(levels(xtTab[, wchPval])) == 0))) { levels(xtTab[, wchPval])[wchLv] <- "<.0001" } row.names(xtTab) <- dimnames(x$tTable)[[1]] print(xtTab, ...) if (nrow(x$tTable) > 1L) { corr <- x$corBeta class(corr) <- "correlation" print(corr, title = "\n Correlation:", ...) } cat("\nStandardized residuals:\n") print(x$residuals, ...) cat("\n") cat("Residual standard error:", format(x$sigma),"\n") cat("Degrees of freedom:", dd[["N"]],"total;", dd[["N"]] - dd[["p"]], "residual\n") invisible(x) } residuals.gls <- function(object, type = c("response", "pearson", "normalized"), ...) { type <- match.arg(type) val <- object$residuals if (type != "response") { val <- val/attr(val, "std") lab <- "Standardized residuals" if (type == "normalized") { if (!is.null(cSt <- object$modelStruct$corStruct)) { ## normalize according to inv-trans factor val <- recalc(cSt, list(Xy = as.matrix(val)))$Xy[, 1] lab <- "Normalized residuals" } } } else { lab <- "Residuals" if (!is.null(aux <- attr(object, "units")$y)) lab <- paste(lab, aux) } attr(val, "label") <- lab if (!is.null(object$na.action)) { res <- naresid(object$na.action, val) attr(res, "std") <- naresid(object$na.action, attr(val, "std")) attr(res, "label") <- attr(val, "label") res } else val } summary.gls <- function(object, verbose = FALSE, ...) { ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions fixSig <- attr(object[["modelStruct"]], "fixedSigma") fixSig <- !is.null(fixSig) && fixSig ## ## generates an object used in the print.summary method for lme ## ## variance-covariance estimates for coefficients ## stdBeta <- sqrt(diag(as.matrix(object$varBeta))) corBeta <- t(object$varBeta/stdBeta)/stdBeta ## ## coefficients, std. deviations and z-ratios ## beta <- coef(object) dims <- object$dims dimnames(corBeta) <- list(names(beta),names(beta)) object$corBeta <- corBeta tTable <- data.frame(beta, stdBeta, beta/stdBeta, beta) dimnames(tTable)<- list(names(beta),c("Value","Std.Error","t-value","p-value")) tTable[, "p-value"] <- 2 * pt(-abs(tTable[,"t-value"]), dims$N - dims$p) object$tTable <- as.matrix(tTable) ## ## residuals ## resd <- resid(object, type = "pearson") if (length(resd) > 5) { resd <- quantile(resd, na.rm = TRUE) names(resd) <- c("Min","Q1","Med","Q3","Max") } object$residuals <- resd ## ## generating the final object ## aux <- logLik(object) structure(c(object, list(BIC = BIC(aux), AIC = AIC(aux))), verbose = verbose, class = c("summary.gls", class(object))) } update.gls <- function (object, model., ..., evaluate = TRUE) { call <- object$call if (is.null(call)) stop("need an object with call component") extras <- match.call(expand.dots = FALSE)$... if (!missing(model.)) call$model <- update.formula(formula(object), model.) if(length(extras) > 0L) { ## the next two lines allow partial matching of argument names ## in the update. This is nonstandard but required for examples ## in chapter 5 of Pinheiro and Bates (2000). glsa <- names(as.list(args(gls))) names(extras) <- glsa[pmatch(names(extras), glsa[-length(glsa)])] existing <- !is.na(match(names(extras), names(call))) ## do these individually to allow NULL to remove entries. for (a in names(extras)[existing]) call[[a]] <- extras[[a]] if(any(!existing)) { call <- c(as.list(call), extras[!existing]) call <- as.call(call) } } if(evaluate) eval(call, parent.frame()) else call } Variogram.gls <- function(object, distance, form = ~1, resType = c("pearson", "response", "normalized"), data, na.action = na.fail, maxDist, length.out = 50, collapse = c("quantiles", "fixed", "none"), nint = 20, breaks, robust = FALSE, metric = c("euclidean", "maximum", "manhattan"), ...) { resType <- match.arg(resType) ## checking if object has a corSpatial element csT <- object$modelStruct$corStruct wchRows <- NULL if (missing(distance)) { if (missing(form) && inherits(csT, "corSpatial")) { distance <- getCovariate(csT) grps <- getGroups(object) } else { metric <- match.arg(metric) if (missing(data)) { data <- getData(object) } if (is.null(data)) { # will try to construct allV <- all.vars(form) if (length(allV) > 0L) { alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(as.list(quote(data.frame)), alist) mode(alist) <- "call" data <- eval(alist, sys.parent(1)) } } grpsF <- getGroupsFormula(form) grps <- NULL if (is.null(grpsF) || is.null(grps <- getGroups(data, grpsF))) { ## try to get from object grps <- getGroups(object) } covForm <- getCovariateFormula(form) covar <- if (length(all.vars(covForm)) > 0L) { if (attr(terms(covForm), "intercept") == 1L) { covForm <- eval(substitute(~ CV - 1, list(CV = covForm[[2]]))) } covar <- model.frame(covForm, data, na.action = na.action) ## making sure grps is consistent wchRows <- !is.na(match(row.names(data), row.names(covar))) if (!is.null(grps)) { grps <- grps[wchRows, drop = TRUE] } as.data.frame(unclass(model.matrix(covForm, covar))) } else if (is.null(grps)) 1:nrow(data) else data.frame(dist = unlist(tapply(rep(1, nrow(data)), grps, cumsum))) distance <- if (is.null(grps)) dist(as.matrix(covar), method = metric) else { covar <- split(covar, grps) ## getting rid of 1-observation groups covar <- covar[sapply(covar, function(el) nrow(as.matrix(el))) > 1] lapply(covar, function(el, metric) dist(as.matrix(el), method=metric), metric = metric) } } } res <- resid(object, type = resType) if (!is.null(wchRows)) { res <- res[wchRows] } if (is.null(grps)) { val <- Variogram(res, distance) } else { res <- split(res, grps) res <- res[lengths(res) > 1L] # no 1-observation groups levGrps <- levels(grps) val <- structure(vector("list", length(levGrps)), names = levGrps) for(i in levGrps) { val[[i]] <- Variogram(res[[i]], distance[[i]]) } val <- do.call(rbind, val) } if (!missing(maxDist)) { val <- val[val$dist <= maxDist, ] } collapse <- match.arg(collapse) if (collapse != "none") { # will collapse values dst <- val$dist udist <- sort(unique(dst)) ludist <- length(udist) if (!missing(breaks)) { if (min(breaks) > udist[1L]) { breaks <- c(udist[1L], breaks) } if (max(breaks) < udist[2L]) { breaks <- c(breaks, udist[2L]) } if (!missing(nint) && nint != (length(breaks) - 1L)) { stop("'nint' is not consistent with 'breaks'") } nint <- length(breaks) - 1L } if (nint < ludist) { if (missing(breaks)) { if (collapse == "quantiles") { # break into equal groups breaks <- unique(quantile(dst, seq(0, 1, 1/nint))) } else { # fixed length intervals breaks <- seq(udist[1L], udist[length(udist)], length = nint + 1) } } cutDist <- cut(dst, breaks) } else { cutDist <- dst } val <- lapply(split(val, cutDist), function(el, robust) { nh <- nrow(el) vrg <- el$variog if (robust) { vrg <- ((mean(vrg^0.25))^4)/(0.457+0.494/nh) } else { vrg <- mean(vrg) } dst <- median(el$dist) data.frame(variog = vrg, dist = dst) }, robust = robust) val <- do.call(rbind, as.list(val)) val$n.pairs <- unclass(table(na.omit(cutDist))) } row.names(val) <- 1:nrow(val) if (inherits(csT, "corSpatial") && resType != "normalized") { ## will keep model variogram sig2 <- if (resType == "pearson") 1 else object$sigma^2 attr(val, "modelVariog") <- Variogram(csT, sig2 = sig2, length.out = length.out) } structure(val, collapse = collapse != "none", class = c("Variogram", "data.frame")) } ###*### glsStruct - a model structure for gls fits glsStruct <- ## constructor for glsStruct objects function(corStruct = NULL, varStruct = NULL) { val <- list(corStruct = corStruct, varStruct = varStruct) val <- val[!vapply(val, is.null, NA)] # removing NULL components class(val) <- c("glsStruct", "modelStruct") val } ##*## glsStruct methods for standard generics fitted.glsStruct <- function(object, glsFit = attr(object, "glsFit"), ...) { glsFit[["fitted"]] } Initialize.glsStruct <- function(object, data, control = list(singular.ok = FALSE), ...) { if (length(object)) { object[] <- lapply(object, Initialize, data) theta <- lapply(object, coef) len <- lengths(theta) num <- seq_along(len) pmap <- if (sum(len) > 0) outer(rep(num, len), num, "==") else array(FALSE, c(1, length(len))) dimnames(pmap) <- list(NULL, names(object)) attr(object, "pmap") <- pmap attr(object, "glsFit") <- glsEstimate(object, control = control) if (needUpdate(object)) { object <- update(object, data) } } object } logLik.glsStruct <- function(object, Pars, conLin = attr(object, "conLin"), ...) { coef(object) <- Pars # updating parameter values conLin <- recalc(object, conLin) # updating conLin val <- .C(gls_loglik, as.double(conLin[["Xy"]]), as.integer(unlist(conLin[["dims"]])), logLik = as.double(conLin[["logLik"]]), ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions double(1L), as.double(conLin$sigma), NAOK = TRUE) val[["logLik"]] } residuals.glsStruct <- function(object, glsFit = attr(object, "glsFit"), ...) { glsFit[["resid"]] } varWeights.glsStruct <- function(object) { if (is.null(object$varStruct)) rep(1, attr(object, "conLin")$dims$N) else varWeights(object$varStruct) } ## Auxiliary control functions glsControl <- ## Control parameters for gls function(maxIter = 50L, msMaxIter = 200L, tolerance = 1e-6, msTol = 1e-7, msVerbose = FALSE, singular.ok = FALSE, returnObject = FALSE, apVar = TRUE, .relStep = .Machine$double.eps^(1/3), opt = c("nlminb", "optim"), optimMethod = "BFGS", minAbsParApVar = 0.05, natural = TRUE, sigma = NULL) { ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions if(is.null(sigma)) sigma <- 0 else { if(!is.finite(sigma) || length(sigma) != 1 || sigma < 0) stop("Within-group std. dev. must be a positive numeric value") ## if(missing(apVar)) apVar <- FALSE # not yet implemented } list(maxIter = maxIter, msMaxIter = msMaxIter, tolerance = tolerance, msTol = msTol, msVerbose = msVerbose, singular.ok = singular.ok, returnObject = returnObject, apVar = apVar, minAbsParApVar = minAbsParApVar, .relStep = .relStep, opt = match.arg(opt), optimMethod = optimMethod, natural = natural, sigma = sigma) } nlme/R/modelStruct.R0000644000176200001440000000471612675271210014051 0ustar liggesusers### modelStruct - a virtual class of model structures ### ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates ### Copyright 2007-2016 The R Core team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # ### Constructor ### There is no constructor function for this class (i.e. no function ### called modelStruct) because the class is virtual. ### Objects inheriting from this class are required to have a "conLin" ### (condensed linear model) attribute and a "pmap" (parameter map) ### attribute ###*# Methods for standard generics coef.modelStruct <- function(object, unconstrained = TRUE, ...) { unlist(lapply(object, coef, unconstrained)) } "coef<-.modelStruct" <- function(object, ..., value) { value <- as.numeric(value) parMap <- attr(object, "pmap") for(i in names(object)) { if (any(parMap[,i])) { coef(object[[i]]) <- value[parMap[,i]] } } object } formula.modelStruct <- function(x, ...) { lapply(x, formula) } needUpdate.modelStruct <- function(object) any(unlist(lapply(object, needUpdate))) print.modelStruct <- function(x, ...) { for(i in names(x)) { if ((length(aux <- coef(x[[i]]))) > 0) { cat(paste(i, " parameters:\n")) print(aux, ...) } } invisible(x) } print.summary.modelStruct <- function(x, ...) { lapply(x, print, ...) invisible(x) } recalc.modelStruct <- function(object, conLin = attr(object, "conLin"), ...) { for(i in rev(seq_along(object))) { conLin <- recalc(object[[i]], conLin) NULL } conLin } summary.modelStruct <- function(object, ...) { value <- lapply(object, summary) class(value) <- "summary.modelStruct" value } ## will not work as it is. fitted needs more than one argument! update.modelStruct <- function(object, data, ...) { if (needUpdate(object)) { object[] <- lapply(object, update, c(list("." = object), as.list(data))) } object } nlme/R/reStruct.R0000644000176200001440000003215113422625274013355 0ustar liggesusers### Methods for the class of random-effects structures. ### ### Copyright 2006-2019 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # ##*## Generics that should be implemented for any reStruct class ###*# Constructor reStruct <- function(object, pdClass = "pdLogChol", REML = FALSE, data = sys.frame(sys.parent())) { ## object can be: ## 1) a named list of formulas or pdMats with grouping factors as names ## (assume same order of nesting as order of names) ## 2) a formula of the form ~ x | g or ~ x | g1/g2/../gn ## 3) a list of formulas like ~x | g ## 4) a formula like ~x, a pdMat object, or a list of such ## formulas or objects . In this case, the data used to ## initialize the reStruct will be required to inherit from class ## "groupedData" ## 5) another reStruct object ## parametrization specifies the pdMat constructor to be used for all ## formulas used in object if (inherits(object, "reStruct")) { # little to do, return object if (!missing(REML)) attr(object, "settings")[1] <- as.integer(REML) object[] <- lapply(object, function(el, data) { pdMat(el, data = data) }, data = data) return(object) } plen <- NULL if (inherits(object, "formula")) { # given as a formula if (is.null(grpForm <- getGroupsFormula(object, asList = TRUE))) { object <- list( object ) } else { if (length(object) == 3) { # nlme type of formula object <- eval(parse(text = paste(deparse(getResponseFormula(object)[[2]]), deparse(getCovariateFormula(object)[[2]], width.cutoff=500), sep = "~"))) } else { object <- getCovariateFormula(object) } object <- rep( list(object), length( grpForm ) ) names( object ) <- names( grpForm ) } } else if (inherits(object, "pdMat")) { # single group, as pdMat if (is.null(formula(object))) { stop("\"pdMat\" element must have a formula") } object <- list(object) } else { if (data.class(object) != "list") { stop("'object' must be a list or a formula") } ## checking if nlme-type list - unnamed list of 2-sided formulas if (is.null(names(object)) && all(unlist(lapply(object, function(el) { inherits(el, "formula") && length(el) == 3})))) { object <- list(object) } else { ## checking if elements are valid object <- lapply(object, function(el) { if (inherits(el, "pdMat")) { if (is.null(formula(el))) { stop("\"pdMat\" elements must have a formula") } return(el) } if (inherits(el, "formula")) { grpForm <- getGroupsFormula(el) if (!is.null(grpForm)) { el <- getCovariateFormula(el) attr(el, "grpName") <- deparse(grpForm[[2]]) } return(el) } else { if (data.class(el) == "list" && all(unlist(lapply(el, function(el1) { inherits(el1, "formula") && length(el1) == 3 })))) { return(el) } else { stop("elements in 'object' must be formulas or \"pdMat\" objects") } } }) } if (is.null(namObj <- names(object))) { namObj <- rep("", length(object)) } aux <- unlist(lapply(object, function(el) { if (inherits(el, "formula") && !is.null(attr(el, "grpName"))) { attr(el, "grpName") } else "" })) auxNam <- namObj == "" if (any(auxNam)) { namObj[auxNam] <- aux[auxNam] } names(object) <- namObj } ## converting elements in object to pdMat objects object <- lapply(object, function(el, pdClass, data) { # if (data.class(el) == "pdSymm") # warning("class pdSymm may cause problems if using analytic gradients") pdMat(el, pdClass = pdClass, data = data) }, pdClass = pdClass, data = data) object <- rev(object) # inner to outer groups if (all(unlist(lapply(object, isInitialized)))) { plen <- unlist(lapply(object, function(el) length(coef(el)))) } pC <- unlist(lapply(object, data.class)) pC <- match(pC, c("pdSymm", "pdDiag", "pdIdent", "pdCompSymm", "pdLogChol"), 0) - 1 # if (any(pC == -1)) { # multiple nesting # pC <- -1 # } ## at this point, always require asDelta = TRUE and gradHess = 0 attr(object, "settings") <- c(as.integer(REML), 1, 0, pC) attr(object, "plen") <- plen class(object) <- "reStruct" object } ###*# Methods for pdMat generics corMatrix.reStruct <- function(object, ...) { if (!isInitialized(object)) { stop("cannot access the matrix of uninitialized objects") } as.list(rev(lapply(object, corMatrix))) } pdFactor.reStruct <- function(object) { unlist(lapply(object, pdFactor)) } pdMatrix.reStruct <- function(object, factor = FALSE) { if (!isInitialized(object)) { stop("cannot access the matrix of uninitialized objects") } as.list(rev(lapply(object, pdMatrix, factor))) } ###*# Methods for standard generics as.matrix.reStruct <- function(x, ...) pdMatrix(x) coef.reStruct <- function(object, unconstrained = TRUE, ...) { unlist(lapply(object, coef, unconstrained)) } "coef<-.reStruct" <- function(object, ..., value) { if (is.null(plen <- attr(object, "plen"))) { stop("cannot change the parameter when ength of parameters is undefined") } if (length(value) != sum(plen)) { stop("cannot change parameter length of initialized objects") } ends <- cumsum(plen) starts <- 1 + c(0, ends[-length(ends)]) for (i in seq_along(object)) { coef(object[[i]]) <- value[(starts[i]):(ends[i])] } object } formula.reStruct <- function(x, asList = FALSE, ...) { as.list(lapply(x, formula, asList)) } getGroupsFormula.reStruct <- function(object, asList = FALSE, sep) { if (is.null(val <- rev(formula(object)))) { stop("cannot extract groups formula without a formula") } if (is.null(nVal <- names(val))) return(NULL) if (asList) { for(i in nVal) { val[[i]] <- eval(parse(text = paste("~",i))) } } else { val <- eval(parse(text = paste("~",paste(nVal, collapse = "/")))) } val } isInitialized.reStruct <- function(object) all(unlist(lapply(object, isInitialized))) Initialize.reStruct <- function(object, data, conLin, control = list(niterEM = 20), ...) { ## initialize reStruct object, possibly getting initial estimates seqO <- seq_along(object) ## check if names are defined lNams <- unlist(lapply(object, function(el) length(Names(el)))) == 0 if (any(lNams)) { # need to resolve formula names aux <- seqO[lNams] object[aux] <- lapply(object[aux], function(el, data) { pdConstruct(el, el, data = data) }, data = data) } ## obtaining the parameters mapping plen <- unlist(lapply(object, function(el) { if (isInitialized(el)) { length(coef(el)) } else { matrix(el) <- diag(length(Names(el))) length(coef(el)) } })) if (!all(plen > 0)) { stop("all elements of a \"reStruct\" object must have a non-zero size") } attr(object, "plen") <- plen ## checking initialization isIni <- unlist(lapply(object, isInitialized)) if (!all(isIni)) { # needs initialization dims <- conLin$dims Q <- dims$Q qvec <- dims$qvec[1:Q] auxInit <- lapply(split(0.375^2 * apply((conLin$Xy[, 1:sum(qvec), drop = FALSE])^2, 2, sum)/ rep(dims$ngrps[1:Q], qvec), rep(1:Q, qvec)), function(x) diag(x, length(x))) } for(i in seqO) { if (isIni[i]) { object[[i]] <- solve(object[[i]]) #working with precisions } else { matrix(object[[i]]) <- auxInit[[i]] } NULL } MEEM(object, conLin, control$niterEM) # refine initial estimates with EM } logDet.reStruct <- function(object, ...) vapply(object, logDet, numeric(1)) logLik.reStruct <- function(object, conLin, ...) { if(any(!is.finite(conLin$Xy))) return(-Inf) ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions dims <- conLin$dims settings <- as.integer(attr(object, "settings")) REML <- settings[1] val <- .C(mixed_loglik, as.double(conLin$Xy), as.integer(unlist(conLin$dims)), as.double(pdFactor(object)), settings, loglik = double(1), lRSS = double(1), as.double(conLin$sigma)) if (conLin$sigma > 0 && REML == 1) { ## nc <- dims$ncol; p <- nc[dims$Q + 1] N <- dims$N aux <- N * log(conLin$sigma) - exp(val[["lRSS"]]) / (2*conLin$sigma) val[["loglik"]] + aux } else { val[["loglik"]] } } "matrix<-.reStruct" <- function(object, value) { if (data.class(value) != "list") value <- list(value) if (length(value) != length(object)) { stop("cannot change the length of 'object'") } value <- rev(value) # same order as object for(i in seq_along(object)) { matrix(object[[i]]) <- value[[i]] } object } model.matrix.reStruct <- function(object, data, contrast = NULL, ...) { if (is.null(form <- formula(object, asList = TRUE))) { stop("cannot extract model matrix without formula") } form1 <- asOneFormula(form) if (length(form1) > 0) { data <- model.frame(form1, data = data) } else { data <- data.frame("(Intercept)" = rep(1, nrow(data))) } any2list <- function( object, data, contrast ) { form2list <- function(form, data, contrast) { if (length(asOneFormula( form )) == 0) {# the ~ 1 case return(list("(Intercept)" = rep(1, dim(data)[1]))) } as.data.frame(unclass(model.matrix(form, model.frame(form, data), contrast))) } if (inherits( object, "formula" )) { return( form2list( object, data, contrast ) ) } if (is.list( object ) ) { return( unlist(lapply(object, form2list, data = data, contrast = contrast), recursive = FALSE ) ) } return( NULL) } value <- as.list(lapply(form, any2list, data = data, contrast = contrast)) ## save the contrasts currently in effect for later predictions contr <- as.list(lapply( as.data.frame(data), function(x) if( inherits( x, "factor" ) && length(levels(x)) > 1) contrasts(x) else NULL )) contr[names(contrast)] <- contrast ncols <- lengths(value) nams <- if (length(value) == 1) { names(value[[1]]) } else { paste(rep(names(value), ncols), unlist(lapply(value, names)), sep = ".") } structure(matrix(unlist(value), nrow = nrow(data), dimnames = list(row.names(data), nams)), ncols = ncols, nams = lapply(value, names), contr = contr) } Names.reStruct <- function(object, ...) { as.list(lapply(object, Names)) } "Names<-.reStruct" <- function(object, ..., value) { if (length(object) != length(value)) { stop("incompatible lengths for object names") } for(i in seq_along(object)) { Names(object[[i]]) <- value[[i]] } object } needUpdate.reStruct <- function(object) FALSE print.reStruct <- function(x, sigma = 1, reEstimates, verbose = FALSE, ...) { ox <- x if (isInitialized(x)) { nobj <- length(x) if (is.null(names(x))) names(x) <- nobj:1 aux <- t(array(rep(names(x), nobj), c(nobj, nobj))) aux[lower.tri(aux)] <- "" x[] <- rev(x) names(x) <- rev(apply(aux, 1, function(x) paste(x[x != ""], collapse = " %in% "))) cat("Random effects:\n") for(i in seq_along(x)) { print(summary(x[[i]]), sigma, Level = names(x)[i], resid = (i == length(x)), ...) if (verbose) { cat("Random effects estimates:\n") print(reEstimates[[i]]) } cat("\n") } } else { cat("Uninitialized random effects structure\n") } invisible(ox) } recalc.reStruct <- function(object, conLin, ...) { conLin[["logLik"]] <- conLin[["logLik"]] + logLik(object, conLin) conLin } solve.reStruct <- function(a, b, ...) { a[] <- lapply(a, solve) a } summary.reStruct <- function(object, ...) object update.reStruct <- function(object, data, ...) object "[.reStruct" <- function(x, ...) { val <- NextMethod() if (length(val)) class(val) <- "reStruct" val } nlme/R/pdMat.R0000644000176200001440000016717613037375413012626 0ustar liggesusers### Classes of positive-definite matrices ### ### Copyright 2006-2017 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # pdConstruct <- ## a virtual constructor for these objects function(object, value, form, nam, data, ...) UseMethod("pdConstruct") pdFactor <- function(object) UseMethod("pdFactor") pdMatrix <- ## extractor for the pd, correlation, or square-root factor matrix function(object, factor = FALSE) UseMethod("pdMatrix") ##*## pdMat - a virtual class of positive definite matrices ###*# constructor for the virtual class pdMat <- function(value = numeric(0), form = NULL, nam = NULL, data = sys.frame(sys.parent()), pdClass = "pdSymm") { if (inherits(value, "pdMat")) { # nothing to construct pdClass <- class(value) } object <- numeric(0) class(object) <- unique(c(pdClass, "pdMat")) pdConstruct(object, value, form, nam, data) } ###*# Methods for local generics corMatrix.pdMat <- function(object, ...) { if (!isInitialized(object)) { stop("cannot access the matrix of uninitialized objects") } Var <- pdMatrix(object) if (length(unlist(dimnames(Var))) == 0) { aux <- paste("V", 1:(Dim(Var)[2]), sep = "") dimnames(Var) <- list(aux, aux) } dd <- dim(Var) dn <- dimnames(Var) stdDev <- sqrt(diag(Var)) names(stdDev) <- colnames(Var) value <- array(t(Var/stdDev)/stdDev, dd, dn) attr(value, "stdDev") <- stdDev value } pdConstruct.pdMat <- function(object, value = numeric(0), form = formula(object), nam = Names(object), data = sys.frame(sys.parent()), ...) { if (inherits(value, "pdMat")) { # constructing from another pdMat if (length(form) == 0) { form <- formula(value) } if (length(nam) == 0) { nam <- Names(value) } if (isInitialized(value)) { return(pdConstruct(object, as.matrix(value), form, nam, data)) } else { return(pdConstruct(object, form = form, nam = nam, data = data)) } } if (length(value) > 0) { if (inherits(value, "formula") || data.class(value) == "call") { ## constructing from a formula if (!is.null(form)) { warning("ignoring argument 'form'") } form <- formula(value) if (length(form) == 3) { #two-sided case - nlme form <- list(form) } } else if (is.character(value)) { # constructing from character array if (length(nam) > 0) { warning("ignoring argument 'nam'") } nam <- value } else if (is.matrix(value)) { # constructing from a pd matrix vdim <- dim(value) if (length(vdim) != 2 || diff(vdim) != 0) { stop("'value' must be a square matrix") } if (length(unlist(vnam <- dimnames(value))) > 0) { vnam <- unique(unlist(vnam)) if (length(vnam) != vdim[1]) { stop("dimnames of 'value' must match or be NULL") } dimnames(value) <- list(vnam, vnam) if (length(nam) > 0) { # check consistency if (any(is.na(match(nam, vnam))) || any(is.na(match(vnam, nam)))) { stop("names of 'value' are not consistent with 'nam' argument") } value <- value[nam, nam, drop = FALSE] } else { nam <- vnam } } form <- form # avoid problems with lazy evaluation nam <- nam object <- chol((value + t(value))/2) # ensure it is positive-definite attr(object, "dimnames") <- NULL attr(object, "rank") <- NULL } else if (is.numeric(value)) { # constructing from the parameter value <- as.numeric(value) attributes(value) <- attributes(object) object <- value } else if (data.class(value) == "list") { ## constructing from a list of two-sided formulae - nlme case if (!is.null(form)) { warning("ignoring argument 'form'") } form <- value } else { stop(gettextf("%s is not a valid object for \"pdMat\"", sQuote(deparse(object))), domain = NA) } } if (!is.null(form)) { if (inherits(form, "formula") && length(form) == 3) {#two-sided case - nlme form <- list(form) } if (is.list(form)) { # list of formulae if (any(!unlist(lapply(form, function(el) { inherits(el, "formula") && length(el) == 3 })))) { stop("all elements of 'form' list must be two-sided formulas") } val <- list() for(i in seq_along(form)) { if (is.name(form[[i]][[2]])) { val <- c(val, list(form[[i]])) } else { val <- c(val, eval(parse(text = paste("list(", paste(paste(all.vars(form[[i]][[2]]), deparse(form[[i]][[3]]), sep = "~"), collapse=","),")")))) } } form <- val class(form) <- "listForm" namesForm <- Names(form, data) } else { if (inherits(form, "formula")) { namesForm <- Names(asOneSidedFormula(form), data) ## namesForm1 <- NULL } else { stop("'form' can only be a formula or a list of formulae") } } if (length(namesForm) > 0) { if (length(nam) == 0) { # getting names from formula nam <- namesForm } else { # checking consistency with names if (any(noMatch <- is.na(match(nam, namesForm)))) { err <- TRUE namCopy <- nam indNoMatch <- seq_along(nam)[noMatch] if (any(wch1 <- (nchar(nam, "c") > 12))) { ## possibly names with .(Intercept) in value wch1 <- substring(nam, nchar(nam, "c")-10) == "(Intercept)" if (any(wch1)) { namCopy[indNoMatch[wch1]] <- substring(nam[wch1], 1, nchar(nam[wch1], "c") - 12) noMatch[wch1] <- FALSE indNoMatch <- indNoMatch[!wch1] # possibly not matched } } if (sum(noMatch) > 0) { ## still no matches - try adding .(Intercept) namCopy[indNoMatch] <- paste(namCopy[indNoMatch], "(Intercept)", sep = ".") } ## try matching modified value if (!any(is.na(match(namCopy, namesForm)))) { err <- FALSE } if (err) stop("'form' not consistent with 'nam'") } } } } if (is.matrix(object)) { # initialized as matrix, check consistency if (length(nam) > 0 && (length(nam) != dim(object)[2])) { stop("length of 'nam' not consistent with dimensions of initial value") } } attr(object, "formula") <- form attr(object, "Dimnames") <- list(nam, nam) object } pdFactor.pdMat <- function(object) { c(qr.R(qr(pdMatrix(object)))) } pdMatrix.pdMat <- function(object, factor = FALSE) { if (!isInitialized(object)) { stop("cannot access the matrix of uninitialized objects") } if (factor) { stop("no default method for extracting the square root of a \"pdMat\" object") } else { crossprod(pdMatrix(object, factor = TRUE)) } } ###*# Methods for standard generics as.matrix.pdMat <- function(x, ...) pdMatrix(x) coef.pdMat <- function(object, unconstrained = TRUE, ...) { if (unconstrained || !isInitialized(object)) { as.vector(object) } else { stop("do not know how to obtain constrained coefficients") } } "coef<-.pdMat" <- function(object, ..., value) { value <- as.numeric(value) if (isInitialized(object)) { if (length(value) != length(object)) { stop("cannot change the length of the parameter after initialization") } } else { return(pdConstruct(object, value)) } class(value) <- class(object) attributes(value) <- attributes(object) value } Dim.pdMat <- function(object, ...) { if ((val <- length(Names(object))) > 0) c(val, val) else if (isInitialized(object)) dim(as.matrix(object)) else stop("cannot access the number of columns of uninitialized objects without names") } formula.pdMat <- function(x, asList, ...) eval(attr(x, "formula")) isInitialized.pdMat <- function(object) length(object) > 0 logDet.pdMat <- function(object, ...) { if (!isInitialized(object)) stop("cannot extract the log of the determinant from an uninitialized object") sum(log(svd.d(pdMatrix(object, factor = TRUE)))) } `matrix<-.pdMat` <- function(object, value) { value <- as.matrix(value) ## check for consistency of dimensions when object is initialized if (isInitialized(object) && any(dim(value) != Dim(object))) { stop("cannot change dimensions on an initialized \"pdMat\" object") } pdConstruct(object, value) } Names.pdMat <- function(object, ...) { as.character(attr(object, "Dimnames")[[2]]) } `Names<-.pdMat` <- function(object, ..., value) { if (is.null(value)) { attr(object, "Dimnames") <- NULL return(object) } else { value <- as.character(value) if (length(dn <- Names(object)) == 0) { if (isInitialized(object)) { # object is initialized without names if (length(value) != (aux <- Dim(object)[2])) { stop(gettextf("Length of names should be %d", aux), domain = NA) } } attr(object, "Dimnames") <- list(value, value) return(object) } if (length(dn) != length(value)) { stop(gettextf("Length of names should be %d", length(dn)), domain = NA) } err <- FALSE if (any(noMatch <- is.na(match(value, dn)))) { err <- TRUE ## checking nlme case valueCopy <- value indNoMatch <- seq_along(value)[noMatch] nam1 <- value[noMatch] # no matching names if (any(wch1 <- (nchar(nam1, "c") > 12))) { ## possibly names with .(Intercept) in value wch1 <- substring(nam1, nchar(nam1, "c")-10) == "(Intercept)" if (any(wch1)) { valueCopy[indNoMatch[wch1]] <- substring(nam1[wch1], 1, nchar(nam1[wch1], "c") - 12) noMatch[wch1] <- FALSE indNoMatch <- indNoMatch[!wch1] # possibly not matched } } if (sum(noMatch) > 0) { ## still no matches - try adding .(Intercept) valueCopy[indNoMatch] <- paste(valueCopy[indNoMatch], "(Intercept)", sep = ".") } ## try matching modified value indMatch <- match(valueCopy, dn) if (!any(is.na(indMatch))) { # all match attr(object, "Dimnames") <- list(value, value) if ((length(indMatch)) > 1 && any(diff(indMatch) != 1) && isInitialized(object)) { # permutation auxMat <- as.matrix(object)[indMatch, indMatch, drop = FALSE] dimnames(auxMat) <- list(value, value) return(pdConstruct(object, auxMat)) } return(object) } } if (err) { stop("names being assigned do not correspond to a permutation of previous names") } indMatch <- match(value, dn) if ((length(indMatch) == 1) || all(diff(indMatch) == 1)) { return(object) } ## must be a permutation of names attr(object, "Dimnames") <- list(value, value) if (isInitialized(object)) { auxMat <- as.matrix(object)[indMatch, indMatch, drop = FALSE] dimnames(auxMat) <- list(value, value) return(pdConstruct(object, auxMat)) } object } } plot.pdMat <- function(x, nseg = 50, levels = 1, center = rep(0, length(stdDev)), additional, ...) { corr <- corMatrix(x) stdDev <- attr(corr, "stdDev") attr(corr, "stdDev") <- NULL assign(".corr", corr) assign(".angles", seq(-pi, pi, length = nseg + 1)) assign(".cosines", cos(.angles)) nlev <- length(levels) dataMat <- array(aperm(outer(rbind(-stdDev, stdDev), levels), c(1, 3, 2)), dim = c(nlev * 2, length(stdDev)), dimnames = list(NULL, names(stdDev))) groups <- rep(1:nlev, rep(2, nlev)) dataMat <- t(t(dataMat) + center) if (!missing(additional)) { additional <- as.matrix(additional) dataMat <- rbind(dataMat, additional) groups <- c(groups, rep(0, nrow(additional))) } splom(~ dataMat, panel = function(x, y, subscripts, groups, ...) { groups <- groups[subscripts] # should be a no-op but if (any(g0 <- groups == 0)) { # plot as points panel.xyplot(x[g0], y[g0], ..., type = "p") } g1 <- groups == 1 # plot the center points panel.xyplot(mean(x[g1]), mean(y[g1]), ..., type = "p", pch = 3) p <- ncol(.corr) laggedCos <- cos(.angles + acos(.corr[round(mean(x[g1])*p + 0.5), round(mean(y[g1])*p + 0.5)])) xylist <- lapply(split(data.frame(x = x[!g0], y = y[!g0]), groups[!g0]), function(el, lagged) { if (nrow(el) != 2) { stop("x-y data to splom got botched somehow") } sumDif <- array(c(1,1,1,-1)/2, c(2,2)) %*% as.matrix(el) list(x = sumDif[1,1] + .cosines * sumDif[2,1], y = sumDif[1,2] + lagged * sumDif[2,2]) }, lagged = laggedCos) gg <- rep(seq_along(xylist), rep(length(.angles), length(xylist))) panel.superpose(unlist(lapply(xylist, `[[`, "x")), unlist(lapply(xylist, `[[`, "y")), subscripts = seq_along(gg), groups = gg, ..., type = "l") }, subscripts = TRUE, groups = groups) } print.pdMat <- function(x, ...) { if (isInitialized(x)) { cat("Positive definite matrix structure of class", class(x)[1], "representing\n") print(as.matrix(x), ...) } else { cat("Uninitialized positive definite matrix structure of class ", class(x)[1], ".\n", sep = "") } invisible(x) } print.summary.pdMat <- function(x, sigma = 1, rdig = 3, Level = NULL, resid = FALSE, ...) ## resid = TRUE causes an extra row to be added { if (!is.list(x)) { if (!(is.null(form <- attr(x, "formula")))) { cat(paste(" Formula: ")) if (inherits(form, "formula")) { cat(deparse(form)) if (!is.null(Level)) { cat( paste( " |", Level ) ) } } else { if (length(form) == 1) { cat(deparse(form[[1]])) if (!is.null(Level)) { cat( paste( " |", Level ) ) } } else { cat(deparse(lapply(form, function(el) as.name(deparse(el))))) cat("\n Level:", Level) } } cat( "\n" ) } if (ncol(x) == 1) { if (resid) { print(array(sigma * c(attr(x, "stdDev"), 1), c(1, 2), list("StdDev:", c(names(attr(x, "stdDev")), "Residual"))), ... ) } else { print(array(sigma * attr(x, "stdDev"), c(1,1), list("StdDev:", names(attr(x, "stdDev")))), ... ) } } else { cat(paste(" Structure: ", attr(x, "structName"), "\n", sep = "")) if (attr(x, "noCorrelation") | (1 >= (p <- dim(x)[2]))) { if (resid) { print(array(sigma * c(attr(x, "stdDev"), 1), c(1, p + 1), list("StdDev:", c(names(attr(x, "stdDev")), "Residual"))), ...) } else { print(array(sigma * attr(x, "stdDev"), c(1, p), list("StdDev:", names(attr(x, "stdDev")))), ...) } } else { # we essentially do print.correlation here ll <- lower.tri(x) stdDev <- attr(x, "stdDev") x[ll] <- format(round(x[ll], digits = rdig), ...) x[!ll] <- "" xx <- array("", dim(x), list(names(attr(x, "stdDev")), c("StdDev", "Corr", rep("", p - 2)))) xx[, 1] <- format(sigma * attr(x, "stdDev")) xx[-1, -1] <- x[ -1, -p ] if (!is.null(colnames(x))) { xx[1, -1] <- abbreviate(colnames(x)[ -p ], minlength = rdig + 3) } if (resid) { x <- array("", dim(xx) + c(1, 0), list(c(rownames(xx), "Residual"), colnames(xx))) x[ 1:p, ] <- xx x[ , 1 ] <- format(sigma * c(stdDev, 1)) xx <- x } print( xx, ..., quote = FALSE ) } } } else { # composite structure cat(paste(" Composite Structure: ", attr(x, "structName"), "\n", sep ="")) elName <- attr(x, "elementName") compNames <- names(x) for (i in seq_along(x)) { cat(paste("\n ", elName, " ", i, ": ", compNames[i], "\n", sep = "")) print.summary.pdMat(x[[i]], sigma = sigma, Level = Level, resid = resid && (i == length(x)), ...) } } invisible(x) } solve.pdMat <- function(a, b, ...) { if (!isInitialized(a)) { stop("cannot get the inverse of an uninitialized object") } matrix(a) <- solve(as.matrix(a)) a } summary.pdMat <- function(object, structName = class(object)[1], noCorrelation = FALSE, ...) { if (isInitialized(object)) { value <- corMatrix(object) attr(value, "structName") <- structName attr(value, "noCorrelation") <- noCorrelation attr(value, "formula") <- formula(object) class(value) <- "summary.pdMat" value } else { object } } "[.pdMat" <- function(x, i, j, drop = TRUE) { xx <- x x <- as.matrix(x) if (missing(i)) li <- 0 else li <- length(i) if (missing(j)) lj <- 0 else lj <- length(j) if ((li + lj == 0) || (li == lj) && ((mode(i) == mode(j)) && all(i == j))) { drop <- FALSE # even for a 1 by 1 submatrix, # you want it to be a matrix pdConstruct(xx, NextMethod()) } else { NextMethod() } } "[<-.pdMat" <- function(x, i, j, value) { xx <- x x <- as.matrix(x) pdConstruct(xx, NextMethod()) } ##*## Classes that substitute for (i.e. inherit from) pdMat ###*# pdSymm - a class of general pd matrices ####* Constructor pdSymm <- ## Constructor for the pdSymm class function(value = numeric(0), form = NULL, nam = NULL, data = parent.frame()) { object <- numeric(0) class(object) <- c("pdSymm", "pdMat") pdConstruct(object, value, form, nam, data) } ####* Methods for local generics pdConstruct.pdSymm <- function(object, value = numeric(0), form = formula(object), nam = Names(object), data = sys.frame(sys.parent()), ...) { val <- NextMethod() if (length(val) == 0) { # uninitialized object class(val) <- c("pdSymm", "pdMat") return(val) } if (is.matrix(val)) { vald <- svd(val, nu = 0) object <- vald$v %*% (log(vald$d) * t(vald$v)) value <- object[row(object) <= col(object)] attributes(value) <- attributes(val)[names(attributes(val)) != "dim"] class(value) <- c("pdSymm", "pdMat") return(value) } Ncol <- round((sqrt(8*length(val) + 1) - 1)/2) if (length(val) != round((Ncol * (Ncol + 1))/2)) { stop(gettextf("an object of length %d does not match the required parameter size", length(val)), domain = NA) } class(val) <- c("pdSymm", "pdMat") val } pdFactor.pdSymm <- function(object) { Ncol <- round((-1 + sqrt(1 + 8 * length(object))) / 2) .C(matrixLog_pd, Factor = double(Ncol * Ncol), as.integer(Ncol), as.double(object))$Factor } pdMatrix.pdSymm <- function(object, factor = FALSE) { if (!isInitialized(object)) stop("cannot extract matrix from an uninitialized object") if (factor) { Ncol <- Dim(object)[2] value <- array(pdFactor(object), c(Ncol, Ncol), attr(object, "Dimnames")) attr(value, "logDet") <- sum(log(abs(svd.d(value)))) value } else { NextMethod() } } ####* Methods for standard generics coef.pdSymm <- function(object, unconstrained = TRUE, ...) { if (unconstrained || !isInitialized(object)) NextMethod() else { # upper triangular elements val <- as.matrix(object) aN <- Names(object) aN1 <- paste("cov(", aN, sep ="") aN2 <- paste(aN, ")", sep ="") aNmat <- t(outer(aN1, aN2, paste, sep = ",")) aNmat[row(aNmat) == col(aNmat)] <- paste("var(",aN,")",sep="") val <- val[row(val) <= col(val)] names(val) <- aNmat[row(aNmat) <= col(aNmat)] val } } Dim.pdSymm <- function(object, ...) { if (isInitialized(object)) { val <- round((sqrt(8*length(object) + 1) - 1)/2) c(val, val) } else { NextMethod() } } logDet.pdSymm <- function(object, ...) { if (!isInitialized(object)) { stop("cannot extract the log of the determinant from an uninitialized object") } attr(pdMatrix(object, factor = TRUE), "logDet") } solve.pdSymm <- function(a, b, ...) { if (!isInitialized(a)) { stop("cannot extract the inverse from an uninitialized object") } coef(a) <- -coef(a, TRUE) a } summary.pdSymm <- function(object, structName = "General positive-definite", ...) { summary.pdMat(object, structName) } ### No need to implement other methods as the methods for pdMat ### are sufficient. ###*# pdLogChol - a general positive definite structure parameterized ### by the non-zero elements of the Cholesky factor with the diagonal ### elements given in the logarithm scale. ####* Constructor pdLogChol <- ## Constructor for the pdLogChol class function(value = numeric(0), form = NULL, nam = NULL, data = sys.parent()) { object <- numeric(0) class(object) <- c("pdLogChol", "pdMat") pdConstruct(object, value, form, nam, data) } ####* Methods for local generics pdConstruct.pdLogChol <- function(object, value = numeric(0), form = formula(object), nam = Names(object), data = sys.parent(), ...) { val <- pdConstruct.pdMat(object, value, form, nam, data) if (length(val) == 0) { # uninitialized object class(val) <- c("pdLogChol", "pdSymm", "pdMat") return(val) } if (is.matrix(val)) { value <- c(log(diag(val)), val[row(val) < col(val)]) attributes(value) <- attributes(val)[names(attributes(val)) != "dim"] class(value) <- c("pdLogChol", "pdSymm", "pdMat") return(value) } Ncol <- round((sqrt(8*length(val) + 1) - 1)/2) if (length(val) != round((Ncol * (Ncol + 1))/2)) { stop(gettextf("an object of length %d does not match a Cholesky factor", length(val)), domain = NA) } class(val) <- c("pdLogChol", "pdSymm", "pdMat") val } pdFactor.pdLogChol <- function(object) { Ncol <- round((-1 + sqrt(1 + 8 * length(object))) / 2) .C(logChol_pd, Factor = double(Ncol * Ncol), as.integer(Ncol), as.double(object))$Factor } ####* Methods for standard generics solve.pdLogChol <- function(a, b, ...) { if (!isInitialized(a)) { stop("cannot get the inverse of an uninitialized object") } # Ncol <- (-1 + sqrt(1 + 8 * length(a))) / 2 # val <- array(.Fortran("dbksl", # as.double(pdFactor(a)), # as.integer(Ncol), # as.integer(Ncol), # val = as.double(diag(Ncol)), # as.integer(Ncol), # integer(1))[["val"]], c(Ncol, Ncol)) # val <- qr(t(val))$qr val <- qr(t(solve(pdMatrix(a, factor = TRUE))))$qr val <- sign(diag(val)) * val coef(a) <- c(log(diag(val)), val[c(row(val) < col(val))]) a } summary.pdLogChol <- function(object, structName = "General positive-definite, Log-Cholesky parametrization", ...) { summary.pdMat(object, structName) } ### No need to implement other methods as the methods for pdMat ### are sufficient. ####*# pdChol - a general positive definite structure parameterized by #### the non-zero elements of the Cholesky factor. #####* Constructor #pdChol <- # ## Constructor for the pdChol class # function(value = numeric(0), form = NULL, nam = NULL, data = sys.parent()) #{ # object <- numeric(0) # class(object) <- c("pdChol", "pdMat") # pdConstruct(object, value, form, nam, data) #} #####* Methods for local generics #pdConstruct.pdChol <- # function(object, value = numeric(0), form = formula(object), # nam = Names(object), data = sys.parent()) #{ # val <- pdConstruct.pdMat(object, value, form, nam, data) # if (length(val) == 0) { # uninitialized object # class(val) <- c("pdChol", "pdSymm", "pdMat") # return(val) # } # if (is.matrix(val)) { # value <- val[row(val) <= col(val)] # attributes(value) <- attributes(val)[names(attributes(val)) != "dim"] # class(value) <- c("pdChol", "pdSymm", "pdMat") # return(value) # } # Ncol <- round((sqrt(8*length(val) + 1) - 1)/2) # if (length(val) != round((Ncol * (Ncol + 1))/2)) { # stop(paste("An object of length", length(val), # "does not match a Cholesky factor")) # } # class(val) <- c("pdChol", "pdSymm", "pdMat") # val #} #pdFactor.pdChol <- # function(object) #{ # round(Ncol <- (-1 + sqrt(1 + 8 * length(object))) / 2) # .C("Chol_pd", # Factor = double(Ncol * Ncol), # as.integer(Ncol), # as.double(object))$Factor #} #####* Methods for standard generics #solve.pdChol <- # function(a, b) #{ # if (!isInitialized(a)) { # stop("cannot get the inverse of an uninitialized object") # } # Ncol <- (-1 + sqrt(1 + 8 * length(a))) / 2 # val <- array(.Fortran("dbksl", # as.double(pdFactor(a)), # as.integer(Ncol), # as.integer(Ncol), # val = as.double(diag(Ncol)), # as.integer(Ncol), # integer(1))[["val"]], c(Ncol, Ncol)) # coef(a) <- qr(t(val))$qr[c(row(val) <= col(val))] # a #} #summary.pdChol <- # function(object, # structName = "General positive-definite, Cholesky parametrization") #{ # summary.pdMat(object, structName) #} #### No need to implement other methods as the methods for pdMat #### are sufficient. ####*# pdSpher - a general positive definite structure parameterized #### by the non-zero elements of the Cholesky factor with each column #### represented in spherical coordinates #####* Constructor #pdSpher <- # ## Constructor for the pdSpher class # function(value = numeric(0), form = NULL, nam = NULL, data = sys.parent()) #{ # object <- numeric(0) # class(object) <- c("pdSpher", "pdMat") # pdConstruct(object, value, form, nam, data) #} #####* Methods for local generics #pdConstruct.pdSpher <- # function(object, value = numeric(0), form = formula(object), # nam = Names(object), data = sys.parent()) #{ # val <- pdConstruct.pdMat(object, value, form, nam, data) # if (length(val) == 0) { # uninitiliazed object # class(val) <- c("pdSpher", "pdSymm", "pdMat") # return(val) # } # if (is.matrix(val)) { # Ncol <- dim(val)[2] # value <- log(apply(val, FUN = function(x){sqrt(sum(x^2))},2)) # for(i in (1:Ncol)[-1]) { # aux <- acos(val[1:(i-1),i]/sqrt(cumsum(val[i:1,i]^2)[i:2])) # value <- c(value, log(aux/(pi - aux))) # } # attributes(value) <- attributes(val)[names(attributes(val)) != "dim"] # class(value) <- c("pdSpher", "pdSymm", "pdMat") # return(value) # } # Ncol <- round((sqrt(8*length(val) + 1) - 1)/2) # if (length(val) != round((Ncol * (Ncol + 1))/2)) { # stop(paste("An object of length", length(val), # "does not match a Cholesky factor")) # } # class(val) <- c("pdSpher", "pdSymm", "pdMat") # val #} #pdFactor.pdSpher <- # function(object) #{ # round(Ncol <- (-1 + sqrt(1 + 8 * length(object))) / 2) # .C("spher_pd", # Factor = double(Ncol * Ncol), # as.integer(Ncol), # as.double(object))$Factor #} #####* Methods for standar generics #summary.pdSpher <- # function(object, # structName = "General positive-definite, Spherical parametrization") #{ # summary.pdMat(object, structName) #} ####*# pdMatrixLog - a general positive definite structure parameterized #### by the matrix logarithm. #####* Constructor #pdMatrixLog <- # ## Constructor for the pdMatrixLog class # function(value = numeric(0), form = NULL, nam = NULL, data = sys.parent()) #{ # object <- numeric(0) # class(object) <- c("pdMatrixLog", "pdMat") # pdConstruct(object, value, form, nam, data) #} #####* Methods for local generics #pdConstruct.pdMatrixLog <- # function(object, value = numeric(0), form = formula(object), # nam = Names(object), data = sys.parent()) #{ # val <- pdConstruct.pdMat(object, value, form, nam, data) # if (length(val) == 0) { # uninitialized object # class(val) <- c("pdMatrixLog", "pdSymm", "pdMat") # return(val) # } # if (is.matrix(val)) { # object <- eigen(crossprod(val), symmetric = TRUE) # object <- object$vectors %*% (log(object$values) * t(object$vectors)) # value <- object[row(object) <= col(object)] # attributes(value) <- attributes(val)[names(attributes(val)) != "dim"] # class(value) <- c("pdMatrixLog", "pdSymm", "pdMat") # return(value) # } # Ncol <- round((sqrt(8*length(val) + 1) - 1)/2) # if (length(val) != round((Ncol * (Ncol + 1))/2)) { # stop(paste("An object of length", length(val), # "does not match the required parameter size")) # } # class(val) <- c("pdMatrixLog", "pdSymm", "pdMat") # val #} #pdFactor.pdMatrixLog <- # function(object) #{ # round(Ncol <- (-1 + sqrt(1 + 8 * length(object))) / 2) # .C("matrixLog_pd", # Factor = double(Ncol * Ncol), # as.integer(Ncol), # as.double(object))$Factor #} #####* Methods for standard generics #solve.pdMatrixLog <- # function(a, b) #{ # if (!isInitialized(a)) { # stop("cannot extract the inverse from an uninitialized object") # } # coef(a) <- -coef(a, TRUE) # a #} #summary.pdMatrixLog <- # function(object, # structName = "General positive-definite") #{ # summary.pdMat(object, structName) #} #### No need to implement other methods as the methods for pdMat #### are sufficient. ####*# pdGivens - a general positive definite structure parameterized #### by the eigenvalues and eigenvectors (as Givens rotations) #####* Constructor #pdGivens <- # ## Constructor for the pdGivens class # function(value = numeric(0), form = NULL, nam = NULL, data = sys.parent()) #{ # object <- numeric(0) # class(object) <- c("pdGivens", "pdMat") # pdConstruct(object, value, form, nam, data) #} #####* Methods for local generics #pdConstruct.pdGivens <- # function(object, value = numeric(0), form = formula(object), # nam = Names(object), data = sys.parent()) #{ # val <- pdConstruct.pdMat(object, value, form, nam, data) # if (length(val) == 0) { # uninitiliazed object # class(val) <- c("pdGivens", "pdSymm", "pdMat") # return(val) # } # if (is.matrix(val)) { # q <- dim(val)[1] # aux <- eigen(crossprod(val), symmetric = TRUE) # Q <- aux$vectors # values <- aux$values # angles <- array(0,q*(q-1)/2) # k <- 0 # for(i in 1:(q-1)) { # for(j in ((i+1):q)) { # k <- k + 1 # p <- sqrt(Q[i,i]^2 + Q[j,i]^2) # if (p == 0) { # angles[k] <- 0 # } else { # aux0 <- Q[i,i]/p # aux1 <- Q[j,i]/p # if (aux1 < 0) { # aux0 <- -aux0 # aux1 <- -aux1 # } # aux <- Q[i,] # angles[k] <- log(acos(aux0)/(pi - acos(aux0))) # Q[i,] <- Q[i,] * aux0 + Q[j,] * aux1 # Q[j,] <- Q[j,] * aux0 - aux * aux1 # } # } # } # value <- c(log(c(values[q], diff(values[q:1]))), angles) # attributes(value) <- attributes(val)[names(attributes(val)) != "dim"] # class(value) <- c("pdGivens", "pdSymm", "pdMat") # return(value) # } # Ncol <- round((sqrt(8*length(val) + 1) - 1)/2) # if (length(val) != round((Ncol * (Ncol + 1))/2)) { # stop(paste("An object of length", length(val), # "does not match the required parameter size")) # } # class(val) <- c("pdGivens", "pdSymm", "pdMat") # val #} #pdFactor.pdGivens <- # function(object) #{ # round(Ncol <- (-1 + sqrt(1 + 8 * length(object))) / 2) # .C("Givens_pd", # Factor = double(Ncol * Ncol), # as.integer(Ncol), # as.double(object))$Factor #} #####* Methods for standard generics #summary.pdGivens <- # function(object, # structName = "General positive-definite, Givens parametrization") #{ # summary.pdMat(object, structName) #} #### No need to implement other methods as the methods for pdMat #### are sufficient. #pdConstruct.pdSymm <- pdConstruct.pdMatrixLog #default parametrization ####*# pdNatural - a general positive definite structure parameterized #### by the log of the square root of the diagonal elements and the #### generalized logit of the correlations. This is NOT an unrestricted #### parametrization ####* Constructor pdNatural <- ## Constructor for the pdNatural class function(value = numeric(0), form = NULL, nam = NULL, data = sys.frame(sys.parent())) { object <- numeric(0) class(object) <- c("pdNatural", "pdMat") pdConstruct(object, value, form, nam, data) } ####* Methods for local generics pdConstruct.pdNatural <- function(object, value = numeric(0), form = formula(object), nam = Names(object), data = sys.frame(sys.parent()), ...) { val <- pdConstruct.pdMat(object, value, form, nam, data) if (length(val) == 0) { # uninitiliazed object class(val) <- c("pdNatural", "pdMat") return(val) } if (is.matrix(val)) { q <- ncol(val) if (q > 1) { aux <- crossprod(val) stdDev <- sqrt(diag(aux)) aux <- t(aux/stdDev)/stdDev aux <- aux[row(aux) > col(aux)] value <- c(log(stdDev), log((aux + 1)/(1 - aux))) } else { value <- log(val) } attributes(value) <- attributes(val)[names(attributes(val)) != "dim"] class(value) <- c("pdNatural", "pdMat") return(value) } Ncol <- round((sqrt(8*length(val) + 1) - 1)/2) if (length(val) != round((Ncol * (Ncol + 1))/2)) { stop(gettextf("an object of length %d does not match the required parameter size", length(val)), domain = NA) } class(val) <- c("pdNatural", "pdMat") val } pdFactor.pdNatural <- function(object) { Ncol <- round((-1 + sqrt(1 + 8 * length(object))) / 2) .C(natural_pd, Factor = double(Ncol * Ncol), as.integer(Ncol), as.double(object))$Factor } pdMatrix.pdNatural <- function(object, factor = FALSE) { if (!isInitialized(object)) { stop("cannot extract matrix from an uninitialized object") } if (factor) { Ncol <- Dim(object)[2] value <- array(pdFactor(object), c(Ncol, Ncol), attr(object, "Dimnames")) attr(value, "logDet") <- sum(log(diag(value))) value } else { NextMethod() } } ####* Methods for standard generics coef.pdNatural <- function(object, unconstrained = TRUE, ...) { if (unconstrained || !isInitialized(object)) NextMethod() else { # standard deviations and correlations Ncol <- round((-1 + sqrt(1 + 8 * length(object))) / 2) val <- exp(as.vector(object)) aux <- val[-(1:Ncol)] val[-(1:Ncol)] <- (aux - 1) / (aux + 1) aN <- Names(object) aNmat <- t(outer(aN, aN, paste, sep = ",")) names(val) <- c(paste("sd(",aN,")", sep = ""), if (Ncol > 1) { paste("cor(", aNmat[row(aNmat) > col(aNmat)],")",sep="") }) val } } Dim.pdNatural <- function(object, ...) { if (isInitialized(object)) { val <- round((sqrt(8*length(object) + 1) - 1)/2) c(val, val) } else { NextMethod() } } logDet.pdNatural <- function(object, ...) { if (!isInitialized(object)) { stop("cannot extract the log of the determinant from an uninitialized object") } attr(pdMatrix(object, factor = TRUE), "logDet") } solve.pdNatural <- function(a, b, ...) { if (!isInitialized(a)) { stop("cannot get the inverse of an uninitialized object") } Ncol <- round((-1 + sqrt(1 + 8 * length(a))) / 2) if (Ncol > 1) { # val <- array(.Fortran("dbksl", # as.double(pdFactor(a)), # as.integer(Ncol), # as.integer(Ncol), # val = as.double(diag(Ncol)), # as.integer(Ncol), # integer(1))[["val"]], c(Ncol, Ncol)) val <- solve(pdMatrix(a, factor = TRUE)) val <- val %*% t(val) stdDev <- sqrt(diag(val)) val <- t(val/stdDev)/stdDev val <- val[row(val) > col(val)] coef(a) <- c(log(stdDev), log((val + 1)/(1 - val))) } else { coef(a) <- -coef(a) } a } summary.pdNatural <- function(object, structName = "General positive-definite, Natural parametrization", ...) { summary.pdMat(object, structName) } ### No need to implement other methods as the methods for pdMat ### are sufficient. ###*# pdDiag - diagonal structure parameterized by the logarithm of ### the square root of the diagonal terms. ####* Constructor pdDiag <- ## Constructor for the pdDiag class function(value = numeric(0), form = NULL, nam = NULL, data = sys.frame(sys.parent())) { object <- numeric(0) class(object) <- c("pdDiag", "pdMat") pdConstruct(object, value, form, nam, data) } ####* Methods for local generics corMatrix.pdDiag <- function(object, ...) { val <- diag(length(as.vector(object))) attr(val, "stdDev") <- exp(as.vector(object)) len <- length(as.vector(object)) if (length(nm <- Names(object)) == 0) { nm <- paste("V", 1:len, sep = "") dimnames(val) <- list(nm, nm) } names(attr(val, "stdDev")) <- nm val } pdConstruct.pdDiag <- function(object, value = numeric(0), form = formula(object), nam = Names(object), data = sys.frame(sys.parent()), ...) { val <- NextMethod() if (length(val) == 0) { # uninitiliazed object return(val) } if (is.matrix(val)) { # initialize from a positive definite # if (any(value[row(val) != col(val)])) { # warning("Initializing matrix is not diagonal") # } value <- log(diag(crossprod(val)))/2 attributes(value) <- attributes(val)[names(attributes(val)) != "dim"] class(value) <- c("pdDiag", "pdMat") return(value) } if ((aux <- length(Names(val))) > 0) { if (aux && (aux != length(val))) { stop(gettextf("an object of length %d does not match the required parameter size", length(val)), domain = NA) } } val } pdFactor.pdDiag <- function(object) { diag(exp(as.vector(object)), length(object)) } pdMatrix.pdDiag <- function(object, factor = FALSE) { if (!isInitialized(object)) { stop("cannot extract the matrix from an uninitialized object") } len <- length(as.vector(object)) if (factor) { value <- diag(exp(as.vector(object)), len) attr(value, "logDet") <- sum(as.vector(object)) } else { value <- diag(exp(2 * as.vector(object)), len) } dimnames(value) <- attr(object, "Dimnames") value } ####* Methods for standard generics coef.pdDiag <- function(object, unconstrained = TRUE, ...) { if (unconstrained) NextMethod() else { val <- exp(as.vector(object)) names(val) <- paste("sd(",Names(object),")", sep ="") val } } Dim.pdDiag <- function(object, ...) { if (isInitialized(object)) { val <- length(object) c(val, val) } else { NextMethod() } } logDet.pdDiag <- function(object, ...) { if (!isInitialized(object)) { stop("cannot extract the log of the determinant from an uninitialized object") } sum(as.vector(object)) } solve.pdDiag <- function(a, b, ...) { if (!isInitialized(a)) { stop("cannot extract the inverse from an uninitialized object") } coef(a) <- -coef(a, TRUE) a } summary.pdDiag <- function(object, structName = "Diagonal", ...) { summary.pdMat(object, structName, noCorrelation = TRUE) } ### No need to implement other methods as the "pdMat" methods suffice. ###*# pdIdent: multiple of the identity matrix - the parameter is ### the log of the multiple. ####* Constructor pdIdent <- ## Constructor for the pdIdent class function(value = numeric(0), form = NULL, nam = NULL, data = sys.frame(sys.parent())) { object <- numeric(0) class(object) <- c("pdIdent", "pdMat") pdConstruct(object, value, form, nam, data) } ####* Methods for local generics corMatrix.pdIdent <- function(object, ...) { if (!isInitialized(object)) { stop("cannot extract the matrix from an uninitialized \"pdIdent\" object") } if (is.null(Ncol <- attr(object, "ncol"))) { stop("cannot extract the matrix with uninitialized dimensions") } val <- diag(nrow = Ncol) attr(val, "stdDev") <- rep(exp(as.vector(object)), Ncol) if (length(nm <- Names(object)) == 0) { nm <- paste("V", 1:Ncol, sep = "") } dimnames(val) <- list(nm, nm) names(attr(val, "stdDev")) <- nm val } pdConstruct.pdIdent <- function(object, value = numeric(0), form = formula(object), nam = Names(object), data = sys.frame(sys.parent()), ...) { val <- NextMethod() if (length(val) == 0) { # uninitialized object if ((ncol <- length(Names(val))) > 0) { attr(val, "ncol") <- ncol } return(val) } if (is.matrix(val)) { # if (any(val[row(val) != col(val)])) { # warning("Initializing pdIdent object from non-diagonal matrix") # } # if (any(diag(val) != val[1,1])) { # warning("Diagonal of initializing matrix is not constant") # } value <- log(mean(diag(crossprod(val))))/2 attributes(value) <- attributes(val)[names(attributes(val)) != "dim"] attr(value, "ncol") <- dim(val)[2] class(value) <- c("pdIdent", "pdMat") return(value) } if (length(val) > 1) { stop(gettextf("an object of length %d does not match the required parameter size", length(val)), domain = NA) } if (((aux <- length(Names(val))) == 0) && is.null(formula(val))) { stop("must give names when initializing \"pdIdent\" from parameter without a formula") } else { attr(val, "ncol") <- aux } val } pdFactor.pdIdent <- function(object) { exp(as.vector(object)) * diag(attr(object, "ncol")) } pdMatrix.pdIdent <- function(object, factor = FALSE) { if (!isInitialized(object)) { stop("cannot extract the matrix from an uninitialized \"pdIdent\" object") } if (is.null(Ncol <- attr(object, "ncol"))) { stop("cannot extract the matrix with uninitialized dimensions") } value <- diag(Ncol) if (factor) { value <- exp(as.vector(object)) * value attr(value, "logDet") <- Ncol * as.vector(object) } else { value <- exp(2 * as.vector(object)) * value } dimnames(value) <- attr(object, "Dimnames") value } ####* Methods for standard generics coef.pdIdent <- function(object, unconstrained = TRUE, ...) { if (unconstrained) NextMethod() else structure(exp(as.vector(object)), names = c(paste("sd(", deparse(formula(object)[[2]]),")",sep = ""))) } Dim.pdIdent <- function(object, ...) { if (!is.null(val <- attr(object, "ncol"))) { c(val, val) } else { stop("cannot extract the dimensions") } } logDet.pdIdent <- function(object, ...) { attr(object, "ncol") * as.vector(object) } solve.pdIdent <- function(a, b, ...) { if (!isInitialized(a)) { stop("cannot extract the inverse from an uninitialized object") } coef(a) <- -coef(a, TRUE) a } summary.pdIdent <- function(object, structName = "Multiple of an Identity", ...) { summary.pdMat(object, structName, noCorrelation = TRUE) } ###*# pdCompSymm: Compound symmetry structure ####* Constructor pdCompSymm <- ## Constructor for the pdCompSymm class function(value = numeric(0), form = NULL, nam = NULL, data = sys.frame(sys.parent())) { object <- numeric(0) class(object) <- c("pdCompSymm", "pdMat") pdConstruct(object, value, form, nam, data) } ####* Methods for local generics corMatrix.pdCompSymm <- function(object, ...) { if (!isInitialized(object)) { stop("cannot extract the matrix from an uninitialized \"pdCompSymm\" object") } if (is.null(Ncol <- attr(object, "ncol"))) { stop("cannot extract the matrix with uninitialized dimensions") } obj <- as.vector(object) aux <- exp(obj[2]) aux <- c(exp(2 * obj[1]), (aux - 1/(Ncol - 1))/(aux + 1)) value <- array(aux[2], c(Ncol, Ncol)) value[row(value) == col(value)] <- 1 attr(value, "stdDev") <- rep(exp(obj[1]), Ncol) if (length(nm <- Names(object)) == 0) { nm <- paste("V", 1:Ncol, sep = "") dimnames(value) <- list(nm, nm) } names(attr(value, "stdDev")) <- nm value } pdConstruct.pdCompSymm <- function(object, value = numeric(0), form = formula(object), nam = Names(object), data = sys.frame(sys.parent()), ...) { val <- NextMethod() if (length(val) == 0) { # uninitialized object if ((nc <- length(Names(val))) > 0) { attr(val, "ncol") <- nc } return(val) } if (is.matrix(val)) { value <- crossprod(val) # if (length(unique(value[row(value) != col(value)])) > 1) { # warning("Initializing pdCompSymm object from non-compound symmetry matrix") # } # if (any(diag(value) != value[1,1])) { # warning("Diagonal of initializing matrix is not constant") # } nc <- dim(value)[2] aux <- 1/sqrt(diag(value)) aux <- aux * t(value * aux) if ((aux <- mean(aux[row(aux) != col(aux)])) <= -1/(nc - 1)) { aux <- -1/nc warning("initializing \"pdCompSymm\" object is not positive definite") } value <- c(log(mean(diag(value)))/2, log((aux + 1/(nc - 1))/(1 - aux))) attributes(value) <- attributes(val)[names(attributes(val)) != "dim"] attr(value, "ncol") <- nc class(value) <- c("pdCompSymm", "pdMat") return(value) } if (length(val) != 2) { stop(gettextf("an object of length %d does not match the required parameter size", length(val)), domain = NA) } if (((aux <- length(Names(val))) == 0) && is.null(formula(val))) { stop("must give names when initializing \"pdCompSymm\" from parameter without a formula") } else { attr(val, "ncol") <- aux } val } pdFactor.pdCompSymm <- function(object) { Ncol <- attr(object, "ncol") .C(compSymm_pd, Factor = double(Ncol * Ncol), as.integer(Ncol), as.double(object))$Factor } pdMatrix.pdCompSymm <- function(object, factor = FALSE) { if (!isInitialized(object)) { stop("cannot extract the matrix from an uninitialized \"pdCompSymm\" object") } if (is.null(Ncol <- attr(object, "ncol"))) { stop("cannot extract the matrix with uninitialized dimensions") } obj <- as.vector(object) aux <- exp(obj[2]) aux <- c(exp(2 * obj[1]), (aux - 1/(Ncol - 1))/(aux + 1)) if (factor) { value <- array(pdFactor(object), c(Ncol, Ncol)) attr(value, "logDet") <- Ncol * obj[1] + ((Ncol - 1) * log(1 - aux[2]) + log(1 + (Ncol - 1) * aux[2]))/2 } else { value <- array(aux[2], c(Ncol, Ncol)) value[row(value) == col(value)] <- 1 value <- aux[1] * value } dimnames(value) <- attr(object, "Dimnames") value } ####* Methods for standard generics coef.pdCompSymm <- function(object, unconstrained = TRUE, ...) { if (unconstrained || !isInitialized(object)) NextMethod() else { if (is.null(Ncol <- attr(object, "ncol"))) { stop("cannot obtain constrained coefficients with uninitialized dimensions") } val <- as.vector(object) aux <- exp(val[2]) val <- c(exp(val[1]), (aux - 1 / (Ncol - 1)) / (aux + 1)) names(val) <- c("std. dev", "corr.") val } } Dim.pdCompSymm <- function(object, ...) { if (!is.null(val <- attr(object, "ncol"))) { c(val, val) } else { stop("cannot extract the dimensions") } } logDet.pdCompSymm <- function(object, ...) { attr(pdMatrix(object, factor = TRUE), "logDet") } summary.pdCompSymm <- function(object, structName = "Compound Symmetry", ...) { summary.pdMat(object, structName) } ####*# pdBlocked: A blocked variance structure #####* Constructor pdBlocked <- ## Constructor for the pdBlocked class function(value = numeric(0), form = NULL, nam = NULL, data = sys.frame(sys.parent()), pdClass = "pdSymm") { object <- numeric(0) class(object) <- c("pdBlocked", "pdMat") pdConstruct(object, value, form, nam, data, pdClass) } ####* Methods for local generics corMatrix.pdBlocked <- function(object, ...) { if (!isInitialized(object)) { stop("cannot access the matrix of uninitialized objects") } if (length(Names(object)) == 0) { stop("cannot access the matrix of object without names") } namesList <- Names(object, TRUE) Ncol <- Dim(object)[2] value <- array(0, c(Ncol, Ncol), attr(object, "Dimnames")) stdDev <- double(Ncol) names(stdDev) <- colnames(value) for (i in seq_along(object)) { aux <- corMatrix(object[[i]]) value[namesList[[i]], namesList[[i]]] <- as.vector(aux) stdDev[namesList[[i]]] <- attr(aux, "stdDev") } attr(value, "stdDev") <- stdDev value } pdConstruct.pdBlocked <- function(object, value = numeric(0), form = formula(object, TRUE), nam = Names(object, TRUE), data = sys.frame(sys.parent()), pdClass = "pdSymm", ...) { if (inherits(value, "pdMat")) { # constructing from another pdMat if (inherits(value, "pdBlocked")) { if (length(form) == 0) form <- formula(value, TRUE) if (length(nam) == 0) nam <- Names(value, TRUE) if (missing(pdClass)) pdClass <- unlist(lapply(value, data.class)) } if (isInitialized(value)) { return(pdConstruct(object, as.matrix(value), form, nam, data, pdClass)) } else { return(pdConstruct(object, form = form, nam = nam, data = data, pdClass = pdClass)) } } ## checking validity and consistency of form, nam, and pdClass if (!is.null(form)) { if (data.class(form) != "list") { stop("'form' must be a list") } nF <- length(form) } else { nF <- 0 } if (!is.null(nam)) { if (data.class(nam) != "list") { stop("'nam' must be a list") } nN <- length(nam) if ((nF > 0) && (nN != nF)) { stop("'form' and 'nam' have incompatible lengths") } } else { nN <- 0 } if (!missing(pdClass)) { if (!is.character(pdClass)) { stop("'pdClass' must be a character vector") } nP <- length(pdClass) if ((nP > 1)) { if ((nF > 0) && (nF != nP)) { stop("'form' and 'pdClass' have incompatible lengths") } if ((nN > 0) && (nN != nP)) { stop("'nam' and 'pdClass' have incompatible lengths") } } } else { nP <- 1 } nB <- max(c(nF, nN, nP)) oVal <- value if (length(value) == 0 || is.matrix(value) || is.numeric(value)) { if (nB == 1) { stop("LNone of the arguments specify more than one block") } ## will first do a null initialization when value is a matrix or numeric value <- lapply(vector("list", nB), function(el) numeric(0)) } else { if (data.class(value) != "list") { stop("'object' must be a list when not missing, not a matrix, and not numeric") } nO <- length(value) if ((nB > 1) && (nB != nO)) { stop("arguments imply different number of blocks") } nB <- nO } if (nP == 1) { pdClass <- rep(pdClass, nB) } object <- vector("list", nB) namInterc <- rep(FALSE, nB) namCoef <- vector("list", nB) for(i in 1:nB) { if (is.null(nm <- nam[[i]])) { if (is.null(frm <- form[[i]])) { if (inherits(value[[i]], "formula")) { nm <- Names(getCovariateFormula(value[[i]])) if ((length(nm) == 1) && (nm == "(Intercept)") && length(value[[i]]) == 3) { ## nlme case with single intercept terms nm <- sapply(splitFormula(getResponseFormula(value[[i]])[[2]], sep = "+"), function(el) deparse(el[[2]])) } if (length(value[[i]]) == 3) { # nlme case namCoef[[i]] <- sapply(splitFormula(getResponseFormula(value[[i]])[[2]], sep = "+"), function(el) deparse(el[[2]])) } } } else { if (inherits(frm, "formula")) { nm <- Names(getCovariateFormula(frm)) if ((length(nm) == 1) && (nm == "(Intercept)") && length(frm) == 3) { ## nlme case with single intercept terms nm <- sapply(splitFormula(getResponseFormula(frm)[[2]], sep = "+"), function(el) deparse(el[[2]])) } if (length(value[[i]]) == 3) { # nlme case namCoef[[i]] <- sapply(splitFormula(getResponseFormula(value[[i]])[[2]], sep = "+"), function(el) deparse(el[[2]])) } } else { # listForm nm <- unique(unlist(lapply(frm, function(el) { Names(getCovariateFormula(el)) }))) if ((length(nm) == 1) && (nm == "(Intercept)") && length(frm[[1]]) == 3) { ## nlme case with single intercept terms nm <- sapply(frm, function(el) { sapply(splitFormula(getResponseFormula(el)[[2]], sep = "+"), function(el1) deparse(el1[[2]])) }) } namCoef[[i]] <- sapply(frm, function(el) { sapply(splitFormula(getResponseFormula(el)[[2]], sep = "+"), function(el1) deparse(el1[[2]])) }) } } } if (!is.null(nm)) { namInterc[i] <- (length(nm) == 1) && (nm == "(Intercept)") } object[[i]] <- pdMat(value[[i]], form[[i]], nam[[i]], data, pdClass[i]) } if (!all(unlist(lapply(object, inherits, "pdMat")))) { stop("all elements in the argument must generate \"pdMat\" objects") } namesList <- lapply(object, Names) lNam <- lengths(namesList) # namInterc <- unlist(lapply(namesList, # function(el) { # (length(el) == 1) && (el == "(Intercept)") # })) if (!is.null(namCoef[[1]])) { # nlme case namCoef <- unlist(namCoef) duplCoef <- unique(namCoef[duplicated(namCoef)]) if (length(duplCoef) > 0) { for(i in 1:nB) { wchDupl <- !is.na(match(namesList[[i]], duplCoef)) if (any(wchDupl)) { namesList[[i]][wchDupl] <- paste(namesList[[i]][wchDupl], "(Intercept)", sep = ".") Names(object[[i]]) <- namesList[[i]] } } } } if (sum(namInterc) > 1 && (length(unique(lNam[namInterc])) == 1)) { stop("cannot have duplicated column names in a \"pdMat\" object") } if ((sum(namInterc) == length(lNam)) || !any(lNam[!namInterc])) { # no names class(object) <- c("pdBlocked", "pdMat") if (is.null(formula(object))) { stop("must have formula when no names are given") } if (length(oVal) && (is.matrix(oVal) || is.numeric(oVal))) { stop("must give names when initializing from matrix or parameter") } return(object) } else { if (!all(lNam)) { stop("all elements must have names when any has names") } attr(object, "namesList") <- namesList allNames <- unlist(namesList) if (any(duplicated(allNames))) { stop("cannot have duplicated column names in a \"pdMat\" object") } plen <- unlist(lapply(object, function(el) { if (isInitialized(el)) { length(coef(el, TRUE)) } else { matrix(el) <- diag(length(Names(el))) length(coef(el, TRUE)) } })) if (!all(plen)) { stop("all elements must have a non-zero size") } attr(object, "plen") <- plen attr(object, "Dimnames") <- list(allNames, allNames) class(object) <- c("pdBlocked", "pdMat") if (length(oVal) > 0) { if (is.matrix(oVal)) { # initializing from matrix matrix(object) <- oVal } else if (is.numeric(oVal)){ # initializing from a vector coef(object) <- oVal } } return(object) } } pdMatrix.pdBlocked <- function(object, factor = FALSE) { if (!isInitialized(object)) { stop("cannot access the matrix of uninitialized objects") } if (length(Names(object)) == 0) { stop("cannot access the matrix of object without names") } namesList <- Names(object, TRUE) Ncol <- Dim(object)[2] value <- array(0, c(Ncol, Ncol), attr(object, "Dimnames")) if (factor) { lD <- 0 } for (i in seq_along(object)) { aux <- pdMatrix(object[[i]], factor) value[namesList[[i]], namesList[[i]]] <- as.vector(aux) if (factor) lD <- lD + attr(aux, "logDet") } if (factor) attr(value, "logDet") <- lD value } ####* Methods for standard generics coef.pdBlocked <- function(object, unconstrained = TRUE, ...) { unlist(lapply(object, coef, unconstrained)) } "coef<-.pdBlocked" <- function(object, ..., value) { if (is.null(plen <- attr(object, "plen"))) { stop("cannot change the parameter when length of parameters is undefined") } if (length(value) != sum(plen)) { stop("cannot change parameter length of initialized \"pdMat\" object") } ends <- cumsum(plen) starts <- 1 + c(0, ends[-length(ends)]) for (i in seq_along(object)) { coef(object[[i]]) <- value[(starts[i]):(ends[i])] } object } formula.pdBlocked <- function(x, asList = TRUE, ...) { val <- lapply(x, formula) isNULL <- unlist(lapply(val, is.null)) if (all(isNULL)) return(NULL) if (any(isNULL)) { stop("all elements must have formulas when any has a formula") } if (asList) return(val) isTwoSided <- unlist(lapply(val, function(el) { inherits(el, "listForm") })) if (all(isTwoSided)) { ## list of two-sided formulas val <- do.call("c", val) # for(i in seq(along = object)) { # val <- if (inherits(object[[i]], "formula")) list(object[[i]]) # else object[[i]] # } class(val) <- "listForm" return(val) } if (any(isTwoSided)) { stop("all elements of formula must be list of two-sided formulae or two-sided formulae") } val <- lapply(val, terms) aux <- paste(unlist(lapply(val, function(el) attr(el, "term.labels"))), collapse = "+") if (!any(unlist(lapply(val, function(el) attr(el, "intercept"))))) { ## no intercept aux <- paste(aux, " - 1") } eval(parse(text = paste("~", aux))) } isInitialized.pdBlocked <- function(object) { all(unlist(lapply(object, isInitialized))) } logDet.pdBlocked <- function(object, ...) { sum(unlist(lapply(object, logDet))) } "matrix<-.pdBlocked" <- function(object, value) { value <- as.matrix(value) namesList <- Names(object, TRUE) Ncol <- Dim(object)[2] dims <- dim(value) if (!((dims[1] == dims[2]) && (dims[1] == Ncol))) { stop("cannot change the number of columns on an initialized object") } if (is.null(vNames <- rownames(value))) { vNames <- unlist(namesList) dimnames(value) <- list(vNames, vNames) } else { if (!(all(match(unlist(namesList), vNames, nomatch = 0)))) { stop("names of object and value must match") } attr(object, "Dimnames") <- list(vNames, vNames) } for (i in seq_along(object)) { matrix(object[[i]]) <- value[namesList[[i]], namesList[[i]]] } object } Names.pdBlocked <- function(object, asList = FALSE, ...) { if (asList) attr(object, "namesList") else attr(object, "Dimnames")[[2]] } "Names<-.pdBlocked" <- function(object, ..., value) { if (!is.null(Names(object))) NextMethod() else { ## cannot do anything before initialization of names object } } pdFactor.pdBlocked <- function(object) { pdMatrix(object, factor = TRUE) } solve.pdBlocked <- function(a, b, ...) { if (!isInitialized(a)) { stop("cannot get the inverse of an uninitialized object") } coef(a) <- unlist(lapply(a, function(el) coef(solve(el), TRUE))) a } summary.pdBlocked <- function(object, structName = "Blocked", ...) { value <- lapply(object, summary) names(value) <- unlist(lapply(object, function(el) paste(Names(el), collapse = ", "))) attr(value, "structName") <- structName attr(value, "elementName") <- "Block" class(value) <- "summary.pdMat" value } "[.pdBlocked" <- function(x, i, j, drop = TRUE) { xx <- x x <- as.matrix(x) mCall <- match.call() mCall[[1]] <- get("[") mCall[["x"]] <- x mCall[["drop"]] <- drop if (length(i) == length(j) && mode(i) == mode(j) && all(i == j)) { mCall[["drop"]] <- FALSE # even for a 1 by 1 submatrix, # you want it to be a matrix val <- eval(mCall) vNames <- colnames(val) auxNames <- lapply(Names(xx, TRUE), function(el) { aux <- match(vNames, el) if(any(ok <- !is.na(aux))) el[aux[ok]] # else NULL }) auxWhich <- !vapply(auxNames, is.null, NA) if (sum(auxWhich) == 1) { pdConstruct(as.list(xx)[auxWhich][[1]], val) } else { auxNames <- auxNames[auxWhich] auxClass <- vapply(xx, function(el) class(el)[1L], "")[auxWhich] pdConstruct(xx, val, nam = auxNames, form = NULL, pdClass = auxClass) } } else { eval(mCall) } } nlme/R/zzMethods.R0000644000176200001440000000744013336503465013535 0ustar liggesusers### Miscellaneous methods that must be defined last in the library ### ### Copyright 2007-2018 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # ## Because of the conditional pre-/post 3.3.0 behavior with 'sigma' : .onLoad <- function(libname, pkgname) { ## pInfo <- readRDS(attr(packageDescription(pkgname), "file")) ## built.R.ver <- pInfo$Built$R ## First case: does signal Error : object 'sigma' is not exported by 'namespace:stats' ## so we don't need the following: ## if(getRversion() < "3.3") { ## check that nlme was not *installed* with R >= 3.3.x ## if(built.R.ver >= "3.3") ## warning("Package ", dQuote(pkgname), " installed with R version ", built.R.ver, ## " can not safely be used with old R version ", getRversion()) ## ## second case: if(getRversion() >= "3.3") { pInfo <- readRDS(attr(packageDescription(pkgname), "file")) built.R.ver <- pInfo$Built$R if(built.R.ver < "3.3")## installed with R < 3.3.x : warning("Package ", dQuote(pkgname), " installed with old R version ", built.R.ver, " should not be used with R version ", getRversion(), "\n Rather re-install it with this version of R.") } } `%||%` <- function(x, y) if(is.null(x)) y else x ## Note that require( stats ) has already happened ... comparePred.lme <- comparePred.lmList <- comparePred.gls getData.nlme <- getData.gnls getData.lme <- getData.gls <- getData.nls qqnorm.gls <- qqnorm.lm <- qqnorm.nls plot.lme <- plot.nls fitted.gnls <- fitted.gls residuals.gnls <- residuals.gls vcov.gls <- function (object, ...) object$varBeta vcov.lme <- function (object, ...) object$varFix deviance.gls <- deviance.lme <- function(object, ...) { if(object$method == "ML") -2 * logLik(object) else { warning("deviance undefined for REML fit") NULL } } ## From MASS/R/stepAIC.R : extractAIC.gls <- extractAIC.lme <- function(fit, scale, k = 2, ...) { if(fit$method != "ML") stop("AIC undefined for REML fit") res <- logLik(fit) edf <- attr(res, "df") c(edf, -2*res + k * edf) } terms.gls <- function(x, ...) terms(formula(x), ...) if(FALSE)## Not needed, because 'lme' object has "terms" attribute: terms.lme <- function(x, ...) terms(formula(x), ...) ## end{from MASS} if(getRversion() < "3.3") { sigma <- function(object, ...) UseMethod("sigma") } sigma.gls <- sigma.lme <- function(object, ...) object$sigma ## also works for "nlsList" sigma.lmList <- function(object, ...) vapply(object, sigma, 1, ...) ## confint() works for "gls" via confint.default() ! confint.lme <- function(object, ...) stop("not (yet) implemented. Contributions are welcome; use intervals() instead (for now)") confint.lmList <- function(object, ...) sapply(object, confint, ..., simplify=FALSE) confint.nlsList <- function(object, ...) { sapply(object, function(ob) tryCatch(confint(ob, ...), error = function(e) structure(c(NA,NA), errMsg = conditionMessage(e))), simplify=FALSE) } .ns <- environment() # == asNamespace("nlme") ## at the very end : --------------------------- .onUnload <- function(libpath) library.dynam.unload("nlme", libpath) nlme/R/varFunc.R0000644000176200001440000010671512672564475013171 0ustar liggesusers### Classes of variance functions ### ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates # Copyright 2007-2012 The R Core team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # ##*## Generics that should be implemented for any varFunc class varWeights <- ## Calculates the weights of the variance function function(object) UseMethod("varWeights") ##*## varFunc - a virtual class of variance functions ###*# Constructor varFunc <- ## Can take as argument either a varFunc object, in which case it does ## nothing, a formula or a character string , in which case it ## calls varFixed function(object) { if(is.null(object)) return(object) # NULL object - no varFunc structure if (inherits(object, "varFunc")) { ## constructing from another varFunc object return(object) } if (inherits(object, "formula") || is.character(object)) { ## constructing from a formula of the form ~ x return(varFixed(asOneSidedFormula(object))) } stop("can only construct \"varFunc\" object from another \"varFunc\" object, a formula, or a character string") } ###*# Methods for local generics varWeights.varFunc <- function(object) attr(object, "weights") ###*# Methods for standard generics coef.varFunc <- function(object, unconstrained = TRUE, allCoef = FALSE, ...) { ### checking if initialized wPar <- attr(object, "whichFix") if (is.null(wPar) || (length(object) != (length(wPar) - sum(wPar)))) { stop("cannot extract parameters of uninitialized object") } if (unconstrained) { if (allCoef) { val <- double(length(wPar)) if (any(wPar)) { val[wPar] <- attr(object, "fixed") } if (any(!wPar)) { val[!wPar] <- as.vector(object) } } else { val <- as.vector(object) } val } else { stop(gettextf("do not know how to get coefficients for %s object", dQuote(class(object)[1])), domain = NA) } } "covariate<-.varFunc" <- function(object, value) { value <- as.numeric(value) if (!is.null(aux <- getCovariate(object))) { if (length(aux) != length(value)) { stop("cannot change the length of covariate in \"varFunc\" object") } } attr(object, "covariate") <- value object } formula.varFunc <- function(x, ...) eval(attr(x, "formula")) getCovariate.varFunc <- function(object, form, data) attr(object, "covariate") getGroups.varFunc <- function(object, form, level, data, sep) attr(object, "groups") Initialize.varFunc <- function(object, data, ...) { if (is.null(varWeights(object))) { attr(object, "weights") <- rep(1, dim(data)[1]) } if (is.null(logLik(object))) { attr(object, "logLik") <- 0 } object } ## NB no nobs logLik.varFunc <- function(object, data, ...) { if (is.null(ll <- attr(object, "logLik"))) return(NULL) attr(ll, "df") <- length(object) class(ll) <- "logLik" ll } print.summary.varFunc <- function(x, header = TRUE, ...) { ox <- x class(x) <- attr(x, "oClass") if (length(aux <- coef(x, uncons = FALSE, allCoef = TRUE)) > 0) { if (header) cat("Variance function:\n") cat(paste(" Structure: ", attr(x, "structName"), "\n", sep = "")) cat(paste(" Formula:", deparse(formula(x)),"\n")) cat(" Parameter estimates:\n") print(aux) } else { if (inherits(x, "varIdent")) { ## varIdent with no parameters - nothing to print return() } cat("Variance function structure of class", class(x)[1], "with no parameters, or uninitialized\n") } invisible(ox) } print.varFunc <- function(x, ...) { if (length(aux <- coef(x, uncons = FALSE, allCoef = TRUE)) > 0) { cat("Variance function structure of class", class(x)[1], "representing\n") print(aux, ...) } else { cat("Variance function structure of class", class(x)[1], "with no parameters, or uninitialized\n") } invisible(x) } recalc.varFunc <- function(object, conLin, ...) { conLin$Xy[] <- conLin$Xy * varWeights(object) conLin$logLik <- conLin$logLik + logLik(object) conLin } summary.varFunc <- function(object, structName = class(object)[1], ...) { attr(object, "structName") <- structName attr(object, "oClass") <- class(object) class(object) <- "summary.varFunc" object } update.varFunc <- function(object, data, ...) { if (needUpdate(object)) { covariate(object) <- eval(getCovariateFormula(object)[[2]], data) } object } ##*## Classes that substitute for (i.e. inherit from) varFunc ###*# varFixed - fixed weights ####* Constructor varFixed <- function(value = ~ 1) { if (!inherits(value, "formula")) { stop("'value' must be a one sided formula") } form <- asOneSidedFormula(value) if (length(all.vars(getCovariateFormula(form))) == 0) { stop("'form' must have a covariate") } if (!is.null(getGroupsFormula(form))) { form <- getCovariateFormula(form) warning("ignoring 'group' in \"varFixed\" formula") } value <- numeric(0) attr(value, "formula") <- form class(value) <- c("varFixed", "varFunc") value } ###*# Methods for standard generics coef.varFixed <- function(object, ...) numeric(0) "coef<-.varFixed" <- function(object, ..., value) object Initialize.varFixed <- function(object, data, ...) { form <- formula(object) if (any(is.na(match(all.vars(form), names(data))))) { ## cannot evaluate covariate on data stop("all variables used in 'formula' must be in 'data'") } attr(object, "needUpdate") <- FALSE attr(object, "covariate") <- getCovariate(data, form) attr(object, "logLik") <- sum(log(attr(object, "weights") <- 1/sqrt(abs(attr(object,"covariate"))))) object } print.summary.varFixed <- function(x, header = TRUE, ...) { cat("Variance function:\n") cat(" Structure: fixed weights\n") cat(paste(" Formula:", deparse(formula(x)),"\n")) invisible(x) } summary.varFixed <- function(object, structName, ...) { class(object) <- "summary.varFixed" object } ###*# varFIdent - equal variances per stratum structure ####* Constructor varIdent <- function(value = numeric(0), form = ~ 1, fixed = NULL) { if (is.null(getGroupsFormula(form))) { # constant value value <- numeric(0) attr(value, "fixed") <- NULL # nothing to estimate } else { if ((lv <- length(value)) > 0) { # initialized if (is.null(grpNames <- names(value)) && (lv > 1)) { stop("initial values must have group names in 'varIdent'") } value <- unlist(value) # may be a list with names if (any(value <= 0)) { stop("initial values for 'varIdent' must be > 0") } value <- log(value) # unconstrained form } else grpNames <- NULL attr(value, "groupNames") <- grpNames if (!is.null(fixed)) { fix <- attr(value, "fixed") <- log(unlist(fixed)) if (is.null(fixNames <- names(fix))) { stop("fixed parameters must have names in 'varIdent'") } if (!is.null(attr(value, "groupNames"))) { attr(value, "groupNames") <- c(attr(value, "groupNames"), fixNames) } } } attr(value, "formula") <- asOneSidedFormula(form) class(value) <- c("varIdent", "varFunc") value } ###*# Methods for standard generics coef.varIdent <- function(object, unconstrained = TRUE, allCoef = FALSE, ...) { if (!is.null(getGroupsFormula(object)) && !is.null( wPar <- attr(object, "whichFix"))) { ## different groups variances if (unconstrained && !allCoef) { return(as.vector(object)) } val <- double(length(wPar)) if (any(wPar)) { val[wPar] <- attr(object, "fixed") } if (any(!wPar)) { val[!wPar] <- as.vector(object) } if (!unconstrained) { val <- c(1, exp(val)) names(val) <- attr(object, "groupNames") if (!allCoef) { val <- val[c(FALSE, !attr(object, "whichFix"))] } } val } else { numeric(0) } } "coef<-.varIdent" <- function(object, ..., value) { if (!(is.null(grps <- getGroups(object)) || all(attr(object, "whichFix")))) { ## different group variances & varying parameters value <- as.numeric(value) nGroups <- length(attr(object, "groupNames")) # if (nGroups == 0) { # stop("Cannot assign parameters of uninitialized varIdent object") # } ## fix from PR#9831 nFixed <- sum(as.numeric(attr(object,"whichFix"))) if (length(value) != nGroups - nFixed - 1) { stop("cannot change the length of the \"varIdent\" parameter after initialization") } object[] <- value natPar <- coef(object, FALSE, allCoef = TRUE) attr(object, "logLik") <- sum(log(attr(object, "weights") <- 1/natPar[grps])) } object } Initialize.varIdent <- function(object, data, ...) { if (!is.null(form <- formula(object)) && !is.null(grpForm <- getGroupsFormula(form))) { if (length(coef(object)) > 0) { # initialized - nothing to do return(object) } strat <- attr(object, "groups") <- as.character(getGroups(data, form, level = length(splitFormula(grpForm, sep = "*")), sep = "*")) if (length((uStrat <- unique(strat))) == 1) { ## equal variances structure return(Initialize(varIdent(), data)) } if (!is.null(fix <- attr(object, "fixed"))) { fixNames <- names(fix) if (any(is.na(match(fixNames, uStrat)))) { stop("fixed parameter names in 'varIdent' must be a subset of group names") } uStratVar <- uStrat[is.na(match(uStrat, fixNames))] # varying strata uStrat <- c(uStratVar, fixNames) } else { # nothing fixed uStratVar <- uStrat } if ((nStratVar <- length(uStratVar)) == 0) { stop("cannot fix variances in all groups") } if (nStratVar > 1) { if (length(object) <= 1) { ## repeat for all groups oldAttr <- attributes(object) if (length(object) > 0) { # initialized object <- rep(as.vector(object), nStratVar - 1) } else { # uninitialized object <- rep(0, nStratVar - 1) } attributes(object) <- oldAttr attr(object, "groupNames") <- uStrat } else { if (length(as.vector(object)) != (len <- (nStratVar - 1))) { stop(gettextf("initial value for \"varIdent\" should be of length %d", len), domain = NA) } if (!is.null(stN <- attr(object, "groupNames"))) { missStrat <- uStrat[is.na(match(uStrat, stN))] if (length(missStrat) != 1) { stop("names of starting value for \"varIdent\" object must contain all but one of the stratum levels") } stN <- c(missStrat, stN) if ((length(stN) != length(uStrat)) || any(sort(stN) != sort(uStrat))) { stop("nonexistent group names for initial values in 'varIdent'") } attr(object, "groupNames") <- stN } else { attr(object, "groupNames") <- uStrat } } } else { # fixed for all but one strata oldAttr <- attributes(object) object <- numeric(0) attributes(object) <- oldAttr attr(object, "groupNames") <- uStrat } attr(object, "whichFix") <- !is.na(match(attr(object, "groupNames")[-1], names(fix))) if (all(attr(object, "whichFix"))) { if (all(attr(object, "fixed") == 0)) { ## equal variances structure return(Initialize(varIdent(), data)) } else { oldAttr <- attributes(object) object <- numeric(0) attributes(object) <- oldAttr } } ## initializing weights and logDet attr(object, "logLik") <- sum(log(attr(object, "weights") <- 1/coef(object, FALSE, allCoef = TRUE)[strat])) object } else { # no strata attr(object, "whichFix") <- TRUE NextMethod() } } needUpdate.varIdent <- function(object) FALSE recalc.varIdent <- function(object, conLin, ...) { if (is.null(formula(object))) conLin else NextMethod() } summary.varIdent <- function(object, structName = if (is.null(formula(object))) "Constant variance" else "Different standard deviations per stratum", ...) { summary.varFunc(object, structName) } ###*# varPower - power of variance covariate variance structure ####* Constructor varPower <- function(value = numeric(0), form = ~ fitted(.), fixed = NULL) { value <- unlist(value) # may be given as a list fixed <- attr(value, "fixed") <- unlist(fixed) attr(value, "formula") <- form <- asOneSidedFormula(form) if (length(all.vars(getCovariateFormula(form))) == 0) { stop("'form' must have a covariate") } if (!is.null(getGroupsFormula(form))) { if (is.null(grpNames <- names(value)) && (length(value) > 1)) { stop("initial values must have group names in 'varPower'") } if (!is.null(fixed)) { if (is.null(names(fixed))) { stop("fixed parameters must have group names in 'varPower'") } } attr(value, "groupNames") <- c(grpNames, names(fixed)) } else { # single parameter attr(value, "whichFix") <- !is.null(fixed) } class(value) <- c("varPower", "varFunc") value } ###*# Methods for standard generics coef.varPower <- function(object, unconstrained = TRUE, allCoef = FALSE, ...) { if (((length(object) == 0) && (!allCoef || is.null(attr(object, "fixed")))) || is.null(wPar <- attr(object, "whichFix"))) { ## uninitialized return(numeric(0)) } val <- double(length(wPar)) if (any(wPar)) { val[wPar] <- attr(object, "fixed") } if (any(!wPar)) { val[!wPar] <- as.vector(object) } if (!is.null(getGroupsFormula(object))) { ##different values per group names(val) <- attr(object, "groupNames") } else { names(val) <- "power" } if (!allCoef) { val <- val[!wPar] } val } "coef<-.varPower" <- function(object, ..., value) { if ((len <- length(object)) > 0) { # varying parameters value <- as.numeric(value) if (length(value) != len) { stop("cannot change the length of the \"varStruct\" parameter after initialization") } object[] <- value aux <- coef(object, FALSE, allCoef = TRUE) if (!is.null(grps <- getGroups(object))) { aux <- aux[grps] } covariateObj <- getCovariate(object) if(is.null(covariateObj)) covariateObj <- NA attr(object, "logLik") <- sum(log(attr(object, "weights") <- abs(covariateObj)^(-aux))) } else { stop("cannot change coefficients before initialization or when all parameters are fixed") } object } Initialize.varPower <- function(object, data, ...) { form <- formula(object) if (all(!is.na(match(all.vars(getCovariateFormula(form)), names(data))))) { ## can evaluate covariate on data attr(object, "needUpdate") <- FALSE attr(object, "covariate") <- getCovariate(data, form) } else { attr(object, "needUpdate") <- TRUE } if (!is.null(grpForm <- getGroupsFormula(form))) { strat <- as.character(getGroups(data, form, level = length(splitFormula(grpForm, sep = "*")), sep = "*")) uStrat <- unique(strat) if (length(uStrat) > 1) { # multi-groups attr(object, "groups") <- strat if (!is.null(attr(object, "fixed"))) { fixNames <- names(attr(object, "fixed")) if (is.null(fixNames)) { stop("fixed parameters must have group names") } if (any(is.na(match(fixNames, uStrat)))) { stop("mismatch between group names and fixed values names") } } else { fixNames <- NULL } uStratVar <- uStrat[is.na(match(uStrat, fixNames))] nStratVar <- length(uStratVar) attr(object, "whichFix") <- !is.na(match(uStrat, fixNames)) if (nStratVar > 0) { if (length(object) <= 1) { ## repeat for all groups names(object) <- NULL oldAttr <- attributes(object) if (length(object) > 0) { object <- rep(as.vector(object), nStratVar) } else { object <- rep(0, nStratVar) } attributes(object) <- oldAttr attr(object, "groupNames") <- uStrat names(object) <- uStratVar } else { if (length(as.vector(object)) != nStratVar) { stop(gettextf("initial value for \"varPower\" should be of length %d", nStratVar), domain = NA) } stN <- attr(object, "groupNames") # must have names if (length(stN) != length(uStrat) || any(sort(stN) != sort(uStrat))) { stop("nonexistent group names for initial values in \"varPower\"") } } } else { # all parameters are fixed if (all(attr(object, "fixed") == 0)) { ## equal variances structure return(Initialize(varIdent(), data)) } else { oldAttr <- attributes(object) object <- numeric(0) attributes(object) <- oldAttr attr(object, "groupNames") <- uStrat } } } else { # single stratum attr(object, "formula") <- getCovariateFormula(formula(object)) attr(object, "whichFix") <- !is.null(attr(object, "fixed")) } } if (is.null(getGroupsFormula(object))) { ## single stratum if (attr(object, "whichFix")) { if (attr(object, "fixed") == 0) { ## equal variances structure return(Initialize(varIdent(), data)) } else { # fixed power oldAttr <- attributes(object) object <- numeric(0) attributes(object) <- oldAttr } } else { len <- length(as.vector(object)) if (len == 0) { # uninitialized oldAttr <- attributes(object) object <- 0 attributes(object) <- oldAttr } else if (len > 1) { stop("initial value for \"varPower\" should be of length 1") } } } if (!is.null(covar <- getCovariate(object))) { natPar <- coef(object, allCoef = TRUE) if (!is.null(grps <- getGroups(object))) { natPar <- natPar[grps] } attr(object, "logLik") <- sum(log(attr(object, "weights") <- abs(covar^(-natPar)))) object } else { NextMethod() } } summary.varPower <- function(object, structName = "Power of variance covariate", ...) { if (!is.null(getGroupsFormula(object))) { structName <- paste(structName, " different strata", sep = ",") } summary.varFunc(object, structName) } update.varPower <- function(object, data, ...) { val <- NextMethod() if (length(val) == 0) { # chance to update weights aux <- coef(val, allCoef = TRUE) if (!is.null(grps <- getGroups(val))) { aux <- aux[grps] } attr(val, "logLik") <- sum(log(attr(val, "weights") <- abs(getCovariate(val))^(-aux))) } val } ###*# varExp - exponential of variance covariate variance structure ####* Constructor varExp <- function(value = numeric(0), form = ~ fitted(.), fixed = NULL) { value <- unlist(value) # may be given as a list fixed <- attr(value, "fixed") <- unlist(fixed) attr(value, "formula") <- form <- asOneSidedFormula(form) if (length(all.vars(getCovariateFormula(form))) == 0) { stop("'form' must have a covariate") } if (!is.null(getGroupsFormula(form))) { if (is.null(grpNames <- names(value)) && (length(value) > 1)) { stop("initial values must have group names in 'varExp'") } if (!is.null(fixed)) { if (is.null(names(fixed))) { stop("fixed parameters must have group names in 'varExp'") } } attr(value, "groupNames") <- c(grpNames, names(fixed)) } else { attr(value, "whichFix") <- !is.null(fixed) } class(value) <- c("varExp", "varFunc") value } ###*# Methods for standard generics coef.varExp <- function(object, unconstrained = TRUE, allCoef = FALSE, ...) { if (((length(object) == 0) && (!allCoef || is.null(attr(object, "fixed")))) || is.null( wPar <- attr(object, "whichFix"))) { return(numeric(0)) } val <- double(length(wPar)) if (any(wPar)) { val[wPar] <- attr(object, "fixed") } if (any(!wPar)) { val[!wPar] <- as.vector(object) } if (!is.null(getGroupsFormula(object))) { ##different values per group names(val) <- attr(object, "groupNames") } else { names(val) <- "expon" } if (!allCoef) { val <- val[!wPar] } val } "coef<-.varExp" <- function(object, ..., value) { if (length(object) > 0) { # varying parameters value <- as.numeric(value) if (length(value) != length(object)) { stop("cannot change the length of the \"varExp\" parameter after initialization") } object[] <- value aux <- coef(object, FALSE, allCoef = TRUE) if (!is.null(grps <- getGroups(object))) { aux <- aux[grps] } attr(object, "logLik") <- sum(log(attr(object, "weights") <- exp(-aux * getCovariate(object)))) } else { stop("cannot change coefficients before initialization or when all parameters are fixed") } object } Initialize.varExp <- function(object, data, ...) { form <- formula(object) if (all(!is.na(match(all.vars(getCovariateFormula(form)), names(data))))) { ## can evaluate covariate on data attr(object, "needUpdate") <- FALSE attr(object, "covariate") <- getCovariate(data, form) } else { attr(object, "needUpdate") <- TRUE } if (!is.null(grpForm <- getGroupsFormula(form))) { strat <- as.character(getGroups(data, form, level = length(splitFormula(grpForm, sep = "*")), sep = "*")) uStrat <- unique(strat) if (length(uStrat) > 1) { # multi-groups attr(object, "groups") <- strat if (!is.null(attr(object, "fixed"))) { fixNames <- names(attr(object, "fixed")) if (is.null(fixNames)) { stop("fixed parameters must have group names") } if (any(is.na(match(fixNames, uStrat)))) { stop("mismatch between group names and fixed values names") } } else { fixNames <- NULL } uStratVar <- uStrat[is.na(match(uStrat, fixNames))] nStratVar <- length(uStratVar) attr(object, "whichFix") <- !is.na(match(uStrat, fixNames)) if (nStratVar > 0) { if (length(object) <= 1) { ## repeat for all groups names(object) <- NULL oldAttr <- attributes(object) if (length(object) > 0) { object <- rep(as.vector(object), nStratVar) } else { object <- rep(0, nStratVar) } attributes(object) <- oldAttr attr(object, "groupNames") <- uStrat names(object) <- uStratVar } else { if (length(as.vector(object)) != nStratVar) { stop(gettextf("initial value for \"varExp\" should be of length %d", nStratVar), domain = NA) } stN <- attr(object, "groupNames") #must have names if ((length(stN) != length(uStrat)) || any(sort(stN) != sort(uStrat))) { stop("nonexistent group names for initial values in \"varExp\"") } } } else { if (all(attr(object, "fixed") == 0)) { ## equal variances structure return(Initialize(varIdent(), data)) } else { oldAttr <- attributes(object) object <- numeric(0) attributes(object) <- oldAttr attr(object, "groupNames") <- uStrat } } } else { # single stratum attr(object, "formula") <- getCovariateFormula(formula(object)) attr(object, "whichFix") <- !is.null(attr(object, "fixed")) } } if (is.null(getGroupsFormula(object))) { ## single stratum if (attr(object, "whichFix")) { if (!attr(object, "fixed")) { ## equal variances structure return(Initialize(varIdent(), data)) } else { oldAttr <- attributes(object) object <- numeric(0) attributes(object) <- oldAttr } } else { len <- length(as.vector(object)) if (len == 0) { # uninitialized oldAttr <- attributes(object) object <- 0 attributes(object) <- oldAttr } else if (len > 1) { stop("initial value for \"varExp\" should be of length 1") } } } if (!is.null(covar <- getCovariate(object))) { natPar <- coef(object, allCoef = TRUE) if (!is.null(grps <- getGroups(object))) { natPar <- natPar[grps] } attr(object, "logLik") <- sum(log(attr(object, "weights") <- exp(-natPar * covar))) object } else { NextMethod() } } summary.varExp <- function(object, structName = "Exponential of variance covariate", ...) { if (!is.null(getGroupsFormula(object))) { structName <- paste(structName, " different strata", sep = ",") } summary.varFunc(object, structName) } update.varExp <- function(object, data, ...) { val <- NextMethod() if (length(val) == 0) { # chance to update weights aux <- coef(val, allCoef = TRUE) if (!is.null(grps <- getGroups(val))) { aux <- aux[grps] } attr(val, "logLik") <- sum(log(attr(val, "weights") <- exp(-aux * getCovariate(val)))) } val } ###*# varConstPower - Constant plus power of covariance function ###*# variance structure ####* Constructor varConstPower <- ## Constructor for the varConstPower class function(const = numeric(0), power = numeric(0), form = ~ fitted(.), fixed = NULL) { CPconstr <- function(val, form, nam) { if ((lv <- length(val)) == 0) return(val) if (lv > 2) { stop(gettextf("%s can have at most two components", nam), domain = NA) } if (is.null(nv <- names(val))) { names(val) <- c("const", "power")[1:lv] } else { if (any(is.na(match(nv, c("const", "power"))))) { stop(gettextf("%s can only have names \"const\" and \"power\"", nam), domain = NA) } } nv <- names(val) if (data.class(val) == "list") { val <- lapply(val, unlist) grpNames <- unique(unlist(lapply(val, names))) } else { # must be a vector or a scalar if (!is.numeric(val)) { stop(gettextf("%s can only be a list or numeric", nam), domain = NA) } val <- as.list(val) names(val) <- nv grpNames <- NULL } if (!is.null(getGroupsFormula(form))) { if (any(unlist(lapply(val, function(el) { (length(el) > 1) && is.null(names(el)) })))) { stop(gettextf("%s must have group names in 'varConstPower'", nam), domain = NA) } attr(val, "groupNames") <- grpNames } if (length(val$const) > 0) { if (any(val$const <= 0)) { stop("constant in \"varConstPower\" structure must be > 0") } val$const <- log(val$const) } list(const = val$const, power = val$power) } value <- list(const = const, power = power) form <- asOneSidedFormula(form) if (length(all.vars(getCovariateFormula(form))) == 0) { stop("'form' must have a covariate") } ## initial value may be given as a vector or list. If groups are ## present and different initial values are given for each group, then ## it must be a list with components "const" and/or "power" value <- CPconstr(value, form, "Value") fixed <- CPconstr(fixed, form, "Fixed") attr(value, "formula") <- form attr(value, "groupNames") <- unique(c(attr(value, "groupNames"), attr(attr(value[["const"]], "fixed"), "groupNames"), attr(attr(value[["power"]], "fixed"), "groupNames"))) for (i in names(fixed)) { attr(value[[i]], "fixed") <- c(fixed[[i]]) } if (is.null(getGroupsFormula(form))) { # no groups whichFix <- array(FALSE, c(2,1), list(c("const", "power"), NULL)) whichFix[,1] <- unlist(lapply(value, function(el) !is.null(attr(el, "fixed")))) attr(value, "whichFix") <- whichFix } class(value) <- c("varConstPower", "varFunc") value } ###*# Methods for standard generics coef.varConstPower <- function (object, unconstrained = TRUE, allCoef = FALSE, ...) { wPar <- attr(object, "whichFix") nonInit <- !lengths(object) nonInit <- is.null(wPar) || (any(nonInit) && !all(c(wPar[nonInit, ]))) if (nonInit || (!allCoef && (length(unlist(object)) == 0))) { return(numeric(0)) } val <- array(0, dim(wPar), dimnames(wPar)) for (i in names(object)) { if (any(wPar[i, ])) { val[i, wPar[i, ]] <- attr(object[[i]], "fixed") } if (any(!wPar[i, ])) { val[i, !wPar[i, ]] <- c(object[[i]]) } } if (!unconstrained) { val[1, ] <- exp(val[1, ]) } if (!allCoef) { val <- list(const = if (!all(wPar[1, ])) val[1, !wPar[1, ]] else NULL, power = if (!all(wPar[2, ])) val[2, !wPar[2, ]] else NULL) val <- lapply(val, function(el) if(length(el) == 1) as.vector(el) else el) val <- unlist(val[!unlist(lapply(val, is.null))]) } else { val <- val[, 1:ncol(val)] } val } "coef<-.varConstPower" <- function(object, ..., value) { if (length(unlist(object)) > 0) { # varying parameters value <- as.numeric(value) if (length(value) != length(unlist(object))) { stop("cannot change the length of the parameter after initialization") } start <- 0 for(i in names(object)) { if (aux <- length(object[[i]])) { object[[i]][] <- value[start + (1:aux)] start <- start + aux } } natPar <- as.matrix(coef(object, FALSE, allCoef = TRUE)) if (!is.null(grps <- getGroups(object))) { natPar <- natPar[, grps] } attr(object, "logLik") <- sum(log(attr(object, "weights") <- 1/(natPar[1,] + abs(getCovariate(object))^natPar[2,]))) } else { stop("cannot change coefficients before initialization or when all parameters are fixed") } object } Initialize.varConstPower <- function(object, data, ...) { form <- formula(object) if (all(!is.na(match(all.vars(getCovariateFormula(form)), names(data))))) { ## can evaluate covariate on data attr(object, "needUpdate") <- FALSE attr(object, "covariate") <- getCovariate(data, form) } else { attr(object, "needUpdate") <- TRUE } dfltCoef <- c(const = log(0.1), power = 0) if (!is.null(grpForm <- getGroupsFormula(form))) { strat <- as.character(getGroups(data, form, level = length(splitFormula(grpForm, sep = "*")), sep = "*")) uStrat <- unique(strat) whichFix <- array(FALSE, c(2, length(uStrat)), list(c("const", "power"), uStrat)) if (length(uStrat) > 1) { # multi-groups attr(object, "groups") <- strat for(i in names(object)) { if (!is.null(attr(object[[i]], "fixed"))) { fixNames <- names(attr(object[[i]], "fixed")) if (is.null(fixNames)) { stop("fixed parameters must have group names") } if (any(is.na(match(fixNames, uStrat)))) { stop("mismatch between group names and fixed values names") } } else { fixNames <- NULL } uStratVar <- uStrat[is.na(match(uStrat, fixNames))] nStratVar <- length(uStratVar) whichFix[i,] <- !is.na(match(uStrat, fixNames)) if (nStratVar > 0) { if (length(object[[i]]) <= 1) { ## repeat for all groups names(object[[i]]) <- NULL oldAttr <- attributes(object[[i]]) if (length(object[[i]]) > 0) { object[[i]] <- rep(as.vector(object[[i]]), nStratVar) } else { object[[i]] <- rep(dfltCoef[i], nStratVar) } attributes(object[[i]]) <- oldAttr names(object[[i]]) <- uStratVar } else { if (length(as.vector(object[[i]])) != nStratVar) { stop(gettext("initial value should be of length %d", nStratVar), domain = NA) } stN <- names(object[[i]]) # must have names if ((length(stN) != length(uStratVar)) || any(sort(stN) != sort(uStratVar))) { stop("nonexistent group names for initial values") } } } } if (all(whichFix) && all(attr(object[["const"]], "fixed") == 0) && all(attr(object[["power"]], "fixed") == 0)) { ## equal variances structure return(Initialize(varIdent(), data)) } for(i in names(object)) { if (all(whichFix[i,])) { oldAttr <- attributes(object[[i]]) object[[i]] <- numeric(0) attributes(object[[i]]) <- oldAttr } } attr(object, "whichFix") <- whichFix attr(object, "groupNames") <- uStrat return(NextMethod()) } } ## single stratum whichFix <- attr(object, "whichFix") if (all(whichFix) && !any(unlist(lapply(object, function(el) attr(el, "fixed"))))) { ## equal variances structure return(Initialize(varIdent(), data)) } for(i in names(object)) { if (all(whichFix[i,])) { oldAttr <- attributes(object[[i]]) object[[i]] <- numeric(0) attributes(object[[i]]) <- oldAttr } else { if (length(object[[i]]) == 0) { object[[i]] <- dfltCoef[i] } } } aux <- 2 - sum(whichFix[,1]) if (length(as.vector(unlist(object))) != aux) { stop(gettext("initial value should be of length %d", aux), domain = NA) } NextMethod() } summary.varConstPower <- function(object, structName = "Constant plus power of variance covariate", ...) { if (!is.null(getGroupsFormula(object))) { structName <- paste(structName, " different strata", sep = ",") } summary.varFunc(object, structName) } update.varConstPower <- function(object, data, ...) { val <- NextMethod() if (length(unlist(val)) == 0) { # chance to update weights aux <- as.matrix(coef(val, FALSE, allCoef = TRUE)) if (!is.null(grps <- getGroups(val))) { aux <- aux[, grps] } attr(val, "logLik") <- sum(log(attr(val, "weights") <- 1/(aux[1,] + abs(getCovariate(val))^aux[2,]))) } val } ###*# varFComb - combination of variance function structures ####* Constructor varComb <- ## constructor for the varComb class function(...) { val <- list(...) if (!all(unlist(lapply(val, inherits, "varFunc")))) { stop("all arguments to 'varComb' must be of class \"varFunc\".") } if (is.null(names(val))) { names(val) <- LETTERS[seq_along(val)] } class(val) <- c("varComb", "varFunc") val } ####* Methods for local generics varWeights.varComb <- function(object) { apply(as.data.frame(lapply(object, varWeights)), 1, prod) } ###*# Methods for standard generics coef.varComb <- function(object, unconstrained = TRUE, allCoef = FALSE, ...) { unlist(lapply(object, coef, unconstrained, allCoef)) } "coef<-.varComb" <- function(object, ..., value) { plen <- attr(object, "plen") if ((len <- sum(plen)) > 0) { # varying parameters if (length(value) != len) { stop("cannot change parameter length of initialized \"varComb\" object") } start <- 0 for (i in seq_along(object)) { if (plen[i] > 0) { coef(object[[i]]) <- value[start + (1:plen[i])] start <- start + plen[i] } } } object } formula.varComb <- function(x, ...) lapply(x, formula) Initialize.varComb <- function(object, data, ...) { val <- lapply(object, Initialize, data) attr(val, "plen") <- unlist(lapply(val, function(el) length(coef(el)))) class(val) <- c("varComb", "varFunc") val } logLik.varComb <- function(object, ...) { lls <- lapply(object, logLik) val <- sum(unlist(lls)) attr(val, "df") <- sum(unlist(lapply(lls, attr, "df"))) class(val) <- "logLik" val } needUpdate.varComb <- function(object) any(unlist(lapply(object, needUpdate))) print.varComb <- function(x, ...) { cat("Combination of:\n") lapply(x, print) invisible(x) } print.summary.varComb <- function(x, ...) { cat(attr(x, "structName"),"\n") lapply(x, print, FALSE) invisible(x) } summary.varComb <- function(object, structName = "Combination of variance functions:", ...) { object[] <- lapply(object, summary) attr(object, "structName") <- structName class(object) <- c("summary.varComb", class(object)) object } update.varComb <- function(object, data, ...) { object[] <- lapply(object, update, data) object } nlme/R/nlsList.R0000644000176200001440000001421712704356630013174 0ustar liggesusers### Create a list of nls objects ### ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates ### Copyright 2006-2016 The R Core team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # nlsList <- ## A list of nls objects function(model, data, start, control, level, subset, na.action = na.fail, pool = TRUE, warn.nls = NA) # Deprecation: will be 'TRUE' UseMethod("nlsList") nlsList.selfStart <- function (model, data, start, control, level, subset, na.action = na.fail, pool = TRUE, warn.nls = NA) # Deprecation: will be 'TRUE' { mCall <- as.list(match.call())[-1] if (!inherits(data, "groupedData")) { stop("second argument must be a groupedData object") } marg <- substitute(model) if (mode(marg) != "name") { stop("cannot use an anonymous function for the model") } # Build up a call to the model function m <- call(as.character(marg)) args <- lapply(names(formals(eval(marg))), as.name) args[[1]] <- getCovariateFormula(data)[[2]] m[1 + seq_along(args)] <- args form <- formula(data) form[[3]][[2]] <- m mCall$model <- form do.call("nlsList.formula", mCall) } nlsList.formula <- function(model, data, start = NULL, control, level, subset, na.action = na.fail, pool = TRUE, warn.nls = NA) # Deprecation: will be 'TRUE' { if (!missing(level) && length(level) > 1) stop("multiple levels not allowed") ## Deprecation: options(show.error.messages = FALSE) should continue to work for now if(is.na(warn.nls <- as.logical(warn.nls))) warn.nls <- !identical(FALSE, getOption("show.error.messages")) Call <- match.call() if (!missing(subset)) { data <- data[eval(asOneSidedFormula(Call[["subset"]])[[2]], data),, drop = FALSE] } if (!is.data.frame(data)) data <- as.data.frame(data) data <- na.action(data) if (is.null(grpForm <- getGroupsFormula(model))) { if (inherits(data, "groupedData")) { if (missing(level)) level <- length(getGroupsFormula(data, asList = TRUE)) groups <- getGroups(data, level = level)[drop = TRUE] grpForm <- getGroupsFormula(data) } else { stop("'data' must be a \"groupedData\" object if 'formula' does not include groups") } } else { if (missing(level)) level <- length(getGroupsFormula(model, asList = TRUE)) model <- eval(substitute(Y ~ RHS, list(Y = model[[2]], RHS= getCovariateFormula(model)[[2]]))) groups <- getGroups(data, form = grpForm, level = level)[drop = TRUE] } if (is.null(start) && is.null(attr(data, "parameters"))) { ## no starting values ## checking for old-style selfStart functions FUN <- eval(model[[3]][[1]]) if (is.function(FUN) && class(FUN) != "selfStart" && !is.null(attr(FUN, "initial"))) { stop("old-style self-starting model functions\nare no longer supported.\nNew selfStart functions are available.\nUse\n SSfpl instead of fpl,\n SSfol instead of first.order.log,\n SSbiexp instead of biexp,\n SSlogis instead of logistic.\nIf writing your own selfStart model, see\n \"help(selfStart)\"\nfor the new form of the \"initial\" attribute.") } } controlvals <- nls.control() if(!missing(control)) controlvals[names(control)] <- control val <- lapply(split(data, groups), function(dat) tryCatch({ data <- as.data.frame(dat) if (is.null(start)) { nls(model, data = data, control = controlvals) } else { nls(model, data = data, control = controlvals, start = start) } }, error = function(e) e)) val <- warnErrList(val, warn = warn.nls) if (inherits(data, "groupedData")) { ## saving labels and units for plots attr(val, "units") <- attr(data, "units") attr(val, "labels") <- attr(data, "labels") attr(val, "outer") <- attr(data, "outer") } structure(val, class = c("nlsList", "lmList"), call = Call, dims = list(N = nrow(data), M = length(val)), groups = ordered(groups, levels = names(val)), origOrder = match(unique(as.character(groups)), names(val)), pool = pool, groupsForm = grpForm) } ###*# Methods for standard generics coef.summary.nlsList <- function(object, ...) object$parameters formula.nlsList <- function(x, ...) eval(attr(x, "call")[["model"]]) summary.nlsList <- function(object, ...) { val <- NextMethod("summary") # -> summary.lmList() class(val) <- c("summary.nlsList", class(val)) val } update.nlsList <- function (object, model., ..., evaluate = TRUE) { call <- attr(object, "call") if (is.null(call)) stop("missing call attribute in \"nlsList\" object") extras <- match.call(expand.dots = FALSE)$... if (!missing(model.)) call$model <- update.formula(formula(object), model.) if(length(extras) > 0) { existing <- !is.na(match(names(extras), names(call))) ## do these individually to allow NULL to remove entries. for (a in names(extras)[existing]) call[[a]] <- extras[[a]] if(any(!existing)) { call <- c(as.list(call), extras[!existing]) call <- as.call(call) } } if(evaluate) eval(call, parent.frame()) else call } #update.nlsList <- # function(object, model, data, start, control, level, subset, na.action, # pool, ...) #{ # thisCall <- as.list(match.call())[-(1:2)] # if (!missing(model)) { # names(thisCall)[match(names(thisCall), "model")] <- "object" # } # nextCall <- as.list(attr(object, "call")[-1]) # nextCall[names(thisCall)] <- thisCall # do.call("nlsList", nextCall) #} nlme/R/gnls.R0000644000176200001440000007257213337716344012524 0ustar liggesusers### Fit a general nonlinear regression model with correlated and/or ### heteroscedastic errors ### ### Copyright 2007-2018 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # gnls <- function(model, data = sys.frame(sys.parent()), params, start, correlation = NULL, weights = NULL, subset, na.action = na.fail, naPattern, control = list(), verbose= FALSE) { finiteDiffGrad <- function(model, data, pars) { dframe <- data.frame(data, pars) base <- eval(model, dframe) nm <- colnames(pars) grad <- array(base, c(length(base), length(nm)), list(NULL, nm)) ssize <- sqrt(.Machine$double.eps) for (i in nm) { diff <- pp <- pars[ , i] diff[pp == 0] <- ssize diff[pp != 0] <- pp[pp != 0] * ssize dframe[[i]] <- pp + diff grad[ , i] <- (base - eval(model, dframe))/diff dframe[[i]] <- pp } grad } ## keeping the call Call <- match.call() ## assigning a new name to the "object" argument form <- model ## control parameters controlvals <- gnlsControl() if (!missing(control)) { controlvals[names(control)] <- control } ## ## checking arguments ## if (!inherits(form, "formula")) stop("'object' must be a formula") if (length(form)!=3) stop("object formula must be of the form \"resp ~ pred\"") ## ## checking if self-starting formula is given ## if (missing(start)) { if (!is.null(attr(eval(form[[3]][[1]]), "initial"))) { nlsCall <- Call[c("","model","data")] nlsCall[[1]] <- quote(stats::nls) names(nlsCall)[2] <- "formula" ## checking if "data" is not equal to sys.frame(sys.parent()) if (is.null(dim(data))) { stop("'data' must be given explicitly to use 'nls' to get initial estimates") } start <- coef(eval(nlsCall)) } else { stop("no initial values for model parameters") } } else { start <- unlist(start) } gnlsModel <- call("-", form[[2]], form[[3]]) ## ## save writing list(...) when only one element ## if (missing(params)) { if (is.null(pNams <- names(start))) { stop("starting estimates must have names when 'params' is missing") } params <- list(formula(paste(paste(pNams, collapse = "+"), "1", sep = "~"))) } else if (!is.list(params)) params <- list(params) params <- unlist(lapply(params, function(pp) { if (is.name(pp[[2]])) { list(pp) } else { ## multiple parameters on left hand side eval(parse(text = paste("list(", paste(paste(all.vars(pp[[2]]), deparse(pp[[3]]), sep = "~"), collapse = ","), ")"))) } }), recursive=FALSE) pnames <- character(length(params)) for (i in seq_along(params)) { this <- eval(params[[i]]) if (!inherits(this, "formula")) stop ("'params' must be a formula or list of formulae") if (length(this) != 3) stop ("formulae in 'params' must be of the form \"parameter ~ expr\"") if (!is.name(this[[2]])) stop ("formulae in 'params' must be of the form \"parameter ~ expr\"") pnames[i] <- as.character(this[[2]]) } names(params) <- pnames ## ## If data is a pframe, copy the parameters in the frame to frame 1 ## Doesn't exist in R ## if (inherits(data, "pframe")) { ## pp <- parameters(data) ## for (i in names(pp)) { ## assign(i, pp[[i]]) ## } ## attr(data,"parameters") <- NULL ## class(data) <- "data.frame" ## } ## check if correlation is present and has groups groups <- if (!is.null(correlation)) getGroupsFormula(correlation) # else NULL # if (!is.null(correlation)) { # groups <- getGroupsFormula(correlation, asList = TRUE) # if (!is.null(groups)) { # if (length(groups) > 1) { # stop("Only single level of grouping allowed") # } # groups <- groups[[1]] # } else { # if (inherits(data, "groupedData")) { # will use as groups # groups <- getGroupsFormula(data, asList = TRUE) # if (length(groups) > 1) { # ignore it # groups <- NULL # } else { # groups <- groups[[1]] # attr(correlation, "formula") <- # eval(parse(text = paste("~", # deparse(getCovariateFormula(formula(correlation))[[2]]), # "|", deparse(groups[[2]])))) # } # } # } # } else groups <- NULL ## create an gnls structure containing the correlation and weights gnlsSt <- gnlsStruct(corStruct = correlation, varStruct = varFunc(weights)) ## extract a data frame with enough information to evaluate ## form, params, random, groups, correlation, and weights mfArgs <- list(formula = asOneFormula(formula(gnlsSt), form, params, groups, omit = c(pnames, "pi")), data = data, na.action = na.action) if (!missing(subset)) { mfArgs[["subset"]] <- asOneSidedFormula(Call[["subset"]])[[2]] } mfArgs$drop.unused.levels <- TRUE dataMod <- do.call("model.frame", mfArgs) origOrder <- row.names(dataMod) # preserve the original order ## ## Evaluating the groups expression, if needed ## if (!is.null(groups)) { ## sort the model.frame by groups and get the matrices and parameters ## used in the estimation procedures ## always use innermost level of grouping groups <- eval(substitute( ~1 | GRP, list(GRP = groups[[2]]))) grps <- getGroups(dataMod, groups, level = length(getGroupsFormula(groups, asList = TRUE))) ## ordering data by groups ord <- order(grps) grps <- grps[ord] dataMod <- dataMod[ord, ,drop = FALSE] ## revOrder <- match(origOrder, row.names(dataMod)) # putting in orig. order } else grps <- NULL N <- dim(dataMod)[1] # number of observations ## ## evaluating the naPattern expression, if any ## naPat <- if (missing(naPattern)) rep(TRUE, N) else as.logical(eval(asOneSidedFormula(naPattern)[[2]], dataMod)) origOrderShrunk <- origOrder[naPat] dataModShrunk <- dataMod[naPat, , drop=FALSE] yShrunk <- eval(form[[2]], dataModShrunk) if (!is.null(groups)) { ## ordShrunk <- ord[naPat] grpShrunk <- grps[naPat] revOrderShrunk <- match(origOrderShrunk, row.names(dataModShrunk)) } else { grpShrunk <- NULL } ## ## defining list with parameter information ## contr <- list() plist <- vector("list", length(pnames)) names(plist) <- pnames for (nm in pnames) { if (deparse(params[[nm]][[3]]) != "1") { form1s <- asOneSidedFormula(params[[nm]][[3]]) plist[[nm]] <- model.matrix(form1s, model.frame(form1s, dataModShrunk)) auxContr <- attr(plist[[nm]], "contrasts") contr <- c(contr, auxContr[is.na(match(names(auxContr), names(contr)))]) } else plist[[nm]] <- TRUE } ## ## Params effects names ## pn <- character(0) currPos <- 0 parAssign <- list() for(nm in pnames) { if (is.logical(p <- plist[[nm]])) { currPos <- currPos + 1 currVal <- list(currPos) pn <- c(pn, nm) names(currVal) <- nm parAssign <- c(parAssign, currVal) } else { currVal <- attr(p, "assign") fTerms <- terms(asOneSidedFormula(params[[nm]][[3]]), data=data) namTerms <- attr(fTerms, "term.labels") if (attr(fTerms, "intercept") > 0) { namTerms <- c("(Intercept)", namTerms) } namTerms <- factor(currVal, labels = namTerms) currVal <- split(order(currVal), namTerms) names(currVal) <- paste(nm, names(currVal), sep = ".") parAssign <- c(parAssign, lapply(currVal, function(el, currPos) { el + currPos }, currPos = currPos)) currPos <- currPos + length(unlist(currVal)) pn <- c(pn, paste(nm, colnames(p), sep = ".")) } } pLen <- length(pn) if (length(start) != pLen) stop ("starting values for parameters are not of the correct length") spar <- start names(spar) <- pn NReal <- sum(naPat) ## ## Creating the params map ## pmap <- list() n1 <- 1 for(nm in pnames) { if (is.logical(p <- plist[[nm]])) { pmap[[nm]] <- n1 n1 <- n1 + 1 } else { pmap[[nm]] <- n1:(n1+ncol(p) - 1) n1 <- n1 + ncol(p) } } ## ## defining the nlFrame, i.e., nlEnv, an environment in R : ## nlEnv <- list2env( list(model = gnlsModel, data = dataMod, plist = plist, beta = as.vector(spar), X = array(0, c(NReal, pLen), list(NULL, pn)), pmap = pmap, N = NReal, naPat = naPat, .parameters = c("beta"), finiteDiffGrad = finiteDiffGrad)) modelExpression <- ~ { pars <- getParsGnls(plist, pmap, beta, N) res <- eval(model, data.frame(data, pars)) if (!length(grad <- attr(res, "gradient"))) { grad <- finiteDiffGrad(model, data, pars)[naPat, , drop = FALSE] } else { grad <- grad[naPat, , drop = FALSE] } res <- res[naPat] for (nm in names(plist)) { gradnm <- grad[, nm] X[, pmap[[nm]]] <- if(is.logical(p <- plist[[nm]])) gradnm else gradnm * p } result <- c(X, res) result[is.na(result)] <- 0 result } modelResid <- ~eval(model, data.frame(data, getParsGnls(plist, pmap, beta, N)))[naPat] w <- eval(modelResid[[2]], envir = nlEnv) ## creating the condensed linear model ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions fixedSigma <- controlvals$sigma > 0 Dims <- list(p = pLen, N = NReal, REML = FALSE) attr(gnlsSt, "conLin") <- list(Xy = array(w, c(NReal, 1), list(row.names(dataModShrunk), deparse(form[[2]]))), dims = Dims, logLik = 0, ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions sigma=controlvals$sigma, auxSigma=0, fixedSigma=fixedSigma) ## additional attributes of gnlsSt attr(gnlsSt, "resp") <- yShrunk attr(gnlsSt, "model") <- modelResid attr(gnlsSt, "local") <- nlEnv attr(gnlsSt, "NReal") <- NReal ## initialization gnlsSt <- Initialize(gnlsSt, dataModShrunk) parMap <- attr(gnlsSt, "pmap") numIter <- 0 # number of iterations nlsSettings <- c(controlvals$nlsMaxIter, controlvals$minScale, controlvals$nlsTol, 0, 0, 0) nlModel <- nonlinModel(modelExpression, nlEnv) repeat { ## alternating algorithm numIter <- numIter + 1 ## GLS step if (needUpdate(gnlsSt)) { # updating varying weights gnlsSt <- update(gnlsSt, dataModShrunk) } if (length(oldPars <- coef(gnlsSt)) > 0) { if (controlvals$opt == "nlminb") { optRes <- nlminb(c(coef(gnlsSt)), function(gnlsPars) -logLik(gnlsSt, gnlsPars), control = list(trace = controlvals$msVerbose, iter.max = controlvals$msMaxIter)) convIter <- optRes$iterations } else { optRes <- optim(c(coef(gnlsSt)), function(gnlsPars) -logLik(gnlsSt, gnlsPars), method = controlvals$optimMethod, control = list(trace = controlvals$msVerbose, maxit = controlvals$msMaxIter, reltol = if(numIter == 0) controlvals$msTol else 100*.Machine$double.eps)) convIter <- optRes$count[2] } aConv <- coef(gnlsSt) <- optRes$par if (verbose) { cat("\n**Iteration", numIter) cat("\n") cat("GLS step: Objective:", format(optRes$value)) print(gnlsSt) } } else { aConv <- oldPars <- NULL } ## NLS step if (is.null(correlation)) { cF <- 1.0 cD <- 1 } else { cF <- corFactor(gnlsSt$corStruct) cD <- Dim(gnlsSt$corStruct) } if (is.null(weights)) { vW <- 1.0 } else { vW <- varWeights(gnlsSt$varStruct) } work <- .C(fit_gnls, thetaNLS = as.double(spar), as.integer(unlist(Dims)), as.double(cF), as.double(vW), as.integer(unlist(cD)), settings = as.double(nlsSettings), additional = double(NReal), as.integer(!is.null(correlation)), as.integer(!is.null(weights)), nlModel, NAOK = TRUE)[c("thetaNLS", "settings", "additional")] if (work$settings[4] == 1) { ## convResult <- 2 msg <- "step halving factor reduced below minimum in NLS step" if (controlvals$returnObject) { warning(msg) break } else stop(msg) } oldPars <- c(spar, oldPars) spar[] <- work$thetaNLS if (length(coef(gnlsSt)) == 0 && work$settings[5] < controlvals$nlsMaxIter) { break } attr(gnlsSt, "conLin")$Xy[] <- work$additional attr(gnlsSt, "conLin")$logLik <- 0 if (verbose) { cat("\nNLS step: RSS = ", format(work$settings[6]), "\n model parameters:") for (i in 1:pLen) cat(format(signif(spar[i]))," ") cat("\n iterations:",work$settings[5],"\n") } aConv <- c(spar, aConv) conv <- abs((oldPars - aConv)/ ifelse(abs(aConv) < controlvals$tolerance, 1, aConv)) aConv <- c(max(conv[1:pLen])) names(aConv) <- "params" if (length(conv) > pLen) { conv <- conv[-(1:pLen)] for(i in names(gnlsSt)) { if (any(parMap[,i])) { aConv <- c(aConv, max(conv[parMap[,i]])) names(aConv)[length(aConv)] <- i } } } if (verbose) { cat("\nConvergence:\n") print(aConv) } if ((max(aConv) <= controlvals$tolerance) || (aConv["params"] <= controlvals$tolerance && convIter == 1)) { ## convResult <- 0 break } if (numIter >= controlvals$maxIter) { ## convResult <- 1 msg <- "maximum number of iterations reached without convergence" if (controlvals$returnObject) { warning(msg) break } else stop(msg) } } ## end{ repeat } -------------- ## wraping up ww <- eval(modelExpression[[2]], envir = nlEnv) auxRes <- ww[NReal * pLen + (1:NReal)] attr(gnlsSt, "conLin")$Xy <- array(ww, c(NReal, pLen + 1)) attr(gnlsSt, "conLin") <- c.L <- recalc(gnlsSt) ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions if((sigma <- controlvals$sigma) == 0) { sigma <- sqrt(sum((c.L$Xy[, pLen + 1])^2)/(NReal - pLen)) lsig <- log(sigma) + 0.5 * log(1 - pLen/NReal) loglik <- ( - NReal * (1 + log(2 * pi) + 2 * lsig))/2 + c.L$logLik } else { lsig <- log(sigma) loglik <- - (NReal * (log(2 * pi)/2 + lsig) + sum((c.L$Xy[, pLen + 1])^2) / (2 * sigma^2)) + c.L$logLik } ## #### varBeta <- qr(c.L$Xy[ , 1:pLen, drop = FALSE]) if (varBeta$rank < pLen) { ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions print("approximate covariance matrix for parameter estimates not of full rank") return() } attr(parAssign, "varBetaFact") <- varBeta <- sigma * t(backsolve(qr.R(varBeta), diag(pLen))) varBeta <- crossprod(varBeta) dimnames(varBeta) <- list(pn, pn) ## ## fitted.values and residuals (in original order) ## Resid <- resid(gnlsSt) Fitted <- yShrunk - Resid attr(Resid, "std") <- sigma/(varWeights(gnlsSt)) if (!is.null(groups)) { attr(Resid, "std") <- attr(Resid, "std")[revOrderShrunk] Resid[] <- Resid[revOrderShrunk] Fitted[] <- Fitted[revOrderShrunk] grpShrunk[] <- grpShrunk[revOrderShrunk] } names(Resid) <- names(Fitted) <- origOrderShrunk ## getting the approximate var-cov of the parameters ## first making Xy into single column array again attr(gnlsSt, "conLin")$Xy <- array(auxRes, c(NReal, 1)) ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions attr(gnlsSt, "fixedSigma") <- (controlvals$sigma > 0) apVar <- if (controlvals$apVar) gnlsApVar(gnlsSt, lsig, .relStep = controlvals[[".relStep"]], minAbsPar = controlvals[["minAbsParApVar"]]) else "Approximate variance-covariance matrix not available" ## getting rid of condensed linear model and fit oClass <- class(gnlsSt) attributes(gnlsSt) <- attributes(gnlsSt)[!is.na(match(names(attributes(gnlsSt)), ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions c("names","pmap","fixedSigma")))] class(gnlsSt) <- oClass grpDta <- inherits(data, "groupedData") ## ## creating the gnls object ## structure(class = c("gnls", "gls"), list(modelStruct = gnlsSt, dims = Dims, contrasts = contr, coefficients = spar, varBeta = varBeta, ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions sigma = if(controlvals$sigma) controlvals$sigma else sigma, apVar = apVar, logLik = loglik, numIter = numIter, groups = grpShrunk, call = Call, method = "ML", fitted = Fitted, residuals = Resid, plist = plist, pmap = pmap, parAssign = parAssign, na.action = attr(dataMod, "na.action")), ## saving labels and units for plots units = if(grpDta) attr(data, "units"), labels= if(grpDta) attr(data, "labels")) } ### Auxiliary functions used internally in gls and its methods gnlsApVar <- function(gnlsSt, lsigma, conLin = attr(gnlsSt, "conLin"), .relStep = (.Machine$double.eps)^(1/3), minAbsPar = 0, natural = TRUE) { ## calculate approximate variance-covariance matrix of all parameters ## except the coefficients fullGnlsLogLik <- function(Pars, object, conLin, N) { ## logLik as a function of sigma and coef(glsSt) ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions fixedSigma <- attr(object,"fixedSigma") npar <- length(Pars) if (!fixedSigma) { lsigma <- Pars[npar] Pars <- Pars[-npar] } else { lsigma <- log(conLin$sigma) } ####### coef(object) <- Pars conLin <- recalc(object, conLin) conLin[["logLik"]] - N * lsigma - sum(conLin$Xy^2)/(2*exp(2*lsigma)) } fixedSigma <- attr(gnlsSt,"fixedSigma") if (length(gnlsCoef <- coef(gnlsSt)) > 0) { cSt <- gnlsSt[["corStruct"]] if (!is.null(cSt) && inherits(cSt, "corSymm") && natural) { cStNatPar <- coef(cSt, unconstrained = FALSE) class(cSt) <- c("corNatural", "corStruct") coef(cSt) <- log((cStNatPar + 1)/(1 - cStNatPar)) gnlsSt[["corStruct"]] <- cSt gnlsCoef <- coef(gnlsSt) } dims <- conLin$dims N <- dims$N conLin[["logLik"]] <- 0 # making sure ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions Pars <- if(fixedSigma) gnlsCoef else c(gnlsCoef, lSigma = lsigma) # log(sigma) is used as input in contrast to gls val <- fdHess(Pars, fullGnlsLogLik, gnlsSt, conLin, N, .relStep = .relStep, minAbsPar = minAbsPar)[["Hessian"]] if (all(eigen(val, only.values=TRUE)$values < 0)) { ## negative definite - OK val <- solve(-val) ## ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions ## if(fixedSigma && !is.null(dim(val))){ ## Pars <- c(gnlsCoef, lSigma = lsigma) ## npars<-length(Pars) ## val<-cbind(val,rep(0,npars-1)) ## val<-rbind(val,rep(0,npars)) ## } nP <- names(Pars) dimnames(val) <- list(nP, nP) attr(val, "Pars") <- Pars attr(val, "natural") <- natural val } else { ## problem - solution is not maximum "Non-positive definite approximate variance-covariance" } } else { NULL } } ### ### function used to calculate the parameters from ### the params and random effects ### getParsGnls <- function(plist, pmap, beta, N) { pars <- array(0, c(N, length(plist)), list(NULL, names(plist))) for (nm in names(plist)) { pars[, nm] <- if (is.logical(p <- plist[[nm]])) beta[pmap[[nm]]] else p %*% beta[pmap[[nm]]] } pars } ### ### Methods for standard generics ### coef.gnls <- function(object, ...) object$coefficients formula.gnls <- function(x, ...) eval(x$call[["model"]]) getData.gnls <- function(object) { mCall <- object$call data <- eval(mCall$data) if (is.null(data)) return(data) naPat <- eval(mCall$naPattern) if (!is.null(naPat)) { data <- data[eval(naPat[[2]], data), , drop = FALSE] } naAct <- eval(mCall$na.action) if (!is.null(naAct)) { data <- naAct(data) } subset <- mCall$subset if (!is.null(subset)) { subset <- eval(asOneSidedFormula(subset)[[2]], data) data <- data[subset, ] } data } logLik.gnls <- ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions function(object, REML = FALSE, ...) { if (REML) { stop("cannot calculate REML log-likelihood for \"gnls\" objects") } ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions fixSig <- attr(object[["modelStruct"]], "fixedSigma") fixSig <- !is.null(fixSig) && fixSig p <- object$dims$p N <- object$dims$N val <- object[["logLik"]] attr(val, "nobs") <- attr(val, "nall") <- N ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions attr(val, "df") <- p + length(coef(object[["modelStruct"]])) + as.integer(!fixSig) class(val) <- "logLik" val } nobs.gnls <- function(object, ...) object$dims$N predict.gnls <- function(object, newdata, na.action = na.fail, naPattern = NULL, ...) { ## ## method for predict() designed for objects inheriting from class gnls ## if (missing(newdata)) { # will return fitted values return(fitted(object)) } newdata <- data.frame(newdata, check.names = FALSE) mCall <- object$call mfArgs <- list(formula = asOneFormula(formula(object), mCall$params, naPattern, omit = c(names(object$plist), "pi", deparse(getResponseFormula(object)[[2]]))), data = newdata, na.action = na.action, drop.unused.levels = TRUE) dataMod <- do.call("model.frame", mfArgs) ## making sure factor levels are the same as in contrasts contr <- object$contrasts for(i in names(dataMod)) { if (inherits(dataMod[,i], "factor") && !is.null(contr[[i]]) && is.matrix(contr[[i]]) ) { levs <- levels(dataMod[,i]) levsC <- dimnames(contr[[i]])[[1]] if (any(wch <- is.na(match(levs, levsC)))) { stop(sprintf(ngettext(sum(wch), "level %s not allowed for %s", "levels %s not allowed for %s"), paste(levs[wch], collapse = ",")), domain = NA) } attr(dataMod[,i], "contrasts") <- contr[[i]][levs, , drop = FALSE] # if (length(levs) < length(levsC)) { # if (inherits(dataMod[,i], "ordered")) { # dataMod[,i] <- ordered(as.character(dataMod[,i]), levels = levsC) # } else { # dataMod[,i] <- factor(as.character(dataMod[,i]), levels = levsC) # } # } } } N <- nrow(dataMod) ## ## evaluating the naPattern expression, if any ## naPat <- if (is.null(naPattern)) rep(TRUE, N) else as.logical(eval(asOneSidedFormula(naPattern)[[2]], dataMod)) ## ## Getting the plist for the new data frame ## ## plist <- object$plist pnames <- names(plist) if (is.null(params <- eval(object$call$params))) { params <- list(formula(paste0(paste(pnames, collapse = "+"), "~ 1"))) } else if (!is.list(params)) params <- list(params) params <- unlist(lapply(params, function(pp) { if (is.name(pp[[2]])) { list(pp) } else { ## multiple parameters on left hand side eval(parse(text = paste("list(", paste(paste(all.vars(pp[[2]]), deparse(pp[[3]]), sep = "~"), collapse = ","), ")"))) } }), recursive=FALSE) names(params) <- pnames prs <- coef(object) ## pn <- names(prs) for(nm in pnames) { if (!is.logical(plist[[nm]])) { form1s <- asOneSidedFormula(params[[nm]][[3]]) plist[[nm]] <- model.matrix(form1s, model.frame(form1s, dataMod)) } } modForm <- getCovariateFormula(object)[[2]] val <- eval(modForm, data.frame(dataMod, getParsGnls(plist, object$pmap, prs, N)))[naPat] names(val) <- row.names(newdata) lab <- "Predicted values" if (!is.null(aux <- attr(object, "units")$y)) { lab <- paste(lab, aux) } attr(val, "label") <- lab val } #based on R's update.default update.gnls <- function (object, model., ..., evaluate = TRUE) { call <- object$call if (is.null(call)) stop("need an object with call component") extras <- match.call(expand.dots = FALSE)$... if (!missing(model.)) call$model <- update.formula(formula(object), model.) if(length(extras) > 0) { existing <- !is.na(match(names(extras), names(call))) ## do these individually to allow NULL to remove entries. for (a in names(extras)[existing]) call[[a]] <- extras[[a]] if(any(!existing)) call <- as.call(c(as.list(call), extras[!existing])) } if(evaluate) eval(call, parent.frame()) else call } #update.gnls <- # function(object, model, data = sys.frame(sys.parent()), params, start , # correlation = NULL, weights = NULL, subset, # na.action = na.fail, naPattern, control = list(), # verbose = FALSE, ...) #{ # thisCall <- as.list(match.call())[-(1:2)] # nextCall <- as.list(object$call)[-1] # if (!is.null(thisCall$model)) { # thisCall$model <- update(formula(object), model) # } else { # same model # if (is.null(thisCall$start)) { # thisCall$start <- coef(object) # } # } # if (is.na(match("correlation", names(thisCall))) && # !is.null(thCor <- object$modelStruct$corStruct)) { # thisCall$correlation <- thCor # } # if (is.na(match("weights", names(thisCall))) && # !is.null(thWgt <- object$modelStruct$varStruct)) { # thisCall$weights <- thWgt # } # nextCall[names(thisCall)] <- thisCall # do.call("gnls", nextCall) #} ###*### gnlsStruct - a model structure for gnls fits gnlsStruct <- ## constructor for gnlsStruct objects function(corStruct = NULL, varStruct = NULL) { val <- list(corStruct = corStruct, varStruct = varStruct) val <- val[!sapply(val, is.null)] # removing NULL components # attr(val, "settings") <- attr(val$reStruct, "settings") # attr(val, "resp") <- resp # attr(val, "model") <- model # attr(val, "local") <- local # attr(val, "N") <- N # attr(val, "naPat") <- naPat class(val) <- c("gnlsStruct", "glsStruct", "modelStruct") val } ##*## gnlsStruct methods for standard generics fitted.gnlsStruct <- function(object, ...) attr(object, "resp") - resid(object) Initialize.gnlsStruct <- function(object, data, ...) { if (length(object)) { object[] <- lapply(object, Initialize, data) theta <- lapply(object, coef) len <- lengths(theta) num <- seq_along(len) pmap <- if (sum(len) > 0) outer(rep(num, len), num, "==") else array(FALSE, c(1, length(len))) dimnames(pmap) <- list(NULL, names(object)) attr(object, "pmap") <- pmap if (needUpdate(object)) object <- update(object, data) } object } logLik.gnlsStruct <- function(object, Pars, conLin = attr(object, "conLin"), ...) { coef(object) <- Pars # updating parameter values conLin <- recalc(object, conLin) ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions if(conLin$sigma == 0) { conLin[["logLik"]] - (conLin$dims$N * log(sum(conLin$Xy^2)))/2 } else { conLin[["logLik"]] - conLin$dims$N * log(conLin$sigma) - sum(conLin$Xy^2) / (2 * conLin$sigma^2) } } residuals.gnlsStruct <- function(object, ...) { c(eval(attr(object, "model")[[2]], envir = attr(object, "local"))) } gnlsControl <- ## Set control values for iterations within gnls function(maxIter = 50, nlsMaxIter = 7, msMaxIter = 50, minScale = 0.001, tolerance = 1e-6, nlsTol = 0.001, msTol = 1e-7, returnObject = FALSE, msVerbose = FALSE, apVar = TRUE, .relStep = .Machine$double.eps^(1/3), opt = c("nlminb", "optim"), optimMethod = "BFGS", ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions minAbsParApVar = 0.05, sigma=NULL) { ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions if(is.null(sigma)) sigma <- 0 else if(!is.finite(sigma) || length(sigma) != 1 || sigma < 0) stop("Within-group std. dev. must be a positive numeric value") list(maxIter = maxIter, nlsMaxIter = nlsMaxIter, msMaxIter = msMaxIter, minScale = minScale, tolerance = tolerance, nlsTol = nlsTol, msTol = msTol, returnObject = returnObject, msVerbose = msVerbose, apVar = apVar, opt = match.arg(opt), optimMethod = optimMethod, ## 17-11-2015; Fixed sigma patch; SH Heisterkamp; Quantitative Solutions .relStep = .relStep, minAbsParApVar = minAbsParApVar, sigma=sigma) } ## Local Variables: ## ess-indent-offset: 2 ## End: nlme/R/lmList.R0000644000176200001440000013424513336503465013016 0ustar liggesusers### Create a list of lm objects ### ### Copyright 2005-2018 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # lmList <- ## a list of lm objects from a formula or a groupedData object function(object, data, level, subset, na.action = na.fail, pool = TRUE, warn.lm = TRUE) UseMethod("lmList") if(getRversion() < "3.5.0") { ##' Utility for lmList() and nlsList(): Collect errors from a list \code{val}, ##' produce a "summary warning" and keep that message as "warningMsg" attribute warnErrList <- function(val, warn = TRUE) { errs <- vapply(val, inherits, NA, what = "error") if (any(errs)) { v.err <- val[errs] e.call <- paste(deparse(conditionCall(v.err[[1]])), collapse = "\n") tt <- table(vapply(v.err, conditionMessage, "")) msg <- if(length(tt) == 1) sprintf(ngettext(tt[[1]], "%d error caught in %s: %s", "%d times caught the same error in %s: %s"), tt[[1]], e.call, names(tt)[[1]]) else ## at least two different errors caught paste(gettextf( "%d errors caught in %s. The error messages and their frequencies are", sum(tt), e.call), paste(capture.output(sort(tt)), collapse="\n"), sep="\n") if(warn) warning(msg, call. = FALSE, domain = NA) val[errs] <- list(NULL) attr(val, "warningMsg") <- msg } val } }# R <= 3.4.x lmList.groupedData <- function(object, data, level, subset, na.action = na.fail, pool = TRUE, warn.lm = TRUE) { ### object will provide the formula, the data, and the groups form <- formula(object) args <- as.list(match.call())[-1L] args[["object"]] <- eval(substitute(Y ~ RHS, list(Y = form[[2]], RHS= form[[3]][[2]]))) if (!missing(data)) { message("'data' argument not used, but taken from groupedData object") args[["data"]] <- substitute(object) } else { args <- c(args, list(data = substitute(object))) } do.call(lmList.formula, args) } lmList.formula <- function(object, data, level, subset, na.action = na.fail, pool = TRUE, warn.lm = TRUE) { Call <- match.call() if (!missing(subset)) { data <- data[eval(asOneSidedFormula(Call[["subset"]])[[2]], data),, drop = FALSE] } if (!inherits(data, "data.frame")) data <- as.data.frame(data) data <- na.action(data) if (is.null(grpForm <- getGroupsFormula(object))) { if (inherits(data, "groupedData")) { if (missing(level)) level <- length(getGroupsFormula(data, asList = TRUE)) else if (length(level) > 1) { stop("multiple levels not allowed") } groups <- getGroups(data, level = level)[drop = TRUE] grpForm <- getGroupsFormula(data) Call$object <- eval(parse(text=paste(deparse(Call$object), deparse(grpForm[[2]]), sep = "|"))) } else { stop ("'data' must be a \"groupedData\" object if 'groups' argument is missing") } } else { if (missing(level)) level <- length(getGroupsFormula(object, asList = TRUE)) else if (length(level) > 1) { stop("multiple levels not allowed") } groups <- getGroups(data, form = grpForm, level = level)[drop = TRUE] object <- eval(substitute(Y ~ X, list(Y = getResponseFormula (object)[[2]], X = getCovariateFormula(object)[[2]]))) } val <- lapply(split(data, groups), function(dat) tryCatch(lm(object, data = dat, na.action = na.action), error = function(e) e)) val <- warnErrList(val, warn = warn.lm) if (inherits(data, "groupedData")) { ## saving labels and units for plots attr(val, "units") <- attr(data, "units") attr(val, "labels") <- attr(data, "labels") } structure(val, class = "lmList", dims = list(N = nrow(data), M = length(val)), call = Call, groupsForm = grpForm, groups = ordered(groups, levels = names(val)), origOrder = match(unique(as.character(groups)), names(val)), level = level, pool = pool) } ###*# Methods for standard generics augPred.lmList <- function(object, primary = NULL, minimum = min(primary), maximum = max(primary), length.out = 51, ...) { data <- eval(attr(object, "call")[["data"]]) if (!inherits(data, "data.frame")) { stop(gettextf("'data' in %s call must evaluate to a data frame", sQuote(substitute(object))), domain = NA) } if(is.null(primary)) { if (!inherits(data, "groupedData")) { stop(gettextf("%s without \"primary\" can only be used with fits of \"groupedData\" objects", sys.call()[[1]]), domain = NA) } primary <- getCovariate(data) pr.var <- getCovariateFormula(data)[[2L]] } else { pr.var <- asOneSidedFormula(primary)[[2L]] primary <- eval(pr.var, data) } prName <- c_deparse(pr.var) newprimary <- seq(from = minimum, to = maximum, length.out = length.out) groups <- getGroups(object) grName <- deparse(gr.v <- getGroupsFormula(object)[[2]]) ugroups <- unique(groups) value <- data.frame(rep(newprimary, length(ugroups)), rep(ugroups, rep(length(newprimary), length(ugroups)))) names(value) <- c(prName, grName) ## recovering other variables in data that may be needed for predictions ## varying variables will be replaced by their means summData <- gsummary(data, groups = groups) if (any(toAdd <- is.na(match(names(summData), names(value))))) { summData <- summData[, toAdd, drop = FALSE] } value[, names(summData)] <- summData[value[, 2], ] pred <- c(predict(object, value, asList = FALSE)) newvals <- cbind(value[, 1:2], pred) names(newvals)[3] <- respName <- deparse(resp.v <- getResponseFormula(object)[[2]]) orig <- data.frame(primary, groups, getResponse(object)) names(orig) <- names(newvals) value <- rbind(orig, newvals) attributes(value[, 2]) <- attributes(groups) value[, ".type"] <- ordered(c(rep("original", nrow(data)), rep("predicted", nrow(newvals))), levels = c("predicted", "original")) labs <- list(x = prName, y = respName) unts <- list(x = "", y = "") if(inherits(data, "groupedData")) { labs[names(attr(data, "labels"))] <- attr(data, "labels") unts[names(attr(data, "units"))] <- attr(data, "units") attr(value, "units") <- attr(data, "units") } structure(value, class = c("augPred", class(value)), labels = labs, units = unts, formula = eval(substitute(Y ~ X | G, list(Y = resp.v, X = pr.var, G = gr.v)))) } coef.lmList <- ## Extract the coefficients and form a data.frame if possible function(object, augFrame = FALSE, data = NULL, which = NULL, FUN = mean, omitGroupingFactor = TRUE, ...) { coefs <- lapply(object, coef) non.null <- !vapply(coefs, is.null, NA) ## size the data frame to cope with combined levels for factors ## and name the columns so can fill by name if (sum(non.null) > 0) { coefNames <- unique(as.vector(sapply(coefs[non.null], names))) co <- matrix(NA, ncol=length(coefNames), nrow=length(coefs), byrow=TRUE, dimnames=list(names(object), coefNames)) ## template <- coefs[non.null][[1]] ## if (is.numeric(template)) { ## co <- matrix(template, ## ncol = length(template), ## nrow = length(coefs), ## byrow = TRUE, ## dimnames = list(names(object), names(template))) for (i in names(object)) { co[i, names(coefs[[i]])] <- if (is.null(coefs[[i]])) { NA } else coefs[[i]] } coefs <- as.data.frame(co) effectNames <- names(coefs) if(augFrame) { if (is.null(data)) { data <- getData(object) } data <- as.data.frame(data) if (is.null(which)) { which <- 1:ncol(data) } data <- data[, which, drop = FALSE] ## eliminating columns with same names as effects data <- data[, is.na(match(names(data), effectNames)), drop = FALSE] data <- gsummary(data, FUN = FUN, groups = getGroups(object)) if (omitGroupingFactor) { data <- data[, is.na(match(names(data), names(getGroupsFormula(object, asList = TRUE)))), drop = FALSE] } if (length(data) > 0) { coefs <- cbind(coefs, data[row.names(coefs),,drop = FALSE]) } } attr(coefs, "level") <- attr(object, "level") attr(coefs, "label") <- "Coefficients" attr(coefs, "effectNames") <- effectNames attr(coefs, "standardized") <- FALSE attr(coefs, "grpNames") <- deparse(getGroupsFormula(object)[[2]]) class(coefs) <- c("coef.lmList", "ranef.lmList", class(coefs)) } ##} coefs } fitted.lmList <- function(object, subset = NULL, asList = FALSE, ...) { if(!is.null(subset)) { if(is.character(subset)) { if (any(is.na(match(subset, names(object))))) { stop("nonexistent groups requested in 'subset'") } } else { if (is.integer(subset)) { if (any(is.na(match(subset, seq_along(object))))) { stop("nonexistent groups requested in 'subset'") } } else { stop("'subset' can only be character or integer") } } oclass <- class(object) oatt <- attr(object, "call") object <- object[subset] attr(object, "call") <- oatt class(object) <- oclass } val <- lapply(object, fitted) if(!asList) { #convert to array ngrps <- table(getGroups(object))[names(object)] if(any(aux <- vapply(object, is.null, NA))) { for(i in names(ngrps[aux])) { val[[i]] <- rep(NA, ngrps[i]) } } val <- val[attr(object, "origOrder")] # putting in original order namVal <- names(val) val <- unlist(val) names(val) <- rep(namVal, ngrps) } lab <- "Fitted values" if (!is.null(aux <- attr(object, "units")$y)) { lab <- paste(lab, aux) } attr(val, "label") <- lab val } fixef.lmList <- function(object, ...) { coeff <- coef(object) if(is.matrix(coeff) || is.data.frame(coeff)) { colMeans(coeff, na.rm = TRUE) } # else NULL } formula.lmList <- function(x, ...) eval(attr(x, "call")[["object"]]) getData.lmList <- function(object) { mCall <- attr(object, "call") data <- eval(mCall$data) if (is.null(data)) return(data) naAct <- eval(mCall$na.action) if (!is.null(naAct)) { data <- naAct(data) } subset <- mCall$subset if (!is.null(subset)) { subset <- eval(asOneSidedFormula(subset)[[2]], data) data <- data[subset, ] } return(data) } getGroups.lmList <- function(object, form, level, data, sep) attr(object, "groups") getGroupsFormula.lmList <- function(object, asList = FALSE, sep) { val <- attr(object, "groupsForm") getGroupsFormula(eval(substitute(~ 1 | GR, list(GR = val[[2]]))), asList = asList) } getResponse.lmList <- function(object, form) fitted(object) + resid(object) intervals.lmList <- function(object, level = 0.95, pool = attr(object, "pool"), ...) { smry <- summary(object, pool = pool) coeff <- coef(smry) out <- coeff[ , 1:3 , ] dn <- dimnames(out) dimnames(out) <- if(is.null(dn)) list(NULL, c("lower", "est.", "upper")) else { dn[[2]] <- c("lower", "est.", "upper") dn } mult <- sqrt(qf(level, 1, smry$df.residual)) out[ , "est.", ] <- coeff[ , "Estimate", ] out[ , "lower", ] <- out[ , "est.", ] - mult * coeff[ , "Std. Error", ] out[ , "upper", ] <- out[ , "est.", ] + mult * coeff[ , "Std. Error", ] attr(out, "groupsName") <- deparse(attr(object, "groupsForm")[[2]]) class(out) <- "intervals.lmList" out } logLik.lmList <- function(object, REML = FALSE, pool = attr(object, "pool"), ...) { if(any(vapply(object, is.null, NA))) { stop("log-likelihood not available with NULL fits") } if(pool) { aux <- rowSums(sapply(object, function(el) { res <- resid(el) p <- el$rank n <- length(res) if (is.null(w <- el$weights)) w <- rep(1, n) else { excl <- w == 0 if (any(excl)) { res <- res[!excl] n <- length(res) w <- w[!excl] } } c(n, sum(w * res^2), p, sum(log(w)), sum(log(abs(diag(el$qr$qr)[1:p])))) })) N <- aux[1] - REML * aux[3] val <- (aux[4] - N * (log(2 * pi) + 1 - log(N) + log(aux[2])))/2 - REML * aux[5] attr(val, "nall") <- aux[1] attr(val, "nobs") <- N attr(val, "df") <- aux[3] + 1 } else { aux <- lapply(object, logLik, REML) val <- sum(unlist(aux)) attr(val, "nobs") <- sum(sapply(aux, function(x) attr(x, "nobs"))) attr(val, "df") <- sum(sapply(aux, function(x) attr(x, "df"))) } class(val) <- "logLik" val } pairs.lmList <- function(x, form = ~ coef(.), label, id = NULL, idLabels = NULL, grid = FALSE, ...) { object <- x ## scatter plot matrix plots, generally based on coef or random.effects if (!inherits(form, "formula")) { stop("'form' must be a formula") } if (length(form) != 2) { stop("'form' must be a one-sided formula") } ## constructing data allV <- all.vars(asOneFormula(form, id, idLabels)) allV <- allV[is.na(match(allV,c("T","F","TRUE","FALSE")))] if (length(allV) > 0) { data <- getData(object) if (is.null(data)) { # try to construct data alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(as.list(quote(data.frame)), alist) mode(alist) <- "call" data <- eval(alist, sys.parent(1)) } else { if (any(naV <- is.na(match(allV, names(data))))) { stop(sprintf(ngettext(sum(naV), "%s not found in data", "%s not found in data"), allV[naV]), domain = NA) } } } else data <- NULL ## argument list dots <- list(...) args <- if (length(dots) > 0) dots else list() ## covariate - must be present as a data.frame covF <- getCovariateFormula(form) .x <- eval(covF[[2]], list(. = object)) # only function of "." if (!inherits(.x, "data.frame")) { stop("covariate must be a data frame") } if (!is.null(effNams <- attr(.x, "effectNames"))) { .x <- .x[, effNams, drop = FALSE] } ## eliminating constant effects isFixed <- vapply(.x, function(el) length(unique(el)) == 1, NA) .x <- .x[, !isFixed, drop = FALSE] nc <- ncol(.x) if (nc == 1) { stop("cannot do pairs of just one variable") } if (!missing(label)) { names(.x) <- labels } if (nc == 2) { ## will use xyplot argForm <- .y ~ .x argData <- .x names(argData) <- c(".x", ".y") if (is.null(args$xlab)) { args$xlab <- names(.x)[1] } if (is.null(args$ylab)) { args$ylab <- names(.x)[2] } } else { # splom argForm <- ~ .x argData <- list(.x = .x) } auxData <- list() ## groups - need not be present grpsF <- getGroupsFormula(form) if (!is.null(grpsF)) { gr <- splitFormula(grpsF, sep = "*") for(i in seq_along(gr)) { auxData[[deparse(gr[[i]][[2]])]] <- eval(gr[[i]][[2]], data) } argForm <- eval(substitute(if(length(argForm) == 2) ~ .x | R else .y ~ .x | R, list(R = grpsF[[2L]]))) } ## id and idLabels - need not be present if (!is.null(id)) { # identify points in plot N <- attr(object, "dims")$N id <- switch(mode(id), numeric = { if ((id <= 0) || (id >= 1)) { stop("'id' must be between 0 and 1") } aux <- as.matrix(na.omit(ranef(object))) auxV <- t(chol(var(aux))) as.logical(colSums((solve(auxV, t(aux)))^2) > qchisq(1 - id, dim(aux)[2])) }, call = eval(asOneSidedFormula(id)[[2]], data), stop("'id' can only be a formula or numeric") ) if (length(id) == N) { ## id as a formula evaluated in data auxData[[".id"]] <- id } if (is.null(idLabels)) { idLabels <- row.names(.x) } else { if (mode(idLabels) == "call") { idLabels <- as.character(eval(asOneSidedFormula(idLabels)[[2]], data)) } else if (is.vector(idLabels)) { if (length(idLabels <- unlist(idLabels)) != N) { stop("'idLabels' of incorrect length") } idLabels <- as.character(idLabels) } else { stop("'idLabels' can only be a formula or a vector") } } if (length(idLabels) == N) { ## idLabels as a formula evaluated in data auxData[[".Lid"]] <- idLabels } } if (length(auxData)) { # need collapsing auxData <- gsummary(data.frame(auxData), groups = getGroups(object)) auxData <- auxData[row.names(.x), , drop = FALSE] if (!is.null(auxData[[".g"]])) { argData[[".g"]] <- auxData[[".g"]] } if (!is.null(auxData[[".id"]])) { id <- auxData[[".id"]] } if (!is.null(auxData[[".Lid"]])) { idLabels <- auxData[[".Lid"]] } wchDat <- is.na(match(names(auxData), c(".id", ".idLabels"))) if (any(wchDat)) { argData <- cbind(argData, auxData[, wchDat, drop = FALSE]) } } if (is.null(id)) assign("id", FALSE) else assign("id", as.logical(as.character(id)) ) assign("idLabels", as.character(idLabels)) assign("grid", grid) ## adding to args list args <- c(list(argForm, data = argData), args) ## if (is.null(args$strip)) { ## args$strip <- function(...) strip.default(..., style = 1) ## } if (is.null(args$cex)) args$cex <- par("cex") if (is.null(args$adj)) args$adj <- par("adj") ## defining the type of plot if (length(argForm) == 3) { # xyplot plotFun <- "xyplot" args <- c(args, panel = list(function(x, y, subscripts, ...) { x <- as.numeric(x) y <- as.numeric(y) dots <- list(...) if (grid) panel.grid() panel.xyplot(x, y) if (any(id) & any(ids <- id[subscripts])) { ltext(x[ids], y[ids], idLabels[subscripts][ids], cex = dots$cex, adj = dots$adj) } })) } else { # splom plotFun <- "splom" args <- c(args, panel = list(function(x, y, subscripts, ...) { x <- as.numeric(x) y <- as.numeric(y) dots <- list(...) if (grid) panel.grid() panel.xyplot(x, y) if (any(id) & any(ids <- id[subscripts])) { ltext(x[ids], y[ids], idLabels[subscripts][ids], cex = dots$cex, adj = dots$adj) } })) } do.call(plotFun, args) } ## {pairs.lmList} plot.intervals.lmList <- function(x, xlab = "", ylab = attr(x, "groupsName"), strip = function(...) strip.default(..., style = 1), ...) { dims <- dim(x) dn <- dimnames(x) ## changed definition of what to ordered to preserve order of parameters tt <- data.frame(group = ordered(rep(dn[[1]], dims[2] * dims[3]), levels = dn[[1]]), intervals = as.vector(x), what = ordered(rep(dn[[3]], rep(dims[1] * dims[2], dims[3])), levels = dn[[3]])) dotplot(group ~ intervals | what, data = tt, scales = list(x="free"), strip = strip, xlab = xlab, ylab = ylab, panel = function(x, y, pch = dot.symbol$pch, col = dot.symbol$col, cex = dot.symbol$cex, font = dot.symbol$font, ...) { x <- as.numeric(x) y <- as.numeric(y) ok <- !is.na(x) & !is.na(y) yy <- y[ok] xx <- x[ok] dot.symbol <- trellis.par.get("dot.symbol") dot.line <- trellis.par.get("dot.line") panel.abline(h = yy, lwd = dot.line$lwd, lty = dot.line$lty, col = dot.line$col) lpoints(xx, yy, pch = "|", col = col, cex = cex, font = font, ...) lower <- tapply(xx, yy, min) upper <- tapply(xx, yy, max) nams <- as.numeric(names(lower)) lsegments(lower, nams, upper, nams, col = 1, lty = 1, lwd = if (dot.line$lwd) dot.line$lwd else 2) }, ...) } ## {plot.intervals.lmList} plot.ranef.lmList <- function(x, form = NULL, grid = TRUE, control, ...) { plot.ranef.lme(x, form=form, grid=grid, control=control, ...) } plot.lmList <- function(x, form = resid(., type = "pool") ~ fitted(.), abline, id = NULL, idLabels = NULL, grid, ...) ## Diagnostic plots based on residuals and/or fitted values { if(!inherits(form, "formula")) stop("'form' must be a formula") ## constructing data allV <- all.vars(asOneFormula(form, id, idLabels)) allV <- allV[is.na(match(allV,c("T","F","TRUE","FALSE")))] if (length(allV) > 0) { data <- getData(x) if (is.null(data)) { # try to construct data alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(as.list(quote(data.frame)), alist) mode(alist) <- "call" data <- eval(alist, sys.parent(1)) } else { if (any(naV <- is.na(match(allV, names(data))))) { stop(sprintf(ngettext(sum(naV), "%s not found in data", "%s not found in data"), allV[naV]), domain = NA) } } } else data <- NULL if (inherits(data, "groupedData")) { # save labels and units, if present ff <- formula(data) rF <- deparse(getResponseFormula(ff)[[2]]) cF <- c_deparse(getCovariateFormula(ff)[[2]]) lbs <- attr(data, "labels") unts <- attr(data, "units") if (!is.null(lbs$x)) cL <- paste(lbs$x, unts$x) else cF <- NULL if (!is.null(lbs$y)) rL <- paste(lbs$y, unts$y) else rF <- NULL } else { rF <- cF <- NULL } ## argument list dots <- list(...) args <- if(length(dots) > 0) dots else list() ## appending object to data data <- as.list(c(as.list(data), . = list(x))) ## covariate - must always be present covF <- getCovariateFormula(form) .x <- eval(covF[[2]], data) if (!is.numeric(.x)) { stop("covariate must be numeric") } argForm <- ~ .x argData <- as.data.frame(.x) if (is.null(xlab <- attr(.x, "label"))) { xlab <- c_deparse(covF[[2]]) if (!is.null(cF) && (xlab == cF)) xlab <- cL else if (!is.null(rF) && (xlab == rF)) xlab <- rL } if (is.null(args$xlab)) args$xlab <- xlab ## response - need not be present respF <- getResponseFormula(form) if (!is.null(respF)) { .y <- eval(respF[[2]], data) if (is.null(ylab <- attr(.y, "label"))) { ylab <- deparse(respF[[2]]) if (!is.null(cF) && (ylab == cF)) ylab <- cL else if (!is.null(rF) && (ylab == rF)) ylab <- rL } argForm <- .y ~ .x argData[, ".y"] <- .y if (is.null(args$ylab)) args$ylab <- ylab } ## groups - need not be present grpsF <- getGroupsFormula(form) if (!is.null(grpsF)) { gr <- splitFormula(grpsF, sep = "*") for(i in seq_along(gr)) { argData[[deparse(gr[[i]][[2]])]] <- eval(gr[[i]][[2]], data) } argForm <- eval(substitute(if(length(argForm) == 2) ~ .x | R else .y ~ .x | R, list(R = grpsF[[2L]]))) } ## adding to args list args <- c(list(argForm, data = argData), args) ## if (is.null(args$strip)) { ## args$strip <- function(...) strip.default(..., style = 1) ## } if (is.null(args$cex)) args$cex <- par("cex") if (is.null(args$adj)) args$adj <- par("adj") if (!is.null(id)) { # identify points in plot id <- switch(mode(id), numeric = { if ((id <= 0) || (id >= 1)) { stop("'id' must be between 0 and 1") } as.logical(abs(resid(x, type = "pooled")) > -qnorm(id / 2)) }, call = eval(asOneSidedFormula(id)[[2]], data), stop("'id' can only be a formula or numeric") ) if (is.null(idLabels)) { idLabels <- getGroups(x) if (length(idLabels) == 0) idLabels <- 1:x$dims$N idLabels <- as.character(idLabels) } else { if (mode(idLabels) == "call") { idLabels <- as.character(eval(asOneSidedFormula(idLabels)[[2]], data)) } else if (is.vector(idLabels)) { if (length(idLabels <- unlist(idLabels)) != length(id)) { stop("'idLabels' of incorrect length") } idLabels <- as.character(idLabels) } else { stop("'idLabels' can only be a formula or a vector") } } } ## defining abline, if needed if(missing(abline)) abline <- if(missing(form)) c(0, 0) # else NULL ## defining the type of plot if (length(argForm) == 3) { if (is.numeric(.y)) { # xyplot plotFun <- "xyplot" args$panel <- function(x, y, subscripts, ...) { x <- as.numeric(x) y <- as.numeric(y) dots <- list(...) if (grid) panel.grid() panel.xyplot(x, y) if (any(ids <- id[subscripts])) { ltext(x[ids], y[ids], idLabels[subscripts][ids], cex = dots$cex, adj = dots$adj) } if (!is.null(abline)) { if (length(abline) == 2) panel.abline(a = abline, ...) else panel.abline(h = abline, ...) } } } else { # assume factor or character plotFun <- "bwplot" args$panel <- function(x, y, ...) { if (grid) panel.grid() panel.bwplot(x, y) if (!is.null(abline)) { panel.abline(v = abline[1], ...) } } } } else { ## '~ x' plotFun <- "histogram" args$panel <- function(x, y, ...) { if (grid) panel.grid() panel.histogram(x, y) if (!is.null(abline)) { panel.abline(v = abline[1], ...) } } } ## defining grid (seen from panel()s defined here): if (missing(grid)) grid <- (plotFun == "xyplot") # T/F do.call(plotFun, args) } ## {plot.lmList} predict.lmList <- function(object, newdata, subset = NULL, pool = attr(object, "pool"), asList = FALSE, se.fit = FALSE, ...) { if(missing(newdata)) { if (!se.fit) return(fitted(object, subset, asList)) myData <- getData(object) grps <- getGroups(object) myData <- split(myData, grps) newdata <- NULL sameData <- FALSE } else { newdata <- as.data.frame(newdata) sameData <- TRUE ## checking if same newdata for all groups formGrps <- getGroupsFormula(object) if(all(match(all.vars(formGrps), names(newdata), 0))) { ## newdata contains groups definition grps <- getGroups(newdata, getGroupsFormula(object, asList = TRUE), level = attr(object, "level")) grps <- grps[drop = TRUE] subset <- as.character(unique(grps)) if(any(is.na(match(subset, names(object))))) { stop("nonexistent group in 'newdata'") } myData <- split(newdata, grps) newdata <- NULL sameData <- FALSE } } if(!is.null(subset)) { if(any(is.na(match(subset, names(object))))) stop("nonexistent group requested in 'subset'") oclass <- class(object) ## fix for PR#13788 oatt <- attributes(object)[c("call", "groupsForm", "pool")] object <- object[subset] attributes(object) <- c(attributes(object), oatt) class(object) <- oclass if(is.null(newdata)) myData <- myData[subset] } nmGrps <- names(object) noNull <- !vapply(object, is.null, NA) val <- vector("list", length(nmGrps)) names(val) <- nmGrps if(!sameData) { if(!se.fit) { for(i in nmGrps[noNull]) { val[[i]] <- predict(object[[i]], myData[[i]]) } } else { if(pool) { poolSD <- pooledSD(object) } for(i in nmGrps[noNull]) { aux <- predict(object[[i]], myData[[i]], se.fit = TRUE) if(pool) { val[[i]] <- data.frame(fit = aux$fit, se.fit = aux$se.fit*poolSD/aux$res) } else { val[[i]] <- data.frame(fit = aux$fit, se.fit = aux$se.fit) } } } } else { if(pool) { poolSD <- pooledSD(object) val[noNull] <- lapply(object[noNull], function(el, newdata, se.fit, poolSD) { aux <- predict(el, newdata, se.fit = se.fit) if(se.fit) { data.frame(fit = aux$fit, se.fit = aux$se.fit*poolSD/aux$res) } else { aux } }, newdata = newdata, se.fit = se.fit, poolSD = poolSD) } else { val[noNull] <- lapply(object[noNull], function(el, newdata, se.fit) { aux <- predict(el, newdata, se.fit = se.fit) if(se.fit) { data.frame(fit = aux$fit, se.fit = aux$se.fit) } else { aux } }, newdata = newdata, se.fit = se.fit) } } if(!asList) { #convert to array if(is.null(newdata)) { ngrps <- table(grps)[names(object)] } else { ngrps <- rep(dim(newdata)[1], length(object)) names(ngrps) <- names(object) } if(any(aux <- vapply(object, is.null, NA))) { for(i in names(ngrps[aux])) { aux1 <- rep(NA, ngrps[i]) if(se.fit) { val[[i]] <- data.frame(fit = aux1, se.fit = aux1) } else { val[[i]] <- aux1 } } } if(se.fit) { val <- do.call("rbind", val) val[, as.character(getGroupsFormula(object)[[2]])] <- rep(names(ngrps), ngrps) val <- val[, c(3,1,2)] row.names(val) <- 1:nrow(val) } else { val <- unlist(val) names(val) <- rep(names(ngrps), ngrps) attr(val, "label") <- "Predicted values" if (!is.null(aux <- attr(object, "units")$y)) { attr(val, "label") <- paste(attr(val, "label"), aux) } } } val } print.intervals.lmList <- function(x, ...) { ox <- x x <- unclass(x) attr(x, "groupsName") <- NULL print(x, ...) invisible(ox) } print.lmList <- function(x, pool = attr(x, "pool"), ...) { mCall <- attr(x, "call") cat("Call:\n") form <- formula(x) cat(" Model:", deparse(getResponseFormula(form)[[2]]), "~", c_deparse(getCovariateFormula(form)[[2]]), "|", deparse(getGroupsFormula(x)[[2]]), "\n") if (!is.null(mCall$level)) { cat(" Level:", mCall$level, "\n") } cat(" Data:", deparse(mCall$data),"\n\n") cat("Coefficients:\n") print(coef(x), ...) if(pool) { cat("\n") poolSD <- pooledSD(x) dfRes <- attr(poolSD, "df") RSE <- c(poolSD) cat("Degrees of freedom: ", length(unlist(lapply(x, fitted))), " total; ", dfRes, " residual\n", sep = "") cat("Residual standard error:", format(RSE)) cat("\n") } invisible(x) } print.summary.lmList <- function(x, ...) { cat("Call:\n") form <- formula(x) cat(" Model:", deparse(getResponseFormula(form)[[2]]), "~", c_deparse(getCovariateFormula(form)[[2]]), "|", deparse(attr(x, "groupsForm")[[2]]), "\n") if (!is.null(x$call$level)) { cat(" Level:", x$call$level, "\n") } cat(" Data:", deparse(x$call$data),"\n\n") cat("Coefficients:\n") for(i in dimnames(coef(x))[[3]]) { cat(" ",i,"\n") print(coef(x)[,,i], ...) } if(x$pool) { cat("\n") cat("Residual standard error:", format(x$RSE), "on", x$df.residual, "degrees of freedom\n") } cat("\n") invisible(x) } qqnorm.lmList <- function(y, form = ~ resid(., type = "pooled"), abline = NULL, id = NULL, idLabels = NULL, grid = FALSE, resType = "pool", ...) ## normal probability plots for residuals and random effects { object <- y if (!inherits(form, "formula")) { stop("'form' must be a formula") } ## constructing data allV <- all.vars(asOneFormula(form, id, idLabels)) allV <- allV[is.na(match(allV,c("T","F","TRUE","FALSE")))] if (length(allV) > 0) { data <- getData(object) if (is.null(data)) { # try to construct data alist <- lapply(as.list(allV), as.name) names(alist) <- allV alist <- c(as.list(quote(data.frame)), alist) mode(alist) <- "call" data <- eval(alist, sys.parent(1)) } else if (any(naV <- is.na(match(allV, names(data))))) { stop(sprintf(ngettext(sum(naV), "%s not found in data", "%s not found in data"), allV[naV]), domain = NA) } } else data <- NULL ## argument list dots <- list(...) args <- if (length(dots) > 0) dots else list() ## appending object to data data <- as.list(c(as.list(data), . = list(object))) ## covariate - must always be present covF <- getCovariateFormula(form) .x <- eval(covF[[2]], data) labs <- attr(.x, "label") type <- if (inherits(.x, "ranef.lmList")) "reff" # random effects else if (!is.null(labs) && ((labs == "Standardized residuals") || (substr(labs, 1, 9) == "Residuals"))) "res" # residuals else stop("only residuals and random effects allowed") if (is.null(args$xlab)) args$xlab <- labs if (is.null(args$ylab)) args$ylab <- "Quantiles of standard normal" if(type == "res") { # case 1: -------- residuals ------------------------ fData <- qqnorm(.x, plot.it = FALSE) data[[".y"]] <- fData$x data[[".x"]] <- fData$y dform <- ".y ~ .x" if (!is.null(grp <- getGroupsFormula(form))) { dform <- paste(dform, deparse(grp[[2]]), sep = "|") } if (!is.null(id)) { # identify points in plot id <- switch(mode(id), numeric = { if ((id <= 0) || (id >= 1)) { stop("'id' must be between 0 and 1") } as.logical(abs(resid(object, type=resType)) > -qnorm(id / 2)) }, call = eval(asOneSidedFormula(id)[[2]], data), stop("'id' can only be a formula or numeric") ) if (is.null(idLabels)) { idLabels <- getGroups(object) if (length(idLabels) == 0) idLabels <- seq_len(object$dims$N) idLabels <- as.character(idLabels) } else { if (mode(idLabels) == "call") { idLabels <- as.character(eval(asOneSidedFormula(idLabels)[[2]], data)) } else if (is.vector(idLabels)) { if (length(idLabels <- unlist(idLabels)) != length(id)) { stop("'idLabels' of incorrect length") } idLabels <- as.character(idLabels) } else { stop("'idLabels' can only be a formula or a vector") } } } } else { # case 2: ------- random.effects ------------------------------- level <- attr(.x, "level") std <- attr(.x, "standardized") if (!is.null(effNams <- attr(.x, "effectNames"))) { .x <- .x[, effNams, drop = FALSE] } nc <- ncol(.x) nr <- nrow(.x) fData <- lapply(as.data.frame(.x), qqnorm, plot.it = FALSE) fData <- data.frame(.x = unlist(lapply(fData, function(x) x[["y"]])), .y = unlist(lapply(fData, function(x) x[["x"]])), .g = ordered(rep(names(fData),rep(nr, nc)), levels = names(fData))) dform <- ".y ~ .x | .g" auxData <- if (!is.null(grp <- getGroupsFormula(form))) { dform <- paste(dform, deparse(grp[[2]]), sep = "*") data[is.na(match(names(data), "."))] } else list() ## id and idLabels - need not be present if (!is.null(id)) { # identify points in plot N <- object$dims$N id <- switch(mode(id), numeric = { if ((id <= 0) || (id >= 1)) { stop("'id' must be between 0 and 1") } aux <- ranef(object, standard = TRUE) as.logical(abs(c(unlist(aux))) > -qnorm(id / 2)) }, call = eval(asOneSidedFormula(id)[[2]], data), stop("'id' can only be a formula or numeric") ) if (length(id) == N) { ## id as a formula evaluated in data auxData[[".id"]] <- id } if (is.null(idLabels)) { idLabels <- rep(row.names(.x), nc) } else { if (mode(idLabels) == "call") { idLabels <- as.character(eval(asOneSidedFormula(idLabels)[[2]], data)) } else if (is.vector(idLabels)) { if (length(idLabels <- unlist(idLabels)) != N) { stop("'idLabels' of incorrect length") } idLabels <- as.character(idLabels) } else { stop("'idLabels' can only be a formula or a vector") } } if (length(idLabels) == N) { ## idLabels as a formula evaluated in data auxData[[".Lid"]] <- idLabels } } data <- if (length(auxData)) { # need collapsing auxData <- gsummary(data.frame(auxData), groups = getGroups(object, level = level)) auxData <- auxData[row.names(.x), , drop = FALSE] if (!is.null(auxData[[".id"]])) { id <- rep(auxData[[".id"]], nc) } if (!is.null(auxData[[".Lid"]])) { idLabels <- rep(auxData[[".Lid"]], nc) } cbind(fData, do.call("rbind", rep(list(auxData), nc))) } else { fData } } if(is.null(id)) id <- as.logical(as.character(id)) idLabels <- as.character(idLabels) if (is.null(args$strip)) { args$strip <- function(...) strip.default(..., style = 1) } if (is.null(args$cex)) args$cex <- par("cex") if (is.null(args$adj)) args$adj <- par("adj") args <- c(list(eval(parse(text = dform)), data = substitute(data), panel = function(x, y, subscripts, ...){ x <- as.numeric(x) y <- as.numeric(y) dots <- list(...) if (grid) panel.grid() panel.xyplot(x, y, ...) if (any(ids <- id[subscripts])) { ltext(x[ids], y[ids], idLabels[subscripts][ids], cex = dots$cex, adj = dots$adj) } if (!is.null(abline)) panel.abline(abline, ...) }), args) if(type == "reff" && !std) { args[["scales"]] <- list(x = list(relation = "free")) } do.call(xyplot, args) } ## {qqnorm.lmList} ranef.lmList <- ## Extracts the random effects from an lmList object. ## If aug.frame is true, the returned data frame is augmented with a ## values from the original data object, if available. The variables ## in the original data are collapsed over the cluster variable by the ## function fun. function(object, augFrame = FALSE, data = NULL, which = NULL, FUN = mean, standard = FALSE, omitGroupingFactor = TRUE, ...) { val <- coef(object, augFrame, data, which, FUN, omitGroupingFactor) effNames <- attr(val, "effectNames") effs <- val[, effNames, drop = FALSE] effs <- as.data.frame(lapply(effs, function(el) el - mean(el, na.rm = TRUE))) if(standard) { stdEff <- unlist(lapply(effs, function(el) sqrt(var(el[!is.na(el)])))) effs <- as.data.frame(as.matrix(effs) %*% diag(1/stdEff)) attr(val, "label") <- "Standardized random effects" } else { attr(val, "label") <- "Random effects" } val[, effNames] <- effs attr(val, "standardized") <- standard class(val) <- unique(c("ranef.lmList", class(val)[-1])) val } residuals.lmList <- function(object, type = c("response", "pearson", "pooled.pearson"), subset = NULL, asList = FALSE, ...) { type <- match.arg(type) if(type == "pooled.pearson") { poolSD <- pooledSD(object) } if(!is.null(subset)) { if(is.character(subset)) { if (any(is.na(match(subset, names(object))))) stop("nonexistent groups requested in 'subset'") } else if (is.integer(subset)) { if (any(is.na(match(subset, seq_along(object))))) stop("nonexistent groups requested in 'subset'") } else stop("'subset' can only be character or integer") oclass <- class(object) oatt <- attr(object, "call") object <- object[subset] attr(object, "call") <- oatt class(object) <- oclass } val <- switch(type, pooled.pearson = { lapply(object, function(el, pSD) if(!is.null(el)) resid(el)/pSD # else NULL , pSD = poolSD) }, pearson = lapply(object, function(el) { if(!is.null(el)) { aux <- resid(el) aux/sqrt(sum(aux^2)/(length(aux) - length(coef(el)))) } # else NULL }), response = lapply(object, function(el) if(!is.null(el)) resid(el)) # else NULL ) if(!asList) { #convert to array ngrps <- table(getGroups(object))[names(object)] if(any(aux <- vapply(object, is.null, NA))) { for(i in names(ngrps[aux])) { val[[i]] <- rep(NA, ngrps[i]) } } val <- val[attr(object, "origOrder")] # putting in original order val <- setNames(unlist(val), rep(names(val), ngrps)) } lab <- if (type == "response") { lab <- "Residuals" if(!is.null(aux <- attr(object, "units")$y)) paste(lab, aux) else lab } else "Standardized residuals" attr(val, "label") <- lab val } summary.lmList <- function(object, pool = attr(object, "pool"), ...) { to.3d.array <- ## Convert the list to a 3d array watching for null elements function(lst, template) { if (!is.matrix(template)) return(lst) ## Make empty array val[,,] and then fill it ----- dnames <- dimnames(template) use.i <- which(lengths(lst) > 0) ## TODO? just identical(dnames[[1]], dnames[[2]]) : if (length(dnames[[1]]) == length(dnames[[2]]) && all(dnames[[1]] == dnames[[2]])) { ## symmetric val <- array(NA, dim=c(length(cfNms), length(cfNms), length(lst)), dimnames=list(cfNms, cfNms, names(lst))) for (ii in use.i) { use <- dimnames(lst[[ii]])[[1]] val[use, use, ii] <- lst[[ii]] ## ---- } } else { val <- array(NA, dim=c(length(cfNms), dim(template)[2], length(lst)), dimnames=list(cfNms, dnames[[2]], names(lst))) for (ii in use.i) { use <- dimnames(lst[[ii]])[[1]] val[use, , ii] <- lst[[ii]] ## --- } } aperm(val, 3:1) ## val <- aperm(array(unlist(lapply(lst, function(el, template) ## if(is.null(el)) { template } ## else { el }, template = template)), ## c(dim(template), length(lst)), ## c(dnames, list(names(lst)))), ## c(3, 2, 1)) ## val[unlist(lapply(lst, is.null)), , ] <- NA } to.2d.array <- ## Convert the list to a 2d array watching for null elements function(lst, template) { if(is.null(template)) return(lst) template <- as.vector(template) val <- t(array(unlist(lapply(lst, function(el) if(is.null(el)) template else el)), c(length(template), length(lst)), list(names(template), names(lst)))) val[vapply(lst, is.null, NA), ] <- NA val } ## Create a summary by applying summary to each component of the list sum.lst <- lapply(object, function(el) if(!is.null(el)) summary(el)) nonNull <- !vapply(sum.lst, is.null, NA) if(!any(nonNull)) return(NULL) template <- sum.lst[[match(TRUE, nonNull)]] # the first one val <- as.list(setNames(nm = names(template))) for (i in names(template)) { val[[i]] <- lapply(sum.lst, `[[`, i) class(val[[i]]) <- "listof" } ## complete set of coefs [only used in to.3d.array()] cfNms <- unique(as.vector(sapply(sum.lst[nonNull], function(x) dimnames(x[['coefficients']])[[1]]))) ## re-arrange the matrices into 3d arrays for(i in c("parameters", "cov.unscaled", "correlation", "coefficients")) if(length(val[[i]])) val[[i]] <- to.3d.array(val[[i]], template[[i]]) ## re-arrange the vectors into 2d arrays for(i in c("df", "fstatistic")) val[[i]] <- to.2d.array(val[[i]], template[[i]]) ## re-arrange the scalars into vectors for(i in c("sigma", "r.squared")) { ## val[[i]] <- unlist(val[[i]]) - this deletes NULL components val[[i]] <- c(to.2d.array(val[[i]], template[[i]])) } ## select those attributes that do not vary with groups for(i in c("terms", "formula")) val[[i]] <- template[[i]] val[["call"]] <- attr(object, "call") if(inherits(object, "nlsList")) names(val[["call"]]["model"]) <- "object" val[["pool"]] <- pool if(pool) { poolSD <- pooledSD(object) dfRes <- attr(poolSD, "df") RSE <- c(poolSD) corRSE <- RSE/val$sigma pname <- if(inherits(object, "nlsList")) "parameters" else "coefficients" val[[pname]][,2,] <- val[[pname]][,2,] * corRSE val[[pname]][,3,] <- val[[pname]][,3,] / corRSE if(!inherits(object, "nlsList")) val[[pname]][,4,] <- 2*pt(abs(val[[pname]][,3,]), dfRes, lower.tail=FALSE) val[["df.residual"]] <- dfRes val[["RSE"]] <- RSE } attr(val, "groupsForm") <- attr(object, "groupsForm") class(val) <- "summary.lmList" val } # based on R's update.default update.lmList <- function (object, formula., ..., evaluate = TRUE) { call <- attr(object, "call") if (is.null(call)) stop("need an object with call component") extras <- match.call(expand.dots = FALSE)$... if (!missing(formula.)) call$object <- update.formula(formula(object), formula.) if(length(extras) > 0) { existing <- !is.na(match(names(extras), names(call))) ## do these individually to allow NULL to remove entries. for (a in names(extras)[existing]) call[[a]] <- extras[[a]] if(any(!existing)) { call <- c(as.list(call), extras[!existing]) call <- as.call(call) } } if(evaluate) eval(call, parent.frame()) else call } #update.lmList <- # function(object, formula, data, level, subset, na.action, pool, ...) #{ # thisCall <- as.list(match.call())[-(1:2)] # if (!missing(formula)) { # names(thisCall)[match(names(thisCall), "formula")] <- "object" # } # nextCall <- attr(object, "call") # nextCall[names(thisCall)] <- thisCall # if (!is.null(thisCall$object)) { # nextCall$object <- update(as.formula(nextCall$object), nextCall$object) # } # nextCall[[1]] <- quote(lmList) # eval(nextCall, envir = parent.frame(1)) #} nlme/R/newFunc.R0000644000176200001440000002777112710164373013160 0ustar liggesusers### Functions that are used in several parts of the nlme library ### but do not belong to any specific part ### ### Copyright 2006-2016 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of the GNU General Public License as published by ### the Free Software Foundation; either version 2 of the License, or ### (at your option) any later version. ### ### This program is distributed in the hope that it will be useful, ### but WITHOUT ANY WARRANTY; without even the implied warranty of ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ### GNU General Public License for more details. ### ### A copy of the GNU General Public License is available at ### http://www.r-project.org/Licenses/ svd.d <- function(x) La.svd(x, nu=0L, nv=0L)$d allCoef <- ## Combines different coefficient vectors into one vector, keeping track ## of which coefficients came from which object function(..., extract = coef) { dots <- list(...) theta <- lapply(dots, extract) len <- lengths(theta) num <- seq_along(len) which <- if (sum(len) > 0) outer(rep(num, len), num, "==") else array(FALSE, c(1, length(len))) cnames <- unlist(as.list(sys.call()[-1])) dimnames(which) <- list(NULL, cnames[cnames != substitute(extract)]) theta <- unlist(theta) attr(theta, "map") <- which theta } allVarsRec <- ## Recursive version of all.vars function(object) { if (is.list(object)) { unlist(lapply(object, allVarsRec)) } else { all.vars(object) } } asOneFormula <- ## Constructs a linear formula with all the variables used in a ## list of formulas, except for the names in omit function(..., omit = c(".", "pi")) { names <- unique(allVarsRec(list(...))) names <- names[is.na(match(names, omit))] if (length(names)) eval(parse(text = paste("~", paste(names, collapse = "+")))[[1]]) else ~1 } compareFits <- ## compares coeffificients from different fitted objects function(object1, object2, which = 1:ncol(object1)) { dn1 <- dimnames(object1) dn2 <- dimnames(object2) aux <- rep(NA, length(dn1[[1]])) if (any(aux1 <- is.na(match(dn2[[2]], dn1[[2]])))) { object1[,dn2[[2]][aux1]] <- aux } if (any(aux1 <- is.na(match(dn1[[2]], dn2[[2]])))) { object2[,dn1[[2]][aux1]] <- aux } dn1 <- dimnames(object1) c1 <- deparse(substitute(object1)) c2 <- deparse(substitute(object2)) if (any(sort(dn1[[1]]) != sort(dn2[[1]]))) { stop("objects must have coefficients with same row names") } ## putting object2 in same order object2 <- object2[dn1[[1]], dn1[[2]], drop = FALSE] object1 <- object1[, which, drop = FALSE] object2 <- object2[, which, drop = FALSE] dn1 <- dimnames(object1) dm1 <- dim(object1) out <- array(0, c(dm1[1], 2, dm1[2]), list(dn1[[1]], c(c1,c2), dn1[[2]])) for(i in dn1[[2]]) { out[,,i] <- cbind(object1[[i]], object2[[i]]) } class(out) <- "compareFits" out } fdHess <- function(pars, fun, ..., .relStep = .Machine$double.eps^(1/3), minAbsPar = 0) ## Use a Koschal design to establish a second order model for the response { pars <- as.numeric(pars) npar <- length(pars) incr <- pmax(abs(pars), minAbsPar) * .relStep baseInd <- diag(npar) frac <- c(1, incr, incr^2) cols <- list(0, baseInd, -baseInd) for ( i in seq_along(pars)[ -npar ] ) { cols <- c( cols, list( baseInd[ , i ] + baseInd[ , -(1:i) ] ) ) frac <- c( frac, incr[ i ] * incr[ -(1:i) ] ) } indMat <- do.call( "cbind", cols) shifted <- pars + incr * indMat indMat <- t(indMat) Xcols <- list(1, indMat, indMat^2) for ( i in seq_along(pars)[ - npar ] ) { Xcols <- c( Xcols, list( indMat[ , i ] * indMat[ , -(1:i) ] ) ) } coefs <- solve(do.call("cbind", Xcols), apply(shifted, 2, fun, ...)) / frac Hess <- diag( coefs[ 1 + npar + seq_along(pars) ], ncol = npar ) Hess[ row(Hess) > col (Hess) ] <- coefs[ -(1:(1 + 2 * npar)) ] list(mean = coefs[ 1 ], gradient = coefs[ 1 + seq_along(pars) ], Hessian = (Hess + t(Hess)) ) } gapply <- ## Apply a function to the subframes of a data.frame ## If "apply" were generic, this would be the method for groupedData function(object, which, FUN, form = formula(object), level, groups = getGroups(object, form, level), ...) { if (!inherits(object, "data.frame")) { stop("object must inherit from \"data.frame\"") } ## Apply a function to the subframes of a groupedData object if (missing(groups)) { # formula and level are required if (!inherits(form, "formula")) { stop("'form' must be a formula") } if (is.null(grpForm <- getGroupsFormula(form, asList = TRUE))) { ## will use right hand side of form as groups formula grpForm <- splitFormula(asOneSidedFormula(form[[length(form)]])) } if (missing(level)) level <- length(grpForm) else if (length(level) != 1) { stop("only one level allowed in 'gapply'") } groups <- groups # forcing evaluation } if (!missing(which)) { switch(mode(which), character = { wchNot <- is.na(match(which, names(object))) if (any(wchNot)) { stop(sprintf(ngettext(sum(wchNot), "%s not matched", "%s not matched"), paste(which[wchNot], collapse = ",")), domain = NA) } }, numeric = { if (any(is.na(match(which, 1:ncol(object))))) { stop(gettextf("'which' must be between 1 and %d", ncol(object)), domain = NA) } }, stop("'which' can only be character or integer") ) object <- object[, which, drop = FALSE] } val <- lapply(X = split(object, groups), FUN = FUN, ...) if (is.atomic(val[[1]]) && length(val[[1]]) == 1) { val <- unlist(val) } val } getCovariateFormula <- function(object) { ## Return the primary covariate formula as a one sided formula form <- formula(object) if (!(inherits(form, "formula"))) { stop("formula(object) must return a formula") } form <- form[[length(form)]] if (length(form) == 3 && form[[1]] == as.name("|")){ # conditional expression form <- form[[2]] } eval(substitute(~form)) } getResponseFormula <- function(object) { ## Return the response formula as a one sided formula form <- formula(object) if (!(inherits(form, "formula") && (length(form) == 3))) { stop("'form' must be a two-sided formula") } eval(parse(text = paste("~", deparse(form[[2]])))) } gsummary <- ## Summarize an object according to the levels of a grouping factor ## function(object, FUN = function(x) mean(x, na.rm = TRUE), omitGroupingFactor = FALSE, form = formula(object), level, groups = getGroups(object, form , level), invariantsOnly = FALSE, ...) { if (!inherits(object, "data.frame")) { stop("object must inherit from \"data.frame\"") } if (missing(groups)) { # formula and level are required if (!inherits(form, "formula")) { stop("'form' must be a formula") } if (is.null(grpForm <- getGroupsFormula(form, asList = TRUE))) { ## will use right hand side of form as groups formula grpForm <- splitFormula(asOneSidedFormula(form[[length(form)]])) } if (missing(level)) level <- length(grpForm) else if (length(level) != 1) { stop("only one level allowed in 'gsummary'") } } gunique <- unique(groups) firstInGroup <- match(gunique, groups) asFirst <- firstInGroup[match(groups, gunique)] value <- as.data.frame(object[firstInGroup, , drop = FALSE]) row.names(value) <- as.character(gunique) value <- value[as.character(sort(gunique)), , drop = FALSE] varying <- unlist(lapply(object, function(column, frst) { aux <- as.character(column) any(!identical(aux, aux[frst])) }, frst = asFirst)) if (any(varying) && (!invariantsOnly)) { # varying wanted Mode <- function(x) { aux <- table(x) names(aux)[match(max(aux), aux)] } if (is.function(FUN)) { # single function given FUN <- list(numeric = FUN, ordered = Mode, factor = Mode) } else { if (!(is.list(FUN) && all(sapply(FUN, is.function)))) stop("'FUN' can only be a function or a list of functions") auxFUN <- list(numeric = mean, ordered = Mode, factor = Mode) aux <- names(auxFUN)[is.na(match(names(auxFUN), names(FUN)))] if (length(aux) > 0) FUN[aux] <- auxFUN[aux] } for(nm in names(object)[varying]) { ## dClass <- data.class(object[[nm]]) ## The problem here is that dclass may find an irrelevant class, ## e.g. Hmisc's "labelled" dClass <- if(is.ordered(object[[nm]])) "ordered" else if(is.factor(object[[nm]])) "factor" else mode(object[[nm]]) if (dClass == "numeric") { value[[nm]] <- as.vector(tapply(object[[nm]], groups, FUN[["numeric"]],...)) } else { value[[nm]] <- as.vector(tapply(as.character(object[[nm]]), groups, FUN[[dClass]])) if (inherits(object[,nm], "ordered")) { value[[nm]] <- ordered(value[,nm], levels = levels(object[,nm]))[drop = TRUE] } else { value[[nm]] <- factor(value[,nm], levels = levels(object[,nm]))[drop = TRUE] } } } } else { # invariants only value <- value[, !varying, drop = FALSE] } if (omitGroupingFactor) { if (is.null(form)) { stop("cannot omit grouping factor without 'form'") } grpForm <- getGroupsFormula(form, asList = TRUE) if (missing(level)) level <- length(grpForm) grpNames <- names(grpForm)[level] whichKeep <- is.na(match(names(value), grpNames)) if (any(whichKeep)) { value <- value[ , whichKeep, drop = FALSE] } else { return(NULL); } } value } pooledSD <- function(object) { if (!inherits(object, "lmList")) { stop("object must inherit from class \"lmList\"") } aux <- apply(sapply(object, function(el) { if (is.null(el)) { c(0,0) } else { aux <- resid(el) c(sum(aux^2), length(aux) - length(coef(el))) } }), 1, sum) if (aux[2] == 0) { stop("no degrees of freedom for estimating std. dev.") } val <- sqrt(aux[1]/aux[2]) attr(val, "df") <- aux[2] val } splitFormula <- ## split, on the nm call, the rhs of a formula into a list of subformulas function(form, sep = "/") { if (inherits(form, "formula") || mode(form) == "call" && form[[1]] == as.name("~")) return(splitFormula(form[[length(form)]], sep = sep)) if (mode(form) == "call" && form[[1]] == as.name(sep)) return(do.call("c", lapply(as.list(form[-1]), splitFormula, sep = sep))) if (mode(form) == "(") return(splitFormula(form[[2]], sep = sep)) if (length(form) < 1) return(NULL) list(asOneSidedFormula(form)) } ##*## phenoModel - one-compartment open model with intravenous ##*## administration and first-order elimination for the Phenobarbital data phenoModel <- function(Subject, time, dose, lCl, lV) { .C(nlme_one_comp_first, as.integer(length(time)), resp = as.double(dose), as.double(cbind(Subject, time, dose, exp(lV), exp(lCl))), NAOK = TRUE)$resp } ##*## quinModel - one-compartment open model with first order ##*## absorption for the Quinidine data quinModel <- function(Subject, time, conc, dose, interval, lV, lKa, lCl) { .C(nlme_one_comp_open, as.integer(length(time)), resp = as.double(dose), as.double(cbind(Subject, time, conc, dose, interval, exp(lV), exp(lKa), exp(lCl - lV))), NAOK = TRUE)$resp } LDEsysMat <- function(pars, incidence) { tt <- incidence[, "To"] ff <- incidence[, "From"] pp <- pars[incidence[, "Par"]] n <- max(ff, tt) val <- array(double(n * n), c(n, n)) diag(val) <- - tapply(pp, ff, sum) val[incidence[tt > 0, c("To", "From"), drop = FALSE]] <- pp[tt > 0] val } nlme/R/corStruct.R0000644000176200001440000020060313037375413013530 0ustar liggesusers### Classes of correlation structures ### ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates ### Copyright 2005-2016 The R Core team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # ### FIXME: For larger problems, the approach of corFactor() / corMatrix() of ### ------ of size sumLenSq := sum(len^2), len := table(groups) sucks ! ### Conceptually, one could consider using something like Matrix::sparseVector(.) ### but would have to deal with corresponding C code as well ! ##*## Generics that should be implemented for any corStruct class corFactor <- ## extractor for transpose inverse square root factor of corr matrix function(object, ...) UseMethod("corFactor") corMatrix <- ## extractor for correlation matrix or the transpose inverse ## square root matrix function(object, ...) UseMethod("corMatrix") ###*# Constructor ### There is no constructor function for this class (i.e. no function ### called corStruct) because the class is virtual. ## --- We now check 'sumLenSq' when it is first computed! ## .chkLenSq <- function(nn) { ## if(nn > .Machine$integer.max) ## stop(gettextf("'sumLenSq' = %g is too large (larger than maximal integer)", ## nn), domain = NA) ## else ## nn ## } ###*# Methods for local generics corFactor.corStruct <- function(object, ...) { if (!is.null(aux <- attr(object, "factor"))) { return(aux) } corD <- Dim(object) ## .chkLenSq(corD[["sumLenSq"]]) val <- .C(corStruct_factList, as.double(unlist(corMatrix(object))), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] attr(val, "logDet") <- lD val } corMatrix.corStruct <- function(object, covariate = getCovariate(object), corr = TRUE, ...) { if (corr) { ## Do not know how to calculate the correlation matrix stop(gettextf("do not know how to calculate correlation matrix of %s object", dQuote(class(object)[1])), domain = NA) } else { ## transpose inverse square root corD <- Dim(object, if (data.class(covariate) == "list") { if (is.null(names(covariate))) names(covariate) <- seq_along(covariate) rep(names(covariate), lengths(covariate)) } else rep(1, length(covariate))) val <- .C(corStruct_factList, as.double(unlist(corMatrix(object, covariate))), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] if (corD[["M"]] > 1) { val <- split(val, rep(1:corD[["M"]], (corD[["len"]])^2)) val <- lapply(val, function(el) { nel <- round(sqrt(length(el))) array(el, c(nel, nel)) }) names(val) <- names(corD[["len"]]) val <- as.list(val) } else { val <- array(val, c(corD[["N"]], corD[["N"]])) } attr(val, "logDet") <- lD val } } ###*# Methods for standard generics as.matrix.corStruct <- function(x, ...) corMatrix(x) coef.corStruct <- ## Accessor for constrained or unconstrained parameters of ## corStruct objects function(object, unconstrained = TRUE, ...) { if (unconstrained) { if (is.null(isFix <- attr(object, "fixed"))) { stop("\"corStruct\" object must have a \"fixed\" attribute") } if (isFix) { numeric(0) } else { as.vector(object) } } else { stop(gettextf("do not know how to obtain parameters of %s object", dQuote(class(object)[1])), domain = NA) } } `coef<-.corStruct` <- function(object, ..., value) { ## Assignment of the unconstrained parameter of corStruct objects value <- as.numeric(value) if (length(value) != length(object)) { stop("cannot change the length of the parameter of a \"corStruct\" object") } object[] <- value ## updating the factor list and logDet, by forcing a recalculation attr(object, "factor") <- NULL attr(object, "factor") <- corFactor(object) attr(object, "logDet") <- NULL attr(object, "logDet") <- logDet(object) object } Dim.corStruct <- function(object, groups, ...) { if (missing(groups)) return(attr(object, "Dim")) ugrp <- unique(groups) groups <- factor(groups, levels = ugrp) len <- table(groups) suml2 <- sum(len^2) if(suml2 > .Machine$integer.max) stop(gettextf( "'sumLenSq := sum(table(groups)^2)' = %g is too large. Too large or no groups in your correlation structure?", suml2), call. = FALSE, domain = NA) list(N = length(groups), M = length(len), maxLen = max(len), sumLenSq = suml2, len = len, start = match(ugrp, groups) - 1L) } formula.corStruct <- ## Accessor for the covariate formula function(x, ...) eval(attr(x, "formula")) getCovariate.corStruct <- function(object, form = formula(object), data) { if (!missing(form)) { form <- formula(object) warning("cannot change 'form'") } if (is.null(covar <- attr(object, "covariate"))) { # need to calculate it if (missing(data)) { stop("need data to calculate covariate of \"corStruct\" object") } covForm <- getCovariateFormula(form) grps <- if(!is.null(getGroupsFormula(form))) getGroups(object, data = data) ## else NULL if (length(all.vars(covForm)) > 0) { # primary covariate present if (is.null(grps)) { covar <- getCovariate(data, covForm) } else { if (all(all.vars(covForm) == sapply(splitFormula(covForm, "+"), function(el) deparse(el[[2]])))) { covar <- split(getCovariate(data, covForm), grps) } else { covar <- lapply(split(data, grps), getCovariate, covForm) } } } else { if (is.null(grps)) { covar <- 1:nrow(data) } else { covar <- lapply(split(grps, grps), function(x) seq_along(x)) } } if (!is.null(grps)) { covar <- as.list(covar) } } covar } getGroups.corStruct <- function(object, form = formula(object), level, data, sep) { if (is.null(val <- attr(object, "groups"))) { # need to calculate if (!missing(data)) { if ((grpLev <- length(getGroupsFormula(form, asList = TRUE))) > 0) { ## use innermost grouping level val <- getGroups(data, form, level = grpLev) factor(val, levels = unique(as.character(val))) } else { rep(1, dim(data)[1]) } } else { NULL } } else { val } } Initialize.corStruct <- ## Initializes some attributes of corStruct objects function(object, data, ...) { form <- formula(object) ## obtaining the groups information, if any if (!is.null(getGroupsFormula(form))) { attr(object, "groups") <- getGroups(object, form, data = data) attr(object, "Dim") <- Dim(object, attr(object, "groups")) } else { # no groups attr(object, "Dim") <- Dim(object, as.factor(rep(1, nrow(data)))) } ## obtaining the covariate(s) attr(object, "covariate") <- getCovariate(object, data = data) object } logDet.corStruct <- function(object, covariate = getCovariate(object), ...) { if (!is.null(aux <- attr(object, "logDet"))) { return(aux) } if (is.null(aux <- attr(object, "factor"))) { ## getting the transpose sqrt factor aux <- corMatrix(object, covariate = covariate, corr = FALSE) } if (is.null(aux1 <- attr(aux, "logDet"))) { ## checking for logDet attribute; if not present, get corr matrix aux <- corMatrix(object, covariate) if (data.class(aux) == "list") { # by group sum(log(abs(unlist(lapply(aux, svd.d)))))/2 } else { sum(log(abs(svd.d(aux))))/2 } } else { -aux1 } } ## NB, no "nobs" logLik.corStruct <- function(object, data, ...) -logDet(object) needUpdate.corStruct <- function(object) FALSE print.corStruct <- function(x, ...) { if (length(aux <- coef(x, unconstrained = FALSE)) > 0) { cat("Correlation structure of class", class(x)[1], "representing\n") print(aux, ...) } else { cat("Uninitialized correlation structure of class", class(x)[1], "\n") } invisible(x) } print.summary.corStruct <- function(x, ...) { class(x) <- attr(x, "oClass") cat(paste0("Correlation Structure: ", attr(x, "structName"), "\n")) cat(paste(" Formula:", deparse(formula(x)),"\n")) cat(" Parameter estimate(s):\n") print(coef(x, unconstrained = FALSE), ...) invisible(x) } recalc.corStruct <- function(object, conLin, ...) { conLin[["Xy"]][] <- .C(corStruct_recalc, Xy = as.double(conLin[["Xy"]]), as.integer(unlist(Dim(object))), as.integer(ncol(conLin[["Xy"]])), as.double(unlist(corFactor(object))))[["Xy"]] conLin[["logLik"]] <- conLin[["logLik"]] + logLik(object) conLin } summary.corStruct <- function(object, structName = class(object)[1], ...) { attr(object, "structName") <- structName attr(object, "oClass") <- class(object) class(object) <- "summary.corStruct" object } update.corStruct <- function(object, data, ...) { object } ##*## Classes that substitute for (i.e. inherit from) corStruct ###*# corSymm - general, unstructured correlation ####* Constructor corSymm <- ## Constructor for the corSymm class function(value = numeric(0), form = ~ 1, fixed = FALSE) { attr(value, "formula") <- form attr(value, "fixed") <- fixed class(value) <- c("corSymm", "corStruct") value } ###*# Methods for local generics corFactor.corSymm <- function(object, ...) { corD <- Dim(object) val <- .C(symm_factList, as.double(as.vector(object)), as.integer(unlist(attr(object, "covariate"))), as.integer(attr(object, "maxCov")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] attr(val, "logDet") <- lD val } corMatrix.corSymm <- function(object, covariate = getCovariate(object), corr = TRUE, ...) { corD <- Dim(object, if (data.class(covariate) == "list") { if (is.null(names(covariate))) names(covariate) <- seq_along(covariate) rep(names(covariate), lengths(covariate)) } else rep(1, length(covariate))) if (corr) { val <- .C(symm_matList, as.double(as.vector(object)), as.integer(unlist(covariate)), as.integer(attr(object, "maxCov")), as.integer(unlist(corD)), mat = double(corD[["sumLenSq"]]))[["mat"]] lD <- NULL } else { val <- .C(symm_factList, as.double(as.vector(object)), as.integer(unlist(covariate)), as.integer(attr(object, "maxCov")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] } if (corD[["M"]] > 1) { val <- split(val, rep(1:corD[["M"]], (corD[["len"]])^2)) val <- lapply(val, function(el) { nel <- round(sqrt(length(el))) array(el, c(nel, nel)) }) names(val) <- names(corD[["len"]]) val <- as.list(val) } else { val <- array(val, c(corD[["N"]], corD[["N"]])) } attr(val, "logDet") <- lD val } ###*# Methods for standard generics coef.corSymm <- function(object, unconstrained = TRUE, ...) { if (unconstrained) { if (attr(object, "fixed")) { return(numeric(0)) } else { return(as.vector(object)) } } mC <- attr(object, "maxCov") .C(symm_fullCorr, as.double(object), as.integer(mC), corr = double(round(mC * (mC - 1) / 2)))[["corr"]] } `coef<-.corSymm` <- function(object, ..., value) { if (length(value) != length(object)) { stop("cannot change the length of the parameter of a \"corSymm\" object") } object[] <- value corD <- attr(object, "Dim") ## updating the factor list and logDet aux <- .C(symm_factList, as.double(as.vector(object)), as.integer(unlist(getCovariate(object))), as.integer(attr(object, "maxCov")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] attr(object, "factor") <- aux[["factor"]] attr(object, "logDet") <- -aux[["logDet"]] object } Initialize.corSymm <- function(object, data, ...) { if (!is.null(attr(object, "maxCov"))) {# initialized - nothing to do return(object) } object <- NextMethod() covar <- attr(object, "covariate") if (data.class(covar) != "list") { covar <- list(covar) } if (any(unlist(lapply(covar, duplicated)))) { stop("covariate must have unique values within groups for \"corSymm\" objects") } covar <- unlist(covar) - 1 maxCov <- max(uCov <- unique(covar)) + 1 if (length(uCov) != maxCov) { stop("unique values of the covariate for \"corSymm\" objects must be a sequence of consecutive integers") } if (Dim(object)[["M"]] > 1) { attr(object, "covariate") <- split(covar, getGroups(object)) } else { attr(object, "covariate") <- covar } attr(object, "maxCov") <- maxCov natPar <- as.vector(object) if (length(natPar) > 0) { ## parameters assumed in constrained form if (length(natPar) != round(maxCov * (maxCov - 1) / 2)) { stop("initial value for \"corSymm\" parameters of wrong dimension") } if (max(abs(natPar)) >= 1) { stop("initial values for \"corSymm\" must be between -1 and 1") } natMat <- diag(maxCov)/2 natMat[lower.tri(natMat)] <- natPar natMat <- t(natMat) + natMat ## checking if positive-definite if (any(eigen(natMat, symmetric=TRUE, only.values=TRUE)$values <= 0)) { stop("initial values for \"corSymm\" do not define a positive-definite correlation structure") } natMat <- chol(natMat) uncPar <- numeric(0) for(i in 2:maxCov) { aux <- acos(natMat[1:(i-1),i]/sqrt(cumsum(natMat[i:1,i]^2)[i:2])) uncPar <- c(uncPar, log(aux/(pi - aux))) } coef(object) <- uncPar } else { # initializing the parameters oldAttr <- attributes(object) object <- double(round(maxCov * (maxCov - 1) / 2)) attributes(object) <- oldAttr attr(object, "factor") <- corFactor(object) attr(object, "logDet") <- -attr(attr(object, "factor"), "logDet") } object } print.corSymm <- function(x, ...) { if (length(as.vector(x)) > 0 && !is.null(mC <- attr(x, "maxCov"))) { aux <- coef.corSymm(x, unconstrained = FALSE) val <- diag(mC) dimnames(val) <- list(1:mC, 1:mC) val[lower.tri(val)] <- aux class(val) <- "correlation" cat("Correlation structure of class corSymm representing\n") print(val, ...) } else cat("Unitialized correlation structure of class corSymm\n") invisible(x) } print.summary.corSymm <- function(x, ...) { if (length(as.vector(x)) > 0 && !is.null(mC <- attr(x, "maxCov"))) { cat("Correlation Structure: General\n") cat(paste(" Formula:", deparse(formula(x)),"\n")) cat(" Parameter estimate(s):\n") val <- diag(mC) dimnames(val) <- list(1:mC, 1:mC) val[lower.tri(val)] <- coef.corSymm(x, unconstrained = FALSE) class(val) <- "correlation" print(val, ...) } else cat("Unitialized correlation structure of class corSymm\n") invisible(x) } recalc.corSymm <- function(object, conLin, ...) { val <- .C(symm_recalc, Xy = as.double(conLin[["Xy"]]), as.integer(unlist(Dim(object))), as.integer(ncol(conLin[["Xy"]])), as.double(as.vector(object)), as.integer(unlist(getCovariate(object))), as.integer(attr(object, "maxCov")), logLik = double(1))[c("Xy", "logLik")] conLin[["Xy"]][] <- val[["Xy"]] conLin[["logLik"]] <- conLin[["logLik"]] + val[["logLik"]] conLin } summary.corSymm <- function(object, structName = "General correlation", ...) { attr(object, "structName") <- structName class(object) <- "summary.corSymm" object } ###*# corNatural - general correlation in natural parametrization ####* Constructor corNatural <- function(value = numeric(0), form = ~ 1, fixed = FALSE) { attr(value, "formula") <- form attr(value, "fixed") <- fixed class(value) <- c("corNatural", "corStruct") value } ###*# Methods for local generics corFactor.corNatural <- function(object, ...) { corD <- Dim(object) val <- .C(nat_factList, as.double(as.vector(object)), as.integer(unlist(attr(object, "covariate"))), as.integer(attr(object, "maxCov")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] attr(val, "logDet") <- lD val } corMatrix.corNatural <- function(object, covariate = getCovariate(object), corr = TRUE, ...) { corD <- Dim(object, if (data.class(covariate) == "list") { if (is.null(names(covariate))) names(covariate) <- seq_along(covariate) rep(names(covariate), lengths(covariate)) } else rep(1, length(covariate))) if (corr) { val <- .C(nat_matList, as.double(as.vector(object)), as.integer(unlist(covariate)), as.integer(attr(object, "maxCov")), as.integer(unlist(corD)), mat = double(corD[["sumLenSq"]]))[["mat"]] lD <- NULL } else { val <- .C(nat_factList, as.double(as.vector(object)), as.integer(unlist(covariate)), as.integer(attr(object, "maxCov")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] } if (corD[["M"]] > 1) { val <- split(val, rep(1:corD[["M"]], (corD[["len"]])^2)) val <- lapply(val, function(el) { nel <- round(sqrt(length(el))) array(el, c(nel, nel)) }) names(val) <- names(corD[["len"]]) val <- as.list(val) } else { val <- array(val, c(corD[["N"]], corD[["N"]])) } attr(val, "logDet") <- lD val } ###*# Methods for standard generics coef.corNatural <- function(object, unconstrained = TRUE, ...) { if (unconstrained) { if (attr(object, "fixed")) { return(numeric(0)) } else { return(as.vector(object)) } } mC <- attr(object, "maxCov") val <- .C(nat_fullCorr, as.double(object), as.integer(mC), corr = double(round(mC * (mC - 1) / 2)))[["corr"]] names(val) <- outer(1:mC, 1:mC, function(x,y) paste0("cor(",y,",",x,")"))[ lower.tri(diag(mC))] val } `coef<-.corNatural` <- function(object, ..., value) { if (length(value) != length(object)) { stop("cannot change the length of the parameter of a \"corNatural\" object") } object[] <- value corD <- attr(object, "Dim") ## updating the factor list and logDet aux <- .C(nat_factList, as.double(as.vector(object)), as.integer(unlist(getCovariate(object))), as.integer(attr(object, "maxCov")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] attr(object, "factor") <- aux[["factor"]] attr(object, "logDet") <- -aux[["logDet"]] object } Initialize.corNatural <- function(object, data, ...) { if (!is.null(attr(object, "maxCov"))) {# initialized - nothing to do return(object) } object <- NextMethod() covar <- attr(object, "covariate") if (data.class(covar) != "list") { covar <- list(covar) } if (any(unlist(lapply(covar, duplicated)))) { stop("covariate must have unique values within groups for \"corNatural\" objects") } covar <- unlist(covar) - 1 maxCov <- max(uCov <- unique(covar)) + 1 if (length(uCov) != maxCov) { stop("unique values of the covariate for \"corNatural\" objects must be a sequence of consecutive integers") } if (Dim(object)[["M"]] > 1) { attr(object, "covariate") <- split(covar, getGroups(object)) } else { attr(object, "covariate") <- covar } attr(object, "maxCov") <- maxCov natPar <- as.vector(object) if (length(natPar) > 0) { ## parameters assumed in constrained form if (length(natPar) != round(maxCov * (maxCov - 1) / 2)) { stop("initial value for \"corNatural\" parameters of wrong dimension") } if (max(abs(natPar)) >= 1) { stop("initial values for \"corNatural\" must be between -1 and 1") } natMat <- diag(maxCov)/2 natMat[lower.tri(natMat)] <- natPar natMat <- t(natMat) + natMat ## checking if positive-definite if (any(eigen(natMat, symmetric=TRUE, only.values=TRUE)$values <= 0)) { stop("initial values for \"corNatural\" do not define a positive-definite correlation structure") } coef(object) <- log((natPar + 1)/(1 - natPar)) } else { # initializing the parameters oldAttr <- attributes(object) object <- double(round(maxCov * (maxCov - 1) / 2)) attributes(object) <- oldAttr attr(object, "factor") <- corFactor(object) attr(object, "logDet") <- -attr(attr(object, "factor"), "logDet") } object } print.corNatural <- function(x, ...) { if (length(as.vector(x)) > 0 && !is.null(mC <- attr(x, "maxCov"))) { aux <- coef(x, FALSE) val <- diag(mC) dimnames(val) <- list(1:mC, 1:mC) val[lower.tri(val)] <- aux class(val) <- "correlation" cat("Correlation structure of class corNatural representing\n") print(val, ...) } else cat("Unitialized correlation structure of class corNatural\n") invisible(x) } print.summary.corNatural <- function(x, ...) { if (length(as.vector(x)) > 0 && !is.null(mC <- attr(x, "maxCov"))) { cat("Correlation Structure: General\n") cat(paste(" Formula:", deparse(formula(x)),"\n")) cat(" Parameter estimate(s):\n") aux <- coef(x, FALSE) val <- diag(mC) dimnames(val) <- list(1:mC, 1:mC) val[lower.tri(val)] <- aux class(val) <- "correlation" print(val, ...) } else cat("Unitialized correlation structure of class corNatural\n") invisible(x) } recalc.corNatural <- function(object, conLin, ...) { val <- .C(nat_recalc, Xy = as.double(conLin[["Xy"]]), as.integer(unlist(Dim(object))), as.integer(ncol(conLin[["Xy"]])), as.double(as.vector(object)), as.integer(unlist(getCovariate(object))), as.integer(attr(object, "maxCov")), logLik = double(1))[c("Xy", "logLik")] conLin[["Xy"]][] <- val[["Xy"]] conLin[["logLik"]] <- conLin[["logLik"]] + val[["logLik"]] conLin } summary.corNatural <- function(object, structName = "General correlation, with natural parametrization", ...) { attr(object, "structName") <- structName class(object) <- "summary.corNatural" object } ###*# corIdent - independent structure ####* Constructor corIdent <- ## Constructor for the corIdent class function(form = NULL) { value <- numeric(0) attr(value, "formula") <- form attr(value, "fixed") <- TRUE class(value) <- c("corIdent", "corStruct") value } ###*# Methods for local generics corMatrix.corIdent <- function(object, covariate = getCovariate(object), corr, ...) { if (data.class(covariate) == "list") {# by group as.list(lapply(covariate, function(el, object) corMatrix(object, el))) } else { diag(length(covariate)) } } ###*# Methods for standard generics coef.corIdent <- function(object, unconstrained = TRUE, ...) numeric(0) `coef<-.corIdent` <- function(object, ..., value) object Initialize.corIdent <- function(object, data, ...) { attr(object, "logDet") <- 0 object } logDet.corIdent <- function(object, covariate, ...) 0 recalc.corIdent <- function(object, conLin, ...) conLin summary.corIdent <- function(object, structName = "Independent", ...) { summary.corStruct(object, structName) } ###*# corAR1 - autoregressive of order one structure ####* Constructor corAR1 <- ## Constructor for the corAR1 class function(value = 0, form = ~ 1, fixed = FALSE) { if (abs(value) >= 1) { stop("parameter in AR(1) structure must be between -1 and 1") } value <- log((1 + value)/( 1 - value)) attr(value, "formula") <- form attr(value, "fixed") <- fixed class(value) <- c("corAR1", "corStruct") value } ###*# Methods for local generics corFactor.corAR1 <- function(object, ...) { corD <- Dim(object) if(corD[["sumLenSq"]] > .Machine$integer.max) stop(gettextf("'sumLenSq' = %g is too large (larger than maximal integer)", corD[["sumLenSq"]]), domain = NA) val <- .C(AR1_factList, as.double(as.vector(object)), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), ## of size n^2 -- too large !! logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] attr(val, "logDet") <- lD val } corMatrix.corAR1 <- function(object, covariate = getCovariate(object), corr = TRUE, ...) { corD <- Dim(object, if (data.class(covariate) == "list") { if (is.null(names(covariate))) names(covariate) <- seq_along(covariate) rep(names(covariate), lengths(covariate)) } else rep(1, length(covariate))) if (corr) { val <- .C(AR1_matList, as.double(as.vector(object)), as.integer(unlist(corD)), mat = double(corD[["sumLenSq"]]))[["mat"]] lD <- NULL } else { val <- .C(AR1_factList, as.double(as.vector(object)), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] } if (corD[["M"]] > 1) { val <- split(val, rep(1:corD[["M"]], (corD[["len"]])^2)) val <- lapply(val, function(el) { nel <- round(sqrt(length(el))) array(el, c(nel, nel)) }) names(val) <- names(corD[["len"]]) val <- as.list(val) } else { val <- array(val, c(corD[["N"]], corD[["N"]])) } attr(val, "logDet") <- lD val } ###*# Methods for standard generics coef.corAR1 <- function(object, unconstrained = TRUE, ...) { if (unconstrained) { if (attr(object, "fixed")) { return(numeric(0)) } else { return(as.vector(object)) } } aux <- exp(as.vector(object)) aux <- c((aux - 1)/(aux + 1)) names(aux) <- "Phi" aux } `coef<-.corAR1` <- function(object, ..., value) { if (length(value) != length(object)) { stop("cannot change the length of the parameter of a \"corAR1\" object") } object[] <- value corD <- attr(object, "Dim") ## updating the factor list and logDet aux <- .C(AR1_factList, as.double(as.vector(object)), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] attr(object, "factor") <- aux[["factor"]] attr(object, "logDet") <- -aux[["logDet"]] object } Initialize.corAR1 <- ## Initializes corAR1 objects function(object, data, ...) { object <- NextMethod() covar <- attr(object, "covariate") if (data.class(covar) != "list") { covar <- list(covar) } if (any(unlist(lapply(covar, duplicated)))) { stop("covariate must have unique values within groups for \"corAR1\" objects") } if (any(unlist(lapply(covar, diff)) != 1)) { ## Cannot use formulas for inverse of square root matrix ## will convert to class ARMA(1,0) attr(object, "p") <- 1 attr(object, "q") <- 0 class(object) <- c("corARMA", "corStruct") Initialize(object, data) } else { ## obtaining the factor list and logDet attr(object, "factor") <- corFactor(object) attr(object, "logDet") <- -attr(attr(object, "factor"), "logDet") object } } recalc.corAR1 <- function(object, conLin, ...) { val <- .C(AR1_recalc, Xy = as.double(conLin[["Xy"]]), as.integer(unlist(Dim(object))), as.integer(ncol(conLin[["Xy"]])), as.double(as.vector(object)), logLik = double(1))[c("Xy", "logLik")] conLin[["Xy"]][] <- val[["Xy"]] conLin[["logLik"]] <- conLin[["logLik"]] + val[["logLik"]] conLin } summary.corAR1 <- function(object, structName = "AR(1)", ...) { summary.corStruct(object, structName) } ####*# corCAR1 - continuous time autoregressive of order one structure #####* Constructor corCAR1 <- ## Constructor for the corCAR1 class function(value = 0.2, form = ~ 1, fixed = FALSE) { if (value <= 0 | value >= 1) { stop("parameter in CAR(1) structure must be between 0 and 1") } value <- log(value / (1 - value)) attr(value, "formula") <- form attr(value, "fixed") <- fixed class(value) <- c("corCAR1", "corStruct") value } ###*# Methods for local generics corFactor.corCAR1 <- function(object, ...) { corD <- Dim(object) val <- .C(CAR1_factList, as.double(as.vector(object)), as.double(unlist(attr(object, "covariate"))), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] attr(val, "logDet") <- lD val } corMatrix.corCAR1 <- function(object, covariate = getCovariate(object), corr = TRUE, ...) { corD <- Dim(object, if (data.class(covariate) == "list") { if (is.null(names(covariate))) names(covariate) <- seq_along(covariate) rep(names(covariate), lengths(covariate)) } else rep(1, length(covariate))) if (corr) { val <- .C(CAR1_matList, as.double(as.vector(object)), as.double(unlist(covariate)), as.integer(unlist(corD)), mat = double(corD[["sumLenSq"]]))[["mat"]] lD <- NULL } else { val <- .C(CAR1_factList, as.double(as.vector(object)), as.double(unlist(covariate)), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] } if (corD[["M"]] > 1) { val <- split(val, rep(1:corD[["M"]], (corD[["len"]])^2)) val <- lapply(val, function(el) { nel <- round(sqrt(length(el))) array(el, c(nel, nel)) }) names(val) <- names(corD[["len"]]) val <- as.list(val) } else { val <- array(val, c(corD[["N"]], corD[["N"]])) } attr(val, "logDet") <- lD val } ###*# Methods for standard generics coef.corCAR1 <- function(object, unconstrained = TRUE, ...) { if (unconstrained) { if (attr(object, "fixed")) { return(numeric(0)) } else { return(as.vector(object)) } } aux <- c(exp(as.vector(object))) aux <- aux/(1+aux) names(aux) <- "Phi" aux } `coef<-.corCAR1` <- function(object, ..., value) { if (length(value) != length(object)) { stop("cannot change the length of the parameter of a \"corCAR1\" object") } object[] <- value corD <- attr(object, "Dim") ## updating the factor list and logDet aux <- .C(CAR1_factList, as.double(as.vector(object)), as.double(unlist(getCovariate(object))), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] attr(object, "factor") <- aux[["factor"]] attr(object, "logDet") <- -aux[["logDet"]] object } Initialize.corCAR1 <- ## Initializes corCAR1 objects function(object, data, ...) { object <- NextMethod() covar <- attr(object, "covariate") if (data.class(covar) != "list") { covar <- list(covar) } if (any(unlist(lapply(covar, duplicated)))) { stop("covariate must have unique values within groups for \"corCAR1\" objects") } attr(object, "factor") <- corFactor(object) attr(object, "logDet") <- -attr(attr(object, "factor"), "logDet") object } recalc.corCAR1 <- function(object, conLin, ...) { val <- .C(CAR1_recalc, Xy = as.double(conLin[["Xy"]]), as.integer(unlist(Dim(object))), as.integer(ncol(conLin[["Xy"]])), as.double(as.vector(object)), as.double(unlist(getCovariate(object))), logLik = double(1))[c("Xy", "logLik")] conLin[["Xy"]][] <- val[["Xy"]] conLin[["logLik"]] <- conLin[["logLik"]] + val[["logLik"]] conLin } summary.corCAR1 <- function(object, structName = "Continuous AR(1)", ...) { summary.corStruct(object, structName) } ###*# corARMA - autoregressive-moving average structures ####* Constructor corARMA <- ## Constructor for the corARMA class function(value = double(p + q), form = ~ 1, p = 0, q = 0, fixed = FALSE) { if (!(p >= 0 && (p == round(p)))) { stop("autoregressive order must be a non-negative integer") } if (!(q >= 0 && (q == round(q)))) { stop("moving average order must be a non-negative integer") } if (0 == (p + q)) { return(corIdent()) } if (length(value) != p + q) { stop("initial value for parameter of wrong length") } if (max(abs(value)) >= 1) { stop("parameters in ARMA structure must be < 1 in absolute value") } ## unconstrained parameters value <- .C(ARMA_unconstCoef, as.integer(p), as.integer(q), pars = as.double(value))$pars attributes(value) <- list(formula = form, p = p, q = q, fixed = fixed) class(value) <- c("corARMA", "corStruct") value } ###*# Methods for local generics corFactor.corARMA <- function(object, ...) { maxLag <- attr(object, "maxLag") if(is.null(maxLag)) stop("'object' has not been Initialize()d") corD <- Dim(object) val <- .C(ARMA_factList, as.double(as.vector(object)), as.integer(attr(object, "p")), as.integer(attr(object, "q")), as.integer(unlist(attr(object, "covariate"))), as.integer(attr(object, "maxLag")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] attr(val, "logDet") <- lD val } corMatrix.corARMA <- function(object, covariate = getCovariate(object), corr = TRUE, ...) { corD <- Dim(object, if (data.class(covariate) == "list") { if (is.null(names(covariate))) names(covariate) <- seq_along(covariate) rep(names(covariate), lengths(covariate)) } else rep(1, length(covariate))) p <- attr(object, "p") q <- attr(object, "q") maxLag <- attr(object, "maxLag") if(is.null(maxLag)) stop("'object' has not been Initialize()d") if (corr) { val <- .C(ARMA_matList, as.double(as.vector(object)), as.integer(p), as.integer(q), as.integer(unlist(covariate)), as.integer(maxLag), as.integer(unlist(corD)), mat = double(corD[["sumLenSq"]]))[["mat"]] lD <- NULL } else { val <- .C(ARMA_factList, as.double(as.vector(object)), as.integer(attr(object, "p")), as.integer(attr(object, "q")), as.integer(unlist(covariate)), as.integer(attr(object, "maxLag")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] } if (corD[["M"]] > 1) { val <- split(val, rep(1:corD[["M"]], (corD[["len"]])^2)) val <- lapply(val, function(el) { nel <- round(sqrt(length(el))) array(el, c(nel, nel)) }) names(val) <- names(corD[["len"]]) val <- as.list(val) } else { val <- array(val, c(corD[["N"]], corD[["N"]])) } attr(val, "logDet") <- lD val } ###*# Methods for standard generics coef.corARMA <- function(object, unconstrained = TRUE, ...) { if (attr(object, "fixed") && unconstrained) { return(numeric(0)) } val <- as.vector(object) if (!unconstrained) { p <- attr(object, "p") q <- attr(object, "q") nams <- NULL if (p > 0) { nams <- paste(rep("Phi", p), 1:p, sep="") } if (q > 0) { nams <- c(nams, paste(rep("Theta", q), 1:q, sep="")) } val <- c(.C(ARMA_constCoef, as.integer(attr(object,"p")), as.integer(attr(object,"q")), pars = as.double(val))$pars) names(val) <- nams } val } `coef<-.corARMA` <- function(object, ..., value) { maxLag <- attr(object, "maxLag") if(is.null(maxLag)) stop("'object' has not been Initialize()d") if (length(value) != length(object)) { stop("cannot change the length of the parameter of a \"corARMA\" object") } p <- attr(object, "p") q <- attr(object, "q") object[] <- value ## updating the factor list and logDet corD <- Dim(object) aux <- .C(ARMA_factList, as.double(as.vector(object)), as.integer(p), as.integer(q), as.integer(unlist(getCovariate(object))), as.integer(attr(object, "maxLag")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] attr(object, "factor") <- aux[["factor"]] attr(object, "logDet") <- -aux[["logDet"]] object } Initialize.corARMA <- function(object, data, ...) { ## Initializes corARMA objects object <- NextMethod() covar <- attr(object, "covariate") if (data.class(covar) != "list") { covar <- list(covar) } if (any(unlist(lapply(covar, duplicated)))) { stop("covariate must have unique values within groups for \"corARMA\" objects") } if ((attr(object, "p") == 1) && (attr(object, "q") == 0) && all(unlist(lapply(covar, diff)) == 1)) { ## Use AR1 methods instead class(object) <- c("corAR1", "corStruct") Initialize(object, data) } else { attr(object, "maxLag") <- max(unlist(lapply(covar, function(el) max(abs(outer(el,el,"-")))))) attr(object, "factor") <- corFactor(object) attr(object, "logDet") <- -attr(attr(object, "factor"), "logDet") object } } recalc.corARMA <- function(object, conLin, ...) { maxLag <- attr(object, "maxLag") if(is.null(maxLag)) stop("'object' has not been Initialize()d") val <- .C(ARMA_recalc, Xy = as.double(conLin[["Xy"]]), as.integer(unlist(Dim(object))), as.integer(ncol(conLin[["Xy"]])), as.double(as.vector(object)), as.integer(attr(object, "p")), as.integer(attr(object, "q")), as.integer(unlist(getCovariate(object))), as.integer(attr(object, "maxLag")), logLik = double(1))[c("Xy", "logLik")] conLin[["Xy"]][] <- val[["Xy"]] conLin[["logLik"]] <- conLin[["logLik"]] + val[["logLik"]] conLin } summary.corARMA <- function(object, structName = paste("ARMA(",attr(object,"p"),",", attr(object,"q"), ")", sep = ""), ...) { summary.corStruct(object, structName) } ###*# corCompSymm - Compound symmetry structure structure ####* Constructor corCompSymm <- ## Constructor for the corCompSymm class function(value = 0, form = ~ 1, fixed = FALSE) { if (abs(value) >= 1) { stop("parameter in \"corCompSymm\" structure must be < 1 in absolute value") } attr(value, "formula") <- form attr(value, "fixed") <- fixed class(value) <- c("corCompSymm", "corStruct") value } ###*# Methods for local generics corFactor.compSymm <- function(object, ...) { corD <- Dim(object) val <- .C(compSymm_factList, as.double(as.vector(object)), as.double(attr(object, "inf")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] attr(val, "logDet") <- lD val } corMatrix.corCompSymm <- function(object, covariate = getCovariate(object), corr = TRUE, ...) { corD <- Dim(object, if (data.class(covariate) == "list") { if (is.null(names(covariate))) names(covariate) <- seq_along(covariate) rep(names(covariate), lengths(covariate)) } else rep(1, length(covariate))) if (corr) { val <- .C(compSymm_matList, as.double(as.vector(object)), as.double(attr(object, "inf")), as.integer(unlist(corD)), mat = double(corD[["sumLenSq"]]))[["mat"]] lD <- NULL } else { val <- .C(compSymm_factList, as.double(as.vector(object)), as.double(attr(object, "inf")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] } if (corD[["M"]] > 1) { val <- split(val, rep(1:corD[["M"]], (corD[["len"]])^2)) val <- lapply(val, function(el) { nel <- round(sqrt(length(el))) array(el, c(nel, nel)) }) names(val) <- names(corD[["len"]]) val <- as.list(val) } else { val <- array(val, c(corD[["N"]], corD[["N"]])) } attr(val, "logDet") <- lD val } ###*# Methods for local generics coef.corCompSymm <- function(object, unconstrained = TRUE, ...) { if (unconstrained) { if (attr(object, "fixed")) { return(numeric(0)) } else { return(as.vector(object)) } } val <- exp(as.vector(object)) val <- c((val + attr(object, "inf"))/(val + 1)) names(val) <- "Rho" val } `coef<-.corCompSymm` <- function(object, ..., value) { if (length(value) != length(object)) { stop("cannot change the length of the parameter of a \"corCompSymm\" object") } object[] <- value corD <- attr(object, "Dim") ## updating the factor list and logDet aux <- .C(compSymm_factList, as.double(as.vector(object)), as.double(attr(object, "inf")), as.integer(unlist(corD)), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] attr(object, "factor") <- aux[["factor"]] attr(object, "logDet") <- -aux[["logDet"]] object } Initialize.corCompSymm <- ## Initializes corCompSymm objects function(object, data, ...) { if (!is.null(attr(object, "inf"))) { # initialized - nothing to do return(object) } object <- NextMethod() natPar <- as.vector(object) corD <- Dim(object) if (natPar <= (attr(object, "inf") <- -1/(corD[["maxLen"]] - 1))) { stop(gettextf("initial value in \"corCompSymm\" must be greater than %s", attr(object, "inf")), domain = NA) } object[] <- log((natPar - attr(object, "inf"))/(1 - natPar)) attr(object, "factor") <- corFactor(object) attr(object, "logDet") <- -attr(attr(object, "factor"), "logDet") object } recalc.corCompSymm <- function(object, conLin, ...) { val <- .C(compSymm_recalc, Xy = as.double(conLin[["Xy"]]), as.integer(unlist(Dim(object))), as.integer(ncol(conLin[["Xy"]])), as.double(as.vector(object)), as.double(attr(object, "inf")), logLik = double(1))[c("Xy", "logLik")] conLin[["Xy"]][] <- val[["Xy"]] conLin[["logLik"]] <- conLin[["logLik"]] + val[["logLik"]] conLin } summary.corCompSymm <- function(object, structName = "Compound symmetry", ...) { summary.corStruct(object, structName) } ####*# corHF - Huyn-Feldt structure #corHF <- # ## Constructor for the corHuynFeldt class # function(value = numeric(0), form = ~ 1) #{ # attr(value, "formula") <- form # class(value) <- c("corHF", "corStruct") # value #} ####*# Methods for local generics #corFactor.corHF <- # function(object) #{ # corD <- Dim(object) # val <- .C("HF_factList", # as.double(as.vector(object)), # as.integer(attr(object, "maxCov")), # as.integer(unlist(getCovariate(object))), # as.integer(unlist(corD)), # factor = double(corD[["sumLenSq"]]), # logDet = double(1))[c("factor", "logDet")] # lD <- val[["logDet"]] # val <- val[["factor"]] # attr(val, "logDet") <- lD # val #} #corMatrix.corHF <- # function(object, covariate = getCovariate(object), corr = TRUE) #{ # corD <- Dim(object, # if (data.class(covariate) == "list") { # if (is.null(names(covariate))) # names(covariate) <- seq_along(covariate) # rep(names(covariate), lengths(covariate)) # } else # rep(1, length(covariate))) # if (corr) { # val <- .C("HF_matList", # as.double(as.vector(object)), # as.integer(attr(object, "maxCov")), # as.integer(unlist(covariate)), # as.integer(unlist(corD)), # mat = double(corD[["sumLenSq"]]))[["mat"]] # lD <- NULL # } else { # val <- .C("HF_factList", # as.double(as.vector(object)), # as.integer(attr(object, "maxCov")), # as.integer(unlist(covariate)), # as.integer(unlist(corD)), # factor = double(corD[["sumLenSq"]]), # logDet = double(1))[c("factor", "logDet")] # lD <- val[["logDet"]] # val <- val[["factor"]] # } # if (corD[["M"]] > 1) { # val <- split(val, rep(1:corD[["M"]], (corD[["len"]])^2)) # val <- lapply(val, function(el) { # nel <- round(sqrt(length(el))) # array(el, c(nel, nel)) # }) # names(val) <- names(corD[["len"]]) # } else { # val <- array(val, c(corD[["N"]], corD[["N"]])) # } # attr(val, "logDet") <- lD # val #} ####*# Methods for standard generics #coef.corHF <- # function(object, unconstrained = TRUE) #{ # aux <- as.vector(object) # if (!unconstrained) { # aux <- 2 * (exp(aux) + attr(object, "inf")) + 1 # } # aux #} #"coef<-.corHF" <- # function(object, value) #{ # if (length(value) != length(object)) { # stop("Cannot change the length of the parameter of a corStruct object") # } # object[] <- value # corD <- attr(object, "Dim") # ## updating the factor list and logDet # aux <- .C("HF_factList", # as.double(as.vector(object)), # as.integer(attr(object, "maxCov")), # as.integer(unlist(getCovariate(object))), # as.integer(unlist(corD)), # factor = double(corD[["sumLenSq"]]), # logDet = double(1))[c("factor", "logDet")] # attr(object, "factor") <- aux[["factor"]] # attr(object, "logDet") <- -aux[["logDet"]] # object #} #initialize.corHF <- # function(object, data, ...) #{ # if (!is.null(attr(object, "inf"))) { # initialized - nothing to do # return(object) # } # object <- NextMethod() # covar <- attr(object, "covariate") # if (data.class(covar) == "list") { # attr(object, "covariate") <- covar <- # lapply(covar, function(el) el - 1) # } else { # attr(object, "covariate") <- covar <- covar - 1 # covar <- list(covar) # } # if (any(unlist(lapply(covar, duplicated)))) { # stop(paste("Covariate must have unique values", # "within groups for corHF objects")) # } # maxCov <- max(uCov <- unique(unlist(covar))) + 1 # if (length(uCov) != maxCov) { # stop(paste("Unique values of the covariate for \"corHF\"", # "objects must be a sequence of consecutive integers")) # } # attr(object, "maxCov") <- maxCov # attr(object, "inf") <- -1/(2*maxCov) # natPar <- as.vector(object) # if (length(natPar) > 0) { # if (length(aux) != attr(object, "maxCov")) # stop("Initial value for Huyn-Feldt parameters of wrong dimension") # ## verifying if initial values satisfy constraints # if (any(natPar <= attr(object, "inf"))) { # stop(paste("Initial values for \"corHF\" parameters", # "must be > than", attr(object, "inf"))) # } # object[] <- log(natPar - attr(object, "inf")) # } else { # initializing the parameters # oldAttr <- attributes(object) # object <- log(rep(-attr(object, "inf"), att(object, "maxCov"))) # attributes(object) <- oldAttr # } # attr(object, "factor") <- corFactor(object) # attr(object, "logDet") <- -attr(attr(object, "factor"), "logDet") # object #} #print.corHF <- # function(x, ...) #{ # if (length(as.vector(x)) > 0 && !is.null(attr(object, "maxCov"))) # NextMethod() # else cat("Unitialized correlation structure of class corHF\n") #} #recalc.corHF <- # function(object, conLin) #{ # val <- # .C("HF_recalc", # Xy = as.double(conLin[["Xy"]]), # as.integer(unlist(Dim(object))), # as.integer(ncol(conLin[["Xy"]])), # as.double(as.vector(object)), # as.integer(unlist(getCovariate(object))), # as.integer(attr(object, "maxCov")), # logLik = double(1))[c("Xy", "logLik")] # conLin[["Xy"]][] <- val[["Xy"]] # conLin[["logLik"]] <- conLin[["logLik"]] + val[["logLik"]] # conLin #} #summary.corHF <- # function(object, structName = "Huyn-Feldt") #{ # summary.corStruct(object, structName) #} ###*# corSpatial - a virtual class of spatial correlation structures ###*# Constructor corSpatial <- ## Constructor for the corSpatial class function(value = numeric(0), form = ~ 1, nugget = FALSE, type = c("spherical", "exponential", "gaussian", "linear", "rational"), metric = c("euclidean", "maximum", "manhattan"), fixed = FALSE) { spClass <- c(spherical = "corSpher", exponential = "corExp", gaussian = "corGaus", linear = "corLin", rational = "corRatio")[match.arg(type)] structure(value, "formula" = form, "nugget" = nugget, "metric" = match.arg(metric), "fixed" = fixed, class = c(spClass, "corSpatial", "corStruct")) } ###*# Methods for local generics corFactor.corSpatial <- function(object, ...) { corD <- Dim(object) val <- .C(spatial_factList, as.double(as.vector(object)), as.integer(attr(object, "nugget")), as.double(unlist(getCovariate(object))), as.integer(unlist(corD)), as.double(attr(object, "minD")), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] structure(val[["factor"]], logDet = val[["logDet"]]) } corMatrix.corSpatial <- function(object, covariate = getCovariate(object), corr = TRUE, ...) { nRt <- function(vec) round((1 + sqrt(1 + 8 * length(vec))) / 2) corD <- Dim(object, if (data.class(covariate) == "list") { if (is.null(names(covariate))) names(covariate) <- seq_along(covariate) rep(names(covariate), vapply(covariate, nRt, numeric(1))) } else rep(1, nRt(covariate))) if (corr) { val <- .C(spatial_matList, as.double(as.vector(object)), as.integer(attr(object, "nugget")), as.double(unlist(covariate)), as.integer(unlist(corD)), as.double(attr(object, "minD")), mat = double(corD[["sumLenSq"]]))[["mat"]] lD <- NULL } else { val <- .C(spatial_factList, as.double(as.vector(object)), as.integer(attr(object, "nugget")), as.double(unlist(getCovariate(object))), as.integer(unlist(corD)), as.double(attr(object, "minD")), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] lD <- val[["logDet"]] val <- val[["factor"]] } if (corD[["M"]] > 1) { val <- split(val, rep(1:corD[["M"]], (corD[["len"]])^2)) val <- lapply(val, function(el) { nel <- round(sqrt(length(el))) array(el, c(nel, nel)) }) names(val) <- names(corD[["len"]]) val <- as.list(val) } else { val <- array(val, c(corD[["N"]], corD[["N"]])) } attr(val, "logDet") <- lD val } ###*# Methods for standard generics coef.corSpatial <- function(object, unconstrained = TRUE, ...) { if (attr(object, "fixed") && unconstrained) { return(numeric(0)) } val <- as.vector(object) if (length(val) == 0) { # uninitialized return(val) } if (!unconstrained) { val <- exp(val) if (attr(object, "nugget")) val[2] <- val[2]/(1+val[2]) } names(val) <- if(attr(object, "nugget")) c("range", "nugget") else "range" val } `coef<-.corSpatial` <- function(object, ..., value) { if (length(value) != length(object)) { stop("cannot change the length of the parameter after initialization") } object[] <- value corD <- attr(object, "Dim") ## updating the factor list and logDet aux <- .C(spatial_factList, as.double(as.vector(object)), as.integer(attr(object, "nugget")), as.double(unlist(getCovariate(object))), as.integer(unlist(corD)), as.double(attr(object, "minD")), factor = double(corD[["sumLenSq"]]), logDet = double(1))[c("factor", "logDet")] attr(object, "factor") <- aux[["factor"]] attr(object, "logDet") <- -aux[["logDet"]] object } Dim.corSpatial <- function(object, groups, ...) { if (missing(groups)) return(attr(object, "Dim")) val <- Dim.corStruct(object, groups) val[["start"]] <- c(0, cumsum(val[["len"]] * (val[["len"]] - 1)/2)[-val[["M"]]]) ## will use third component of Dim list for spClass names(val)[3] <- "spClass" val[[3]] <- match(class(object)[1], c("corSpher", "corExp", "corGaus", "corLin", "corRatio"), 0) val } getCovariate.corSpatial <- function(object, form = formula(object), data) { if (is.null(covar <- attr(object, "covariate"))) { # need to calculate it if (missing(data)) { stop("need data to calculate covariate") } covForm <- getCovariateFormula(form) covar <- if (length(all.vars(covForm)) > 0) { # covariate present if (attr(terms(covForm), "intercept") == 1) { covForm <- eval(substitute(~ CV - 1, list(CV = covForm[[2]]))) } as.data.frame(unclass( model.matrix(covForm, model.frame(covForm, data, drop.unused.levels = TRUE)))) } ## else NULL covar <- if (!is.null(getGroupsFormula(form))) { # by groups grps <- getGroups(object, data = data) grps <- if (is.null(covar)) { lapply(split(grps, grps), function(x) as.vector(dist(seq_along(x)))) } else { lapply(split(covar, grps), function(el, metric) { el <- as.matrix(el) if (nrow(el) > 1) as.vector(dist(el, metric)) else numeric(0) }, metric = attr(object, "metric")) } grps[lengths(grps) > 0]# no 1-obs groups } else { # no groups as.vector( if (is.null(covar)) dist(1:nrow(data)) else dist(as.matrix(covar), method = attr(object, "metric"))) } if (any(unlist(covar) == 0)) { stop("cannot have zero distances in \"corSpatial\"") } } covar } Initialize.corSpatial <- function(object, data, ...) { if (!is.null(attr(object, "minD"))) { #already initialized return(object) } object <- Initialize.corStruct(object, data) nug <- attr(object, "nugget") val <- as.vector(object) if (length(val) > 0) { # initialized if (val[1] <= 0) { stop("'range' must be > 0 in \"corSpatial\" initial value") } if (nug) { # with nugget effect if (length(val) == 1) { # assuming nugget effect not given val <- c(val, 0.1) # setting it to 0.1 } else { if (length(val) != 2) { stop("initial value for \"corSpatial\" parameters of wrong dimension") } } if ((val[2] <= 0) || (val[2] >= 1)) { stop("initial value of nugget ratio must be between 0 and 1") } } else { # only range parameter if (length(val) != 1) { stop("initial value for \"corSpatial\" parameters of wrong dimension") } } } else { val <- min(unlist(attr(object, "covariate"))) * 0.9 if (nug) val <- c(val, 0.1) } val[1] <- log(val[1]) if (nug) val[2] <- log(val[2]/(1 - val[2])) oldAttr <- attributes(object) object <- val attributes(object) <- oldAttr attr(object, "minD") <- min(unlist(attr(object, "covariate"))) attr(object, "factor") <- corFactor(object) attr(object, "logDet") <- -attr(attr(object, "factor"), "logDet") object } recalc.corSpatial <- function(object, conLin, ...) { val <- .C(spatial_recalc, Xy = as.double(conLin[["Xy"]]), as.integer(unlist(Dim(object))), as.integer(ncol(conLin[["Xy"]])), as.double(as.vector(object)), as.double(unlist(getCovariate(object))), as.double(attr(object, "minD")), as.integer(attr(object, "nugget")), logLik = double(1))[c("Xy", "logLik")] conLin[["Xy"]][] <- val[["Xy"]] conLin[["logLik"]] <- conLin[["logLik"]] + val[["logLik"]] conLin } Variogram.corSpatial <- function(object, distance = NULL, sig2 = 1, length.out = 50, FUN, ...) { if (is.null(distance)) { rangeDist <- range(unlist(getCovariate(object))) distance <- seq(rangeDist[1], rangeDist[2], length = length.out) } params <- coef(object, unconstrained = FALSE) if (length(params) == 1) { # no nugget effect rang <- params nugg <- 0 } else { # nugget effect rang <- params[1] nugg <- params[2] } val <- data.frame(variog = sig2 * (nugg + (1 - nugg) * FUN(distance, rang)), dist = distance) class(val) <- c("Variogram", "data.frame") val } ###*# corExp - exponential spatial correlation structure corExp <- ## Constructor for the corExp class function(value = numeric(0), form = ~ 1, nugget = FALSE, metric = c("euclidean", "maximum", "manhattan"), fixed = FALSE) { attr(value, "formula") <- form attr(value, "nugget") <- nugget attr(value, "metric") <- match.arg(metric) attr(value, "fixed") <- fixed class(value) <- c("corExp", "corSpatial", "corStruct") value } ###*# Methods for standard generics summary.corExp <- function(object, structName = "Exponential spatial correlation", ...) { summary.corStruct(object, structName) } Variogram.corExp <- function(object, distance = NULL, sig2 = 1, length.out = 50, ...) { Variogram.corSpatial(object, distance, sig2, length.out, function(x, y) { 1 - exp(-x/y) }) } ###*# corGaus - Gaussian spatial correlation structure corGaus <- ## Constructor for the corGaus class function(value = numeric(0), form = ~ 1, nugget = FALSE, metric = c("euclidean", "maximum", "manhattan"), fixed = FALSE) { attr(value, "formula") <- form attr(value, "nugget") <- nugget attr(value, "metric") <- match.arg(metric) attr(value, "fixed") <- fixed class(value) <- c("corGaus", "corSpatial", "corStruct") value } ###*# Methods for standard generics summary.corGaus <- function(object, structName = "Gaussian spatial correlation", ...) { summary.corStruct(object, structName) } Variogram.corGaus <- function(object, distance = NULL, sig2 = 1, length.out = 50, ...) { Variogram.corSpatial(object, distance, sig2, length.out, function(x, y){ 1 - exp(-(x/y)^2) }) } ###*# corLin - Linear spatial correlation structure corLin <- ## Constructor for the corLin class function(value = numeric(0), form = ~ 1, nugget = FALSE, metric = c("euclidean", "maximum", "manhattan"), fixed = FALSE) { attr(value, "formula") <- form attr(value, "nugget") <- nugget attr(value, "metric") <- match.arg(metric) attr(value, "fixed") <- fixed class(value) <- c("corLin", "corSpatial", "corStruct") value } ###*# Methods for standard generics coef.corLin <- function(object, unconstrained = TRUE, ...) { val <- NextMethod() if (!unconstrained) val[1] <- val[1] + attr(object, "minD") val } Initialize.corLin <- function(object, data, ...) { if (!is.null(attr(object, "minD"))) { #already initialized return(object) } object <- Initialize.corStruct(object, data) nug <- attr(object, "nugget") minD <- min(unlist(attr(object, "covariate"))) val <- as.vector(object) if (length(val) > 0) { # initialized if (val[1] <= 0) { stop("'range' must be > 0 in \"corLin\" initial value") } if (val[1] <= minD) { warning("initial value for 'range' less than minimum distance. Setting it to 1.1 * min(distance)") val[1] <- 1.1 * minD } if (nug) { # with nugget effect if (length(val) == 1) { # assuming nugget effect not given val <- c(val, 0.1) # setting it to 0.1 } else { if (length(val) != 2) { stop("initial value for \"corLin\" parameters of wrong dimension") } } if ((val[2] <= 0) || (val[2] >= 1)) { stop("initial value of nugget ratio must be between 0 and 1") } } else { # only range parameter if (length(val) != 1) { stop("initial value for \"corLin\" parameters of wrong dimension") } } } else { val <- minD * 1.1 if (nug) val <- c(val, 0.1) } val[1] <- log(val[1] - minD) if (nug) val[2] <- log(val[2]/(1 - val[2])) oldAttr <- attributes(object) object <- val attributes(object) <- oldAttr attr(object, "minD") <- minD attr(object, "factor") <- corFactor(object) attr(object, "logDet") <- -attr(attr(object, "factor"), "logDet") object } summary.corLin <- function(object, structName = "Linear spatial correlation", ...) { summary.corStruct(object, structName) } Variogram.corLin <- function(object, distance = NULL, sig2 = 1, length.out = 50, ...) { Variogram.corSpatial(object, distance, sig2, length.out, function(x, y) { pmin(x/y, 1) }) } ###*# corRatio - rational quadratic spatial correlation structure corRatio <- ## Constructor for the corRational class function(value = numeric(0), form = ~ 1, nugget = FALSE, metric = c("euclidean", "maximum", "manhattan"), fixed = FALSE) { attr(value, "formula") <- form attr(value, "nugget") <- nugget attr(value, "metric") <- match.arg(metric) attr(value, "fixed") <- fixed class(value) <- c("corRatio", "corSpatial", "corStruct") value } ###*# Methods for standard generics summary.corRatio <- function(object, structName = "Rational quadratic spatial correlation", ...) { summary.corStruct(object, structName) } Variogram.corRatio <- function(object, distance = NULL, sig2 = 1, length.out = 50, ...) { Variogram.corSpatial(object, distance, sig2, length.out, function(x, y) { x <- (x/y)^2 x/(1+x) }) } ###*# corSpher - spherical spatial correlation structure corSpher <- ## Constructor for the corSpher class function(value = numeric(0), form = ~ 1, nugget = FALSE, metric = c("euclidean", "maximum", "manhattan"), fixed = FALSE) { attr(value, "formula") <- form attr(value, "nugget") <- nugget attr(value, "metric") <- match.arg(metric) attr(value, "fixed") <- fixed class(value) <- c("corSpher", "corSpatial", "corStruct") value } ###*# Methods for standard generics coef.corSpher <- function(object, unconstrained = TRUE, ...) { val <- NextMethod() if (!unconstrained) val[1] <- val[1] + attr(object, "minD") val } Initialize.corSpher <- function(object, data, ...) { if (!is.null(attr(object, "minD"))) { #already initialized return(object) } object <- Initialize.corStruct(object, data) nug <- attr(object, "nugget") minD <- min(unlist(attr(object, "covariate"))) val <- as.vector(object) if (length(val) > 0) { # initialized if (val[1] <= 0) { stop("range must be > 0 in \"corSpher\" initial value") } if (val[1] <= minD) { warning("initial value for 'range' less than minimum distance. Setting it to 1.1 * min(distance)") val[1] <- 1.1 * minD } if (nug) { # with nugget effect if (length(val) == 1) { # assuming nugget effect not given val <- c(val, 0.1) # setting it to 0.1 } else { if (length(val) != 2) { stop("initial value for \"corSpher\" parameters of wrong dimension") } } if ((val[2] <= 0) || (val[2] >= 1)) { stop("initial value of nugget ratio must be between 0 and 1") } } else { # only range parameter if (length(val) != 1) { stop("initial value for \"corSpher\" parameters of wrong dimension") } } } else { val <- minD * 1.1 if (nug) val <- c(val, 0.1) } val[1] <- log(val[1] - minD) if (nug) val[2] <- log(val[2]/(1 - val[2])) oldAttr <- attributes(object) object <- val attributes(object) <- oldAttr attr(object, "minD") <- minD attr(object, "factor") <- corFactor(object) attr(object, "logDet") <- -attr(attr(object, "factor"), "logDet") object } summary.corSpher <- function(object, structName = "Spherical spatial correlation", ...) { summary.corStruct(object, structName) } Variogram.corSpher <- function(object, distance = NULL, sig2 = 1, length.out = 50, ...) { Variogram.corSpatial(object, distance, sig2, length.out, function(x, y) { x <- pmin(x/y, 1) 1.5 * x - 0.5 * x^3 }) } ####*# corWave - Wave spatial correlation structure #corWave <- # ## Constructor for the corWave class # function(value = numeric(0), form = ~ 1, nugget = FALSE, # metric = c("euclidean", "maximum", "manhattan")) #{ # attr(value, "formula") <- form # attr(value, "nugget") <- nugget # attr(value, "metric") <- match.arg(metric) # class(value) <- c("corWave", "corSpatial", "corStruct") # value #} ####*# Methods for standard generics #summary.corWave <- # function(object, structName = "Wave spatial correlation") #{ # summary.corStruct(object, structName) #} ##*## Beginning of epilogue ### This file is automatically placed in Outline minor mode. ### The file is structured as follows: ### Chapters: ^L # ### Sections: ##*## ### Subsections: ###*### ### Components: non-comment lines flushed left ### Random code beginning with a ####* comment ### Local variables: ### mode: outline-minor ### outline-regexp: "\^L\\|\\`#\\|##\\*\\|###\\*\\|[a-zA-Z]\\|\\\"[a-zA-Z]\\|####\\*" ### ess-indent-offset: 2 ### End: nlme/R/groupedData.R0000644000176200001440000006001513452715114013775 0ustar liggesusers### groupedData - data frame with a grouping structure ### ### Copyright 2006-2019 The R Core team ### Copyright 1997-2003 Jose C. Pinheiro, ### Douglas M. Bates # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # groupedData <- ## Constructor for the groupedData class. Takes a formula and a frame ## The formula must be of the form "response ~ primary | groups", ## "response ~ primary | groups1/groups2/.../groups_k", ## or "response ~ (primary1 | groups1) / ... / (primary|groups_k)" ## where groups_i evaluates to a factor in frame. function(formula, data = NULL, order.groups = TRUE, FUN = function(x) max(x, na.rm = TRUE), outer = NULL, inner = NULL, labels = NULL, units = NULL) { if (!(inherits(formula, "formula") && length(formula) == 3)) { stop("first argument to 'groupedData' must be a two-sided formula") } if (is.null(grpForm <- getGroupsFormula(formula, asList = TRUE))) { stop("right-hand side of first argument must be a conditional expression") } mCall <- match.call() mCall[[1]] <- if(length(grpForm) == 1)## nlme:: needed if 'nlme' not attached quote(nlme::nfGroupedData) else quote(nlme::nmGroupedData) eval(mCall, envir = parent.frame()) } nfGroupedData <- ## Constructor for the nfGroupedData class. Takes a formula and a frame ## The formula must be of the form "response ~ primary | groups" ## where groups evaluates to a factor in frame. function(formula, data = NULL, order.groups = TRUE, FUN = function(x) max(x, na.rm = TRUE), outer = NULL, inner = NULL, labels = NULL, units = NULL) { ## want to stop exporting undocumented(!) nmGroupedData() if(!local({ N <- -1L while(identical(sys.call(N)[[1]], quote(eval))) N <- N-1L identical(.sf <- sys.function(N), groupedData) || identical(environment(.sf), .ns) || identical(environment(sys.function(N-1L)), .ns) || identical(environment(sys.function(N-2L)), .ns) })) .Deprecated("groupedData", "nlme") if (!(inherits(formula, "formula") && length(formula) == 3)) { stop("first argument to 'nfGroupedData' must be a two-sided formula") } grpForm <- getGroupsFormula(formula, asList = TRUE) if (is.null(grpForm)) { stop("right-hand side of first argument must be a conditional expression") } if (length(grpForm) > 1) { stop("only one level of grouping allowed") } ## create a data frame in which formula, inner, and outer can be evaluated if (missing(data) || is.null(data)) { vnames <- all.vars(asOneFormula(formula, inner, outer)) alist <- lapply(as.list(vnames), as.name) names(alist) <- vnames data <- do.call('data.frame', alist) } else if (!inherits(data, "data.frame")) stop("second argument to 'groupedData' must inherit from data.frame") ## Although response and primary are not always used, they are ## evaluated here to verify that they can be evaluated. response <- getResponse(data, formula) primary <- getCovariate(data, formula) groupName <- names(grpForm) groups <- getGroups(data, formula) data[[groupName]] <- groups if (order.groups && !inherits(groups, "ordered")) { levs <- if (is.null(outer)) { names(sort(tapply(response, groups, FUN))) } else { ## split the data according to the 'outer' factors and ## obtain the order within each group outer <- asOneSidedFormula(outer) ## paste together all variables in outer with a character ## unlikely to be in a name combined <- do.call("paste", c(data[, all.vars(outer), drop = FALSE], sep='\007')) as.vector(unlist(lapply(split(data.frame(response = response, groups = groups), combined), function(obj, func) { names(sort(tapply(obj$response, obj$groups, func))) }, func = FUN))) } data[[groupName]] <- ordered(groups, levels = levs) } attr(data, "formula") <- formula attr(data, "labels") <- labels attr(data, "units") <- units attr(data, "outer") <- outer attr(data, "inner") <- inner attr( data, "FUN" ) <- FUN attr( data, "order.groups" ) <- order.groups cl <- if ((length(all.vars(getCovariateFormula(formula))) == 0) || (data.class(primary) != "numeric")) { "nffGroupedData" # primary covariate is a factor or a "1" } else { "nfnGroupedData" # primary covariate is numeric } class(data) <- unique(c(cl, "nfGroupedData", "groupedData", class(data))) data } nmGroupedData <- ## Constructor for the nmGroupedData class. Takes a formula and a frame ## The formula must be of the form ## "respose ~ primary | groups1/groups2/.../groups_k", ## where groups_i evaluates to a factor in frame. function(formula, data=NULL, order.groups = TRUE, FUN = function(x) max(x, na.rm = TRUE), outer = NULL, inner = NULL, labels = NULL, units = NULL) { ## want to stop exporting undocumented(!) nmGroupedData() if(!local({ N <- -1L while(identical(sys.call(N)[[1]], quote(eval))) N <- N-1L identical(.sf <- sys.function(N), groupedData) || identical(environment(.sf), .ns) || identical(environment(sys.function(N-1L)), .ns) || identical(environment(sys.function(N-2L)), .ns) })) .Deprecated("groupedData", "nlme") if (!(inherits(formula, "formula") && length(formula) == 3)) stop("first argument to 'nmGroupedData' must be a two-sided formula") grpForm <- getGroupsFormula(formula, asList = TRUE) if (is.null(grpForm)) stop("right-hand side of first argument must be a conditional expression") if (length(grpForm) == 1) stop("single group not supported -- use groupedData()") checkForList <- function(object, nams, expand = FALSE) { if (is.null(object)) return(object) if (is.list(object)) { if (is.null(names(object))) { names(object) <- nams[seq_along(object)] } } else if (expand) { object <- rep(list(object), length(nams)) names(object) <- nams } else { object <- list(object) names(object) <- nams[length(nams)] } object } grpNames <- names(grpForm) names(grpNames) <- grpNames ## ckecking if arguments are lists order.groups <- checkForList(order.groups, grpNames, TRUE) outer <- checkForList(outer, grpNames) inner <- checkForList(inner, grpNames) ## create a data frame in which formula, outer, and inner can be evaluated if (missing(data) || is.null(data)) { vnames <- all.vars(asOneFormula(formula, outer, inner)) alist <- lapply(as.list(vnames), as.name) names(alist) <- vnames data <- do.call('data.frame', alist) } else if (!inherits(data, "data.frame")) stop("second argument to 'groupedData' must inherit from data.frame") ## Although response and primary are not always used, they are ## evaluated here to verify that they can be evaluated. response <- getResponse(data, formula) primary <- getCovariate(data, formula) groups <- getGroups(data, formula) rm(response, primary, groups)# -NOTE(codetools) attr(data, "formula") <- formula attr(data, "formulaList") <- grpForm attr(data, "labels") <- labels attr(data, "units") <- units attr(data, "inner") <- inner attr(data, "outer") <- outer attr(data, "order.groups") <- order.groups attr(data, "FUN") <- FUN class(data) <- unique(c("nmGroupedData", "groupedData", class(data))) data } ###*# Methods for standard generics as.data.frame.groupedData <- function(x, row.names = NULL, optional = FALSE, ...) { attributes(x) <- attributes(x)[c("names", "row.names")] class(x) <- "data.frame" NextMethod() } collapse.groupedData <- function(object, collapseLevel = Q, displayLevel = collapseLevel, outer = NULL, inner = NULL, preserve = NULL, FUN = mean, subset = NULL, ...) { form <- formula(object) grpForm <- getGroupsFormula(form, asList = TRUE) grpNames <- names(grpForm) names(grpNames) <- grpNames Q <- length(grpForm) # number of levels if (Q == 1) { # no collapsing if (!missing(subset)) { warning("'subset' ignored with single grouping factor") } return(object) } groups <- getGroups(object, form, level = 1:Q) if (!is.null(subset)) { ## choosing some levels of grouping factors if (!is.list(subset)) { stop("'subset' must be a list") } if (!any(is.na(match(names(subset), 1:Q)))) { ## subset names given as integers names(subset) <- grpNames[names(subset)] } if (any(is.na(match(names(subset), grpNames)))) { stop("undefined group declared in 'subset'") } auxSubset <- rep(TRUE, dim(object)[1]) for(i in names(subset)) { auxSubset <- auxSubset & as.logical(match(groups[[i]], subset[[i]], 0)) } object <- object[auxSubset, , drop = FALSE] groups <- groups[auxSubset, , drop = FALSE] groups[] <- lapply(groups, function(x) x[drop = TRUE]) } if (length(displayLevel) != 1) { stop("only one display level allowed") } if (is.null(grpForm[[displayLevel]])) { stop(gettextf("undefined display level %s for %s", displayLevel, sQuote(substitute(object))), domain = NA) } attribs <- attributes(object) ord <- attribs[["order.groups"]][[displayLevel]] if (is.logical(outer)) { outer <- attribs[["outer"]][[displayLevel]] } if (is.logical(inner)) { inner <- attribs[["inner"]][[displayLevel]] } form[[3]][[3]] <- grpForm[[displayLevel]][[2]] args <- list(formula = form, order.groups = ord, FUN = attribs[["FUN"]], outer = outer, inner = inner, labels = attribs[["labels"]], units = attribs[["units"]]) dlevel <- if (is.character(displayLevel)) { # as the level name match(displayLevel, grpNames) } else { # as the level number displayLevel } if (dlevel < Q) { # may need to collapse object if (is.null(grpForm[[collapseLevel]])) { stop(gettextf("undefined collapsing level %s for %s", collapseLevel, sQuote(substitute(object))), domain = NA) } clevel <- if (is.character(collapseLevel)) { match(collapseLevel, grpNames) } else { collapseLevel } if (clevel < dlevel) { clevel <- dlevel warning("collapsing level cannot be smaller than display level; setting it to the display level") } if ((dlevel < clevel) || (clevel < Q)) { collapseGroups <- do.call("paste", c(lapply(groups[, 1:clevel, drop = FALSE ], as.character), sep = "\007")) if (dlevel < clevel) { # may need innerGroups object[[".collapseGroups"]] <- as.factor(collapseGroups) } if (!is.null(preserve)) { if (!(inherits(preserve, "formula") && length(preserve) == 2)) { stop("'preserve' must be a two-sided formula") } collapseGroups <- paste(collapseGroups, eval(preserve[[2]], object), sep = "\007") } collapseGroups <- paste(collapseGroups, getCovariate(object), sep = "\007") collapseGroups <- ordered(collapseGroups, levels = unique(as.character(collapseGroups))) if (length(levels(collapseGroups)) < dim(object)[1]) { ## collapsing the object object <- gsummary(object, groups = collapseGroups, FUN = FUN) row.names(object) <- 1:dim(object)[1] ## need to recalculate groups --- fix from JCP groups <- getGroups(object, grpForm, level = 1:Q) } } } object <- as.data.frame(object) if (dlevel == 1) { # no outer groups args[["data"]] <- object value <- do.call("nfGroupedData", args) } else { ## need to establish an appropriate ordering namesDgrp <- names(groups) for(i in 2:Q) { groups[, i] <- paste(as.character(groups[, i - 1]), as.character(groups[, i]), sep = "/") namesDgrp[i] <- paste(namesDgrp[i-1], namesDgrp[i], sep = "/") } displayGroups <- groups[, dlevel] isOrd <- unlist(lapply(groups, is.ordered))[1:dlevel] ordOrig <- unlist(attribs[["order.groups"]][1:dlevel]) & !isOrd if (any(ordOrig)) { groups[ordOrig] <- lapply(groups[ordOrig], function(el, y, func) { ordered(el, levels = names(sort(tapply(y, el, func)))) }, y = getResponse(object, form), func = attribs[["FUN"]]) } if (!is.null(outer)) { outFact <- do.call("paste", c(lapply(object[, all.vars(outer)], as.character), sep = "\007")) groups <- c(list(outFact), groups) } displayGroups <- ordered(displayGroups, levels = unique(as.character(displayGroups[do.call("order", groups)]))) form[[3]][[3]] <- quote(.groups) object[[".groups"]] <- displayGroups args[["formula"]] <- form args[["data"]] <- object value <- do.call("nfGroupedData", args) } if (match(".collapseGroups", names(object), 0)) { groups <- eval(form[[3]][[3]], value) rnams <- unlist(split(1:nrow(value), groups)) cGroups <- unlist(lapply(split(value[[".collapseGroups"]], groups), function(el) as.integer(el[drop = TRUE]))) value[[".collapseGroups"]] <- cGroups[order(rnams)] attr(value, "innerGroups") <- ~.collapseGroups } if (dlevel > 1 && !is.na(match(".groups", names(value)))) { attr(value[,".groups"], "label") <- namesDgrp[dlevel] } value } formula.groupedData <- function(x, ...) eval(attr(x, "formula")) plot.nfnGroupedData <- function(x, outer = NULL, inner = NULL, innerGroups = NULL, xlab = paste(attr(x, "labels")$x, attr(x, "units")$x), ylab = paste(attr(x, "labels")$y, attr(x, "units")$y), strip = function(...) strip.default(..., style = 1), aspect = "xy", panel = function(x, y, ...) { if (grid) panel.grid() panel.xyplot(x, y, ...) y.avg <- tapply(y, x, mean) # lines through average y y.avg <- y.avg[!is.na(y.avg)] if (length(y.avg) > 0) { xvals <- as.numeric(names(y.avg)) ord <- order(xvals) panel.xyplot(xvals[ord], y.avg[ord], type = "l") } }, key = TRUE, grid = TRUE, ...) { labels <- list(xlab = xlab, ylab = ylab) labels <- labels[lengths(labels) > 0] args <- c(list(attr(x, "formula"), data = x, strip = strip, aspect = aspect, panel = panel), labels) if (length(outer) > 0) { if (is.logical(outer) && outer) { # get the default outer formula outer <- attr(x, "outer") } args[[1]][[3]][[3]] <- asOneSidedFormula(outer)[[2]] if (length(innerGroups) == 0) { innerGroups <- getGroupsFormula(x) } } if ((length(innerGroups) > 0) && (length(inner) == 0)) { inner <- innerGroups innerGroups <- NULL } if (length(inner) > 0) { if (is.logical(inner) && inner) { # get the default inner formula inner <- attr(x, "inner") } args[["subscripts"]] <- TRUE trll.set <- trellis.par.get("superpose.line")[c("lty", "col")] if (length(innerGroups) == 0) { args[["groups"]] <- asOneSidedFormula(inner)[[2]] if (missing(inner)) { Inner <- NULL trll.lty <- trll.set[["lty"]][1] trll.col <- trll.set[["col"]][1] assign("trll.lty", trll.lty) assign("trll.col", trll.col) args[["panel"]] <- function(x, y, subscripts, groups, ...) { panel.grid() panel.xyplot(x, y, ...) panel.superpose(x, y, subscripts, groups, type = "l", col = trll.col, lty = trll.lty) } } else { Inner <- as.factor(eval(asOneSidedFormula(inner)[[2]], x)) levInn <- levels(Inner) args[["panel"]] <- function(x, y, subscripts, groups, ...) { panel.grid() panel.xyplot(x, y, ...) panel.superpose(x, y, subscripts, groups, type = "l") } } } else { #inner and innerGroups args[["groups"]] <- asOneSidedFormula(innerGroups)[[2]] Inner <- as.factor(eval(asOneSidedFormula(inner)[[2]], x)) levInn <- levels(Inner) Inner <- (as.integer(Inner) - 1) %% length(trll.set[["lty"]]) + 1 trll.lty <- trll.set[["lty"]][Inner] trll.col <- trll.set[["col"]][Inner] assign("trll.lty", trll.lty) assign("trll.col", trll.col) args[["panel"]] <- function(x, y, subscripts, groups, ...) { panel.grid() panel.xyplot(x, y, ...) aux <- match(unique(groups), groups) panel.superpose(x, y, subscripts, groups, type = "l", col = trll.col[aux], lty = trll.lty[aux]) } } } else { Inner <- NULL } if(is.logical(key)) { if(key && (!is.null(Inner) && (lInn <- length(levInn)) > 1)) { ## lInn <- min(c(lInn, length(trll.set[["lty"]]))) args[["key"]] <- list(lines = Rows(trellis.par.get("superpose.line"), 1:lInn), text = list(levels = levInn), columns = min(6, lInn)) } } else { args[["key"]] <- key } dots <- list(...) args[names(dots)] <- dots assign("grid", grid) do.call("xyplot", args) } plot.nffGroupedData <- function(x, outer = NULL, inner = NULL, innerGroups = NULL, xlab = paste(attr(x, "labels")$y, attr(x, "units")$y), ylab = groupLabel, strip = function(...) strip.default(..., style = 1), panel = function(x, y) { dot.line <- trellis.par.get("dot.line") panel.abline(h = y, lwd = dot.line$lwd, lty = dot.line$lty, col = dot.line$col) panel.dotplot(x, y) }, key = length(inner) > 0, grid, ...) { groupExpr <- c_deparse(getGroupsFormula(x)[[2]]) if (is.null(groupLabel <- attr(x[, groupExpr], "label"))) { groupLabel <- groupExpr } labels <- list(xlab = xlab, ylab = ylab) labels <- labels[lengths(labels) > 0] if (length(outer) > 0) { if (is.logical(outer) && outer) { # get the default outer formula form <- formula(paste(groupExpr, "~", deparse(getResponseFormula(x)[[2]]),"|", c_deparse(attr(x, "outer")[[2]]))) } else { form <- formula(paste(groupExpr, "~", deparse(getResponseFormula(x)[[2]]),"|", c_deparse(outer[[2]]))) } } else { form <- formula(paste(groupExpr, "~", deparse(getResponseFormula(x)[[2]]))) } args <- c(list(form, data = x, strip = strip, panel = panel), labels) if ((length(innerGroups) > 0) && (length(inner) == 0)) { inner <- innerGroups innerGroups <- NULL } if (length(inner) == 0) { covForm <- getCovariateFormula(x) if (length(all.vars(covForm)) > 0) {# non-trivial covariate inner <- covForm } } if (length(inner) > 0) { if (is.logical(inner) && inner) { # get the default inner formula inner <- attr(x, "inner") } args[["subscripts"]] <- TRUE args[["groups"]] <- asOneSidedFormula(inner)[[2]] args[["panel"]] <- function(x, y, subscripts, groups) { dot.line <- trellis.par.get("dot.line") panel.abline(h = y, lwd = dot.line$lwd, lty = dot.line$lty, col = dot.line$col) panel.superpose(x, y, subscripts, groups) } } if(is.logical(key) && key && (length(inner) > 0)) { Inner <- eval(inner[[2]], x) levInn <- levels(as.factor(Inner)) lInn <- length(levInn) ## lInn <- min(c(lInn, length(trellis.par.get("superpose.symbol")$pch))) args[["key"]] <- list(points = Rows(trellis.par.get("superpose.symbol"), 1:lInn), text = list(levels = levInn), columns = min(6, lInn)) } dots <- list(...) args[names(dots)] <- dots do.call("dotplot", args) } plot.nmGroupedData <- function(x, collapseLevel = Q, displayLevel = collapseLevel, outer = NULL, inner = NULL, preserve = NULL, FUN = mean, subset = NULL, key = TRUE, grid = TRUE, ...) { args <- list(outer = outer, inner = inner, key = key, grid = grid, ...) Q <- length(getGroupsFormula(x, asList = TRUE)) if (is.null(preserve) && collapseLevel < Q && !is.null(inner)) { preserve <- if(is.logical(inner)) attr(x, "inner")[[displayLevel]] else inner } x <- collapse(x, collapseLevel, displayLevel, outer, inner, preserve, FUN, subset) args[["innerGroups"]] <- attr(x, "innerGroups") args[["x"]] <- x do.call("plot", args) } print.groupedData <- function(x, ...) { cat("Grouped Data: ") if(identical(emptyenv(), environment(frm <- attr(x, "formula")))) environment(frm) <- globalenv()# for printing, as that will be suppressed print(frm, ...) print.data.frame(x, ...) } update.groupedData <- function(object, formula, data, order.groups, FUN, outer, inner, labels, units, ...) { args <- as.list( attributes( object ) ) args <- args[is.na(match(names(args), c("names", "row.names", "class", "formulaList")))] thisCall <- as.list(match.call())[-(1:2)] args[names(thisCall)] <- thisCall if (is.null(args[["data"]])) args[["data"]] <- as.data.frame(object) do.call("groupedData", args) } "[.groupedData" <- function(x, i, j, drop = if (missing(i)) TRUE else length(cols) == 1) { oAttr <- attributes(x) x <- as.data.frame(x) data <- NextMethod() if (!inherits(data, "data.frame")) return(data) allV <- all.vars(asOneFormula(oAttr[["formula"]], oAttr[["inner"]], oAttr[["outer"]])) ## check if any columns used in formulas were deleted if( any( is.na( match( allV, names(data) ) ) ) ) { # return data frame cols <- ncol(data) return( data[, seq(length=ncol(data)), drop = drop] ) } args <- as.list(oAttr) args <- args[ is.na( match( names( args ), c( "names", "row.names" ) ) ) ] if (nrow(x) == nrow(data)) { # only columns deleted attributes(data) <- c( attributes( data ), args ) return( data ) } ## pruning the levels of factors whichFact <- unlist(lapply(data, is.factor)) data[whichFact] <- lapply(data[whichFact], function(x) x[drop = TRUE]) args <- c(args[!is.na(match(names( args ), c("formula", "order.groups", "FUN", "outer", "inner", "labels", "units")))], list(data = data)) do.call("groupedData", args) } isBalanced.groupedData <- function(object, countOnly = FALSE, level) { if (missing(level)) { level <- length(getGroupsFormula(object, asList = TRUE)) } if ( countOnly ) { return( length( unique( table( getGroups(object, level = level) ) ) ) == 1 ) } length(unique(table(getCovariate(object), getGroups(object, level = level)))) == 1 } asTable.groupedData <- function(object) { if (length(getGroupsFormula(object, asList = TRUE)) > 1) { stop("'asTable' cannot be used with multilevel grouped data") } tab <- table( getGroups(object), getCovariate(object) ) if (1 != length(unique(tab))) stop("'asTable' can only be used with balanced 'groupedData' objects") tab[] <- getResponse(object)[order(getCovariate(object),getGroups(object))] tab } balancedGrouped <- function(form, data, labels = NULL, units = NULL) { form <- as.formula( form ) data <- t( as.matrix( data ) ) dn <- dimnames( data ) if ( all( !is.na( as.numeric( dn[[1]] ) ) ) ) { dn[[1]] <- as.numeric( dn[[1]] ) } names(dn) <- c( as.character(getCovariateFormula(form)[[2]]), as.character(getGroupsFormula (form)[[2]]) ) df <- do.call("expand.grid", dn) df[[ as.character(getResponseFormula(form)[[2]]) ]] <- as.vector(data) groupedData(form, data = df, labels = labels, units = units) } nlme/MD50000644000176200001440000005367313616760516011546 0ustar liggesusers05660282501071786e39977a5a8a7cb9 *ChangeLog 9f328b6b2c4570c77cafe74b222ca995 *DESCRIPTION c843826752e9f806f255d79801354abb *INDEX 967bf0c65e5a3f8c94efb6186482ade1 *LICENCE 607f47e45ab4c7e76698254e83a98e49 *NAMESPACE 8b9aa0ea177ecc993f14e231e4050278 *R/VarCorr.R 8c0101fd47a2547f20a599d587bde056 *R/VarCov.R 248075dab1cb965a95060e4d44db57e0 *R/corStruct.R a353d52ec0ce409dddbb3e50a0d71203 *R/gls.R 1402efef698293edd2ae18f7952b31c8 *R/gnls.R b2806e11d7a086275cc59375c6cdc652 *R/groupedData.R 3ea7d49b954c7fee74b415b2f2485217 *R/lmList.R bcbcf9335ab35f60fa3cb250868cab69 *R/lme.R cf9c471ec0e6f401d7deab5cd1bce8ca *R/modelStruct.R 92dd677fedaaca2db84a765bf26b4470 *R/newFunc.R 1548e7a2392e75a6ee7e676ee1e2495d *R/newGenerics.R c4ad4ab2cb8eb78a7275be11636a6e22 *R/newMethods.R 72477cfbe437592a8fb0faa0345eff70 *R/nlme.R dd9e751f505d41ba8d5f809c94490a19 *R/nlsList.R 6c6ee19cd77bc8ae0b129a4fadf8d475 *R/pdMat.R 11a4297e3947d4c3e8532912e8e174ef *R/reStruct.R ffb63c70a819305b7662d9a2246f5b25 *R/simulate.R 3607b3a7ddf941d5d6fc8eb2c561ed26 *R/varFunc.R 5b774147c3cb5e0549642ac34e0834bb *R/zzMethods.R 1b861e2fac2ad8b7cfde1dafa9722618 *README 4e6044fc68ab0aaff2750b36b9a37f73 *TODO d8b91a44c9fbb9828a8cc1fe3cb201d1 *data/Alfalfa.rda 0cebab50c42059b1a6b161dd00bde634 *data/Assay.rda 19802c4ae129f3e4ef9c575ef0449874 *data/BodyWeight.rda ebb62d37bf9ede8b40371f18bc91fb41 *data/Cefamandole.rda cd8a2cdf69f31d0f7200d1912d708b43 *data/Dialyzer.rda eda08fc5b37ae4b410382bae2d9967c3 *data/Earthquake.rda 1342b546ad16abf5b95a5958cf0ede27 *data/Fatigue.rda 37f93290d02043dc948c83a87f7a83bd *data/Gasoline.rda 8cd40df34c95609d14c6901df03888c7 *data/Glucose.rda 2f3be907e28485b3982f694223eb3a19 *data/Glucose2.rda 122872658d325e0ac678d23e917f29c8 *data/Gun.rda dc03d469a75fb588b754642c8b54b843 *data/IGF.rda e9876683bbf273f9a9002818aaa004fa *data/Machines.rda 5d51b134d8f008f64c140a3ede3f3b9a *data/MathAchSchool.rda 89b761694ce7a4dd326ebe4efcf4d805 *data/MathAchieve.rda f55fdd31a8b0fd7a9bb43dc6e1dc35fe *data/Meat.rda 08ff6567ef659424640baae6ce6e439e *data/Milk.rda 03e370bdd2e289f58a2ef9f85ae0bf19 *data/Muscle.rda 64fcece2f3116b2e95249b2f79261d33 *data/Nitrendipene.rda 748d23e02025b8bf784c0e46debf254c *data/Oats.rda fca806477a7dbab4372d2fea6df19127 *data/Orthodont.rda 49d4546123ff5982fcf1eee89587e307 *data/Ovary.rda 3976c45bfb6bffa0530b43e421ad534a *data/Oxboys.rda 1565fb60a2bc375713901d569a2cb0fc *data/Oxide.rda a14365c37b5b35db2b62b7599b881b4e *data/PBG.rda 6c8aec7413fbac4343d5a8598a3dedba *data/Phenobarb.rda 7da020dbc1442bf906072519ad50bd63 *data/Pixel.rda 006378c64e201c429d7fed456e50ed1d *data/Quinidine.rda 46807c4099d2465d5bab8396f9ef5bb3 *data/Rail.rda 2e299f642a235f57affb29e302a0d8dc *data/RatPupWeight.rda 3b7226e6084208aa4f13c2590e87948e *data/Relaxin.rda 0a1be7f3f3b3a55456fb72a58d51d6e8 *data/Remifentanil.rda bdd3566e71e52494e17901751b0a2a66 *data/Soybean.rda fc4ef95aa585c50d29836e3a507994bb *data/Spruce.rda 6702b196b86b6694df871c4051270acb *data/Tetracycline1.rda 908d85386a9a9bb3f792459975bbb6e9 *data/Tetracycline2.rda 43317811df2624f5b39f8e2e3ec66266 *data/Wafer.rda c9d743988efcd0298fcea74c5cefbbc1 *data/Wheat.rda 099e8ca46b44fdce968017d87e62f483 *data/Wheat2.rda c63954815410357a4fcd9734efe6407e *data/bdf.rda c03b27e86567c9520eb0ced4e24bb21d *data/ergoStool.rda 6889c492a36cc34aeaab486f9eae0a64 *inst/CITATION 64501fa44a098a7b4c9148de789bacf4 *inst/mlbook/README fd6efb34026508f27de122da7d5e712f *inst/mlbook/ch04.R 9404575eddb8ed2cbb53d645df35210a *inst/mlbook/ch05.R a7c8c7cbb7f8d3931b0127f55710c0be *inst/po/de/LC_MESSAGES/R-nlme.mo a1a3739e6f4580e00f6919c2cfca1d9d *inst/po/de/LC_MESSAGES/nlme.mo fa535d0143126508f04d3f31f3a3f88b *inst/po/en@quot/LC_MESSAGES/R-nlme.mo 679e1e5106e15db6efa75aae1871a7d5 *inst/po/en@quot/LC_MESSAGES/nlme.mo c8e02fc6001e05fa5584dc4dc1a4a93b *inst/po/fr/LC_MESSAGES/R-nlme.mo 80b67fa4b82fa9b92c4114a4200af93e *inst/po/fr/LC_MESSAGES/nlme.mo 65303396694b56176b022f1d2292db87 *inst/po/ko/LC_MESSAGES/R-nlme.mo 6173938fa7a754ea9d3b5467ac77b9e3 *inst/po/ko/LC_MESSAGES/nlme.mo 2db68181a034df30abeb6ba43b6ab2f4 *inst/po/pl/LC_MESSAGES/R-nlme.mo 30d56ddff59206941c16b10c97d2246f *inst/po/pl/LC_MESSAGES/nlme.mo f02c696cb69155b4987e6dff6d647301 *inst/scripts/ch01.R 5b45a67a04532ea4dcfb67359b8a0ab3 *inst/scripts/ch02.R 4f12d15878c8172c8658f1710c2ace5d *inst/scripts/ch03.R 0cca613aaac67436dd0adbec76583664 *inst/scripts/ch04.R 5a64ff3a7bb91ed2fb53c3f2a6e52ebb *inst/scripts/ch05.R b90a4af099109e02723b7710d2b505ea *inst/scripts/ch06.R b0b068d9d809466de50d76f11ce62ae1 *inst/scripts/ch08.R 43465378a1cfc040ef2798c9f9096f1a *inst/scripts/runme.R aa549206ac4749200a23760b13d742c8 *inst/scripts/sims.rda 16768d535d6820115742dcdf76fb1220 *man/ACF.Rd 6e762e25a29d49c66cb9f86386d3b7c8 *man/ACF.gls.Rd 018003b645a6a5b3e23cf6a2f408db58 *man/ACF.lme.Rd 57595346850b70559bd5f5a00af2f3d1 *man/Alfalfa.Rd 1bb3b6a1b472e0ba2c26720a3045601a *man/Assay.Rd 8f75d99043adb16c01650f2840be13c1 *man/BodyWeight.Rd cefccd213c87d53359b03a2bf7bea088 *man/Cefamandole.Rd 65af0f9acd4abef86d2cc0e18eb296f6 *man/Coef.Rd 767924880a39f5f42e17d5ab419d9d85 *man/Covariate.Rd 951b571773a1a0893ab8a45aa3c1ae73 *man/Covariate.varFunc.Rd a5e5047ed3e37c8114000349a0f4d402 *man/Dialyzer.Rd f7ef6f8718e6ca97d76c748b013c4c47 *man/Dim.Rd 7836c68f3dc446bddb4f2b7aa138872b *man/Dim.corSpatial.Rd 3edd657be50778bc21b97dbadae5eaa0 *man/Dim.corStruct.Rd f50e4d8be6375408fafa6900f475de7c *man/Dim.pdMat.Rd 72833569dbae9d92e7279d3bbc75cfdd *man/Earthquake.Rd 9c53be2ff65213c90256f7779d51fa55 *man/Extract.pdMat.Rd f08b06991edf2d9d088c0d0e74f3c12b *man/Fatigue.Rd d15d0820b97a1d3747d3d810edc4499b *man/Gasoline.Rd bc795b9a76a4d9f551b2232bec78f407 *man/Glucose.Rd 63a86784e7b69c12a783f11a494a7543 *man/Glucose2.Rd cd7c839372f3ce09142c32d26dbb7378 *man/Gun.Rd 546284bab7b2c8451b6a45aaed224025 *man/IGF.Rd 8e6233660791f22bde909abc8c6adb85 *man/Initialize.Rd 406454f5d85d2d658a4ac4cb6822ff05 *man/Initialize.corStruct.Rd e27e73db4fd3b6818e2a48ef04582e45 *man/Initialize.glsStruct.Rd bd7073bcbe4875e08704cd79bc2b6be7 *man/Initialize.lmeStruct.Rd bdee483d50bf6e5ab30526af62e42516 *man/Initialize.reStruct.Rd 6fcdb2fc0d882a285d12ec209675f4fb *man/Initialize.varFunc.Rd f1ed61540b8f100beb20b7b546c35033 *man/LDEsysMat.Rd 3cb4792ead6504d766d2715f90c472ee *man/Machines.Rd e4025869be76a7a91f5ee6009c0a191d *man/MathAchSchool.Rd c2975c5117961c5844804db3043dc911 *man/MathAchieve.Rd 20941081181ec027f357c7eabcda56fd *man/Matrix.Rd 10bf2d3b61d0feb71c2def9f1c50c575 *man/Matrix.pdMat.Rd ce9280e1b047c882d6ff47d21f778535 *man/Matrix.reStruct.Rd bef94237086085fa8b74ffced33357e8 *man/Meat.Rd 20f4197fb4b7d4a1c8aae881130ee350 *man/Milk.Rd db929172c8ac73f4f3374e1bfa7939fa *man/Muscle.Rd 30ea5662dbcd86bf8f6724cb6efcd313 *man/Names.Rd 8eb7a6cf9302bbcbaec81cfddda978a6 *man/Names.formula.Rd a70a87adca3942d9debcc3324ccee584 *man/Names.pdBlocked.Rd 0b55d575aa734b38fe35acb3ecc46d59 *man/Names.pdMat.Rd 2a525ef4329e34792448108773a58c95 *man/Names.reStruct.Rd efd66bcf15f4e05fca9394e98b8b22f5 *man/Nitrendipene.Rd ec3c2af6fc7d7e9906a5c0d88691d9e0 *man/Oats.Rd b6ff3a9f4f7c9364dd5427ed44e78850 *man/Orthodont.Rd 596839fecefde28fd31df15bc2443111 *man/Ovary.Rd 14d46f9380f9bf16bcd3da2ed1414618 *man/Oxboys.Rd 4830173e57672328a5d0c60b5b4b2ef0 *man/Oxide.Rd d62d8d5c2c0643b47ade54dc0c12d036 *man/PBG.Rd e28be754a322c6c1fc993a93ad921e99 *man/Phenobarb.Rd 8412274b3c55c6f85eb07a696173a62a *man/Pixel.Rd 75ae1d74f665bdd9b2a46025947cb604 *man/Quinidine.Rd 989b9a8b115d3f44e60c0e0d7bce44d3 *man/Rail.Rd 24e778152c340144b44e5f07cae17ba1 *man/RatPupWeight.Rd 1ad997fd585e41017b58c925d417880d *man/Relaxin.Rd d844f58fda4c3ccaf533a92c88821e06 *man/Remifentanil.Rd bf2c7d731d4422ee67bf86e134ce8ab2 *man/Soybean.Rd 3dc4e57e32facf457b1608fe6a615d7c *man/Spruce.Rd 9daa6d475775413dd4ea64c99cfe17d1 *man/Tetracycline1.Rd e5180117cd260b6b0f55334d1fbfed27 *man/Tetracycline2.Rd af8bcaa378f06bef9ac6436d6169e157 *man/VarCorr.Rd a300486a27b1002fdce1a9694b5dd09a *man/Variogram.Rd 29751263c30392b4e2beb5369bc55165 *man/Variogram.corExp.Rd 0835aada9e25aff1495636cf044a641e *man/Variogram.corGaus.Rd d2a1838f7649189356c1699974a0a064 *man/Variogram.corLin.Rd 0ab3b3222151278bf8b2c5d8d0580517 *man/Variogram.corRatio.Rd 4870feebe7b61f4a5d3bbddb0d6786ee *man/Variogram.corSpatial.Rd 46a38f7ec456eb0160d745b44e8e219f *man/Variogram.corSpher.Rd ab07461ee46862da384efec55f6ca907 *man/Variogram.default.Rd 328af0c785dec73aaa77b5bd1aca454b *man/Variogram.gls.Rd 660159573e2d3e1ec8a2cbcaf7d92d49 *man/Variogram.lme.Rd f0037b641609bbeb2e1cd6ee9ac35468 *man/Wafer.Rd 68ac1efa524cb04bf1b5d3aedf83096c *man/Wheat.Rd 6f1948aad833c32faecbc33dbe5797d9 *man/Wheat2.Rd be24f3ff3dd6be6e8a540aec4c11c353 *man/allCoef.Rd 68e691cc064c25bcd929a3f0cac6e6ab *man/anova.gls.Rd 8e0656b4d5fb2aba932cb39077ff7261 *man/anova.lme.Rd 898315fc8ee0502e8c2f19700868a941 *man/as.matrix.corStruct.Rd 222b482c4d6d320c4ff69edddb1c7a4d *man/as.matrix.pdMat.Rd e6a8d1d9d5080d284a853b032c354d7e *man/as.matrix.reStruct.Rd b015ee9aaf0f2b1b7ace91f735793f05 *man/asOneFormula.Rd e9bdab76d54c944a5aaa097f445491f0 *man/asTable.Rd 7025b427cda87d435e2b3b5ddda93b8b *man/augPred.Rd 4d05a8e7243f763e96c185a727d7ad12 *man/balancedGrouped.Rd 228f899cc07e48e2d436e4ce709ed696 *man/bdf.Rd 0756d50620eee16952d7f7363f44986e *man/coef.corStruct.Rd d650aace7475c64096f490cdff42f9d7 *man/coef.gnls.Rd ad26050059ff7432708d14c90a5d3a11 *man/coef.lmList.Rd 2cf5a03f045515cc92dae3ecebaf2c9a *man/coef.lme.Rd a718222d2e3c6ee50b3622380f74cd40 *man/coef.modelStruct.Rd e5223021d4ef963c2e0e0bd8b2b56ebb *man/coef.pdMat.Rd 91c195e9bde7d811621ece32da2258d2 *man/coef.reStruct.Rd aceb407ac91f2d97c9dc9b274b636506 *man/coef.varFunc.Rd bf2d3cfeba6f7b2dbbb38da5dee13bff *man/collapse.Rd ec094086453f639ea164835f33d1236b *man/collapse.groupedData.Rd 27e55b7b9a68f8075ca26a74c270e51b *man/compareFits.Rd 6ac3888e9938d2e2bfdb0cb0729783ce *man/comparePred.Rd 943e7d48ad8dfb6b65a006523ffc3d62 *man/corAR1.Rd fbab72fda7d2f6891eea06a679ce6251 *man/corARMA.Rd 3f85c73a45692372ec4ba7916d2e5a0d *man/corCAR1.Rd 724f50c66ea7a7cc213e0393f69517b5 *man/corClasses.Rd 7b8413fc94c6fc41bb481ff0c1bbbbb8 *man/corCompSymm.Rd 0a3760bb126319c8226e16b009176148 *man/corExp.Rd 236a68a050c7d6d1bfbbe09b14454973 *man/corFactor.Rd efca5eb37b3b604dcdd820904332300b *man/corFactor.corStruct.Rd dc8b5bf3670668171ff4e49c4d8c9030 *man/corGaus.Rd 820976dd9400db2c92be65b2a7ae235e *man/corLin.Rd dc6bfd8289f83c6fbe61a499bc237e72 *man/corMatrix.Rd 2e6d320c728220cb98a8325a678aac7d *man/corMatrix.corStruct.Rd fbc3933ddfd96f130d5a385d4ca21b53 *man/corMatrix.pdMat.Rd db07e76194a00cf63b58d2e0aca8b4b3 *man/corMatrix.reStruct.Rd aba6924356ba79ac88c7500baf8939ba *man/corNatural.Rd 17f1dedd9c18629e489cec264f970d34 *man/corRatio.Rd d06030a80389318a197a400d95c84bac *man/corSpatial.Rd edf4f1aafae697c815c742262d539f6f *man/corSpher.Rd 2f9a8eff49e2548469744b1d6e8fde90 *man/corSymm.Rd f348ba7472c8fb3cd380fe2cbc8fa1a5 *man/ergoStool.Rd 84135028fead36c10d62e35c7ce48054 *man/fdHess.Rd 994834a9db29d4b84be42ee55d0a4d74 *man/fitted.glsStruct.Rd 73f329bdd6e26ec82028104be3cde970 *man/fitted.gnlsStruct.Rd 8a9a06c1084d5cffd9ff10735252ecca *man/fitted.lmList.Rd 55dec363e1a39915184fea67b745cddc *man/fitted.lme.Rd f1d54fd06f9de3382de88bad5d47b10e *man/fitted.lmeStruct.Rd a4b79221d0b90322544a15d84aefb75f *man/fitted.nlmeStruct.Rd 94f7039ec932dcd036e8b6924354d0cf *man/fixed.effects.Rd 3e9ef2ee368779aa90a35136c674b3b8 *man/fixef.lmList.Rd 0974baa3e8400d76bf7974e37b86a468 *man/formula.pdBlocked.Rd eed5eb9e329e535f354053b649e207fc *man/formula.pdMat.Rd 2ab672b508e55ae44c9804866b847693 *man/formula.reStruct.Rd 99b53109238f2bba2365191a68a0a251 *man/gapply.Rd 3b068e87cbbfd17bc1fa56cd11690655 *man/getCovariate.Rd cdf24b9b17c9a4057970ee1d9d4177a3 *man/getCovariate.corStruct.Rd d6c724bdb3eacb6c69918bc22d4e2f53 *man/getCovariate.data.frame.Rd 16df689674c1a6cc5319319f921fde1d *man/getCovariate.varFunc.Rd 15905e7cf3055484b47074b989f4cdfd *man/getCovariateFormula.Rd 56ff35f77389d33e7dfabdf2fedcbb89 *man/getData.Rd 52ab521c89457facdcd1f4a9c5b4fbdf *man/getData.gls.Rd eb7a4684eec0276b70799634c73244b5 *man/getData.lmList.Rd 023488fea394ab866533696a4044fbce *man/getData.lme.Rd 552cd8e49db6fb3ac3b23c6bd2992110 *man/getGroups.Rd b0b5a891e5c29d60d19e3086ffdc848e *man/getGroups.corStruct.Rd d20850fd0b7480e603e3e77dcf62e49a *man/getGroups.data.frame.Rd 8335ab3aeec4334ec484d9430be62880 *man/getGroups.gls.Rd f0b677e111638c8d4ccd1ba758457428 *man/getGroups.lmList.Rd 6763cd670d69b0e34d00d96f9a73f0c4 *man/getGroups.lme.Rd fd60d299d1edf68fdbd0f899f3b1b0c6 *man/getGroups.varFunc.Rd 51173e8db654743b984c8103af884881 *man/getGroupsFormula.Rd 84c5ef05614935f913194ef5ac00c207 *man/getResponse.Rd 8fa7e2679c0096450808e7c1c605a037 *man/getResponseFormula.Rd e3616435bf781053aa48d2be2215848e *man/getVarCov.Rd 779f3dafb2559309735105ff42bb20f2 *man/gls-internal.Rd 6f56c20d173a1f99128799c5eda51873 *man/gls.Rd 894b9f25d95fb9ba2bf72d086dadf55a *man/glsControl.Rd 9be5f59bf435cb1195eca8ae070e55ab *man/glsObject.Rd c1de1feec9dc68a271924825dbe6f120 *man/glsStruct.Rd 35a9eacfe11252e14f8069e9b2aa4aab *man/gnls.Rd 33200ad68becd5ad48b3d5a4b2e4a561 *man/gnlsControl.Rd de0bab60a828bc33daf22632c07a4f62 *man/gnlsObject.Rd 37dab43440c017afb0748d7c8cbb13a6 *man/gnlsStruct.Rd d58811ebaed2a6e698d8410b4934b23e *man/groupedData.Rd 5bc6d697f93fc948f018d522bb3242aa *man/gsummary.Rd 532206cd06c3bb54b4dd6cfb560c3cb9 *man/intervals.Rd b504c0caec70350f786789738c0aa067 *man/intervals.gls.Rd 1ca1dbb5d3b65228a92724ebf6078175 *man/intervals.lmList.Rd 4c1bba95f26810ab7bc1e0008c02ef4a *man/intervals.lme.Rd a3a54a6f6ea3258ed61dbcb9caabb538 *man/isBalanced.Rd b399ad8ac30ebae148c2750863b9577b *man/isInitialized.Rd 025532bab39666ecef7c05831187c5dd *man/lmList.Rd 02334662a6ca3e5f2925fabd137a79b6 *man/lmList.groupedData.Rd 554887de55b509c343307be35f608706 *man/lme.Rd 3c9fa6a9877052e389ffda741e2ba4d2 *man/lme.groupedData.Rd 72faf3c9623f1ea10d1aaf08036a2cc9 *man/lme.lmList.Rd fe7057cd4ca113498b2948a0af9dc16f *man/lmeControl.Rd 59a05aaf12cb202e3d22d16956de55ca *man/lmeObject.Rd 13dc0abcf5cefea56089b4e02e627b4d *man/lmeStruct.Rd 0a183f1abced3b6e2e27fac21706dfff *man/logDet.Rd ead2832df5ec5e188e6b4ca16f4428a2 *man/logDet.corStruct.Rd 1aabffa0c11b521d5030dffd4ff13d8c *man/logDet.pdMat.Rd dd735008904c20627fafef5b7c6f03b6 *man/logDet.reStruct.Rd 1592be45d8ea775516fed6cfb45b3153 *man/logLik.corStruct.Rd fb931127a66a884ece9340b1ec229c40 *man/logLik.glsStruct.Rd eb27e04e3e0bc7f14bf1a55d987c5ed3 *man/logLik.gnls.Rd 899beba3839e32c4471ef5049cc9834a *man/logLik.gnlsStruct.Rd db65ecf96fe3e65efc9becacb342629a *man/logLik.lmList.Rd a4972d609644acfcf8001d8b92bab966 *man/logLik.lme.Rd 5d3d7473099fd000decbb974dcb8bca4 *man/logLik.lmeStruct.Rd 3230bcef111d815fc75bcd2b3205e0b1 *man/logLik.reStruct.Rd f3b113b8aedae437708a7fcd167d3d73 *man/logLik.varFunc.Rd 4751793249ec770d44339a9561866ab6 *man/model.matrix.reStruct.Rd 60a29b3fd8b1e118e73473e1db207c42 *man/needUpdate.Rd 3e05ee655b352dbb2f67cdc09fa80ed3 *man/needUpdate.modelStruct.Rd 076f54ae79a2d6d5ec1a65858f44329e *man/nlme.Rd 63489a1c7a0630b41241c2ea6fdfe2f6 *man/nlme.nlsList.Rd f174be2af10e42c460d1483bea572edc *man/nlmeControl.Rd e829fde20237430d7eb7a11e0ce19305 *man/nlmeObject.Rd dd1fd42b2801e78eb9ba1fa11326ebe5 *man/nlmeStruct.Rd 11d97a8fa6659a3fba7b261e0c93020c *man/nlsList.Rd ab97cb56b51d58e9905c8e6ee47da4b7 *man/nlsList.selfStart.Rd 50ca37e37aef59eee15384b1f06aac24 *man/pairs.compareFits.Rd 530dc14d9df00efe7bff45130f72ab23 *man/pairs.lmList.Rd c0670edf0bd0ebfc017815944cedb933 *man/pairs.lme.Rd a2f66466b56f892f9585627f17ff229e *man/pdBlocked.Rd f3eec1388b8f9b20f38bfba98f5fab35 *man/pdClasses.Rd 95ccd57919b210b67eb49d111c80b702 *man/pdCompSymm.Rd 4e7b194bc65fbb63bf97429560ec849b *man/pdConstruct.Rd 343c300545edb4cb6b02bfa8032bc00b *man/pdConstruct.pdBlocked.Rd 16467eb2592cd9c3f427d055846f2b13 *man/pdDiag.Rd f9f9c13acf74dfea291e23c7c63c9983 *man/pdFactor.Rd 7dae36911817b4ce144eee042f50eb27 *man/pdFactor.reStruct.Rd 7799a8aafc9e4d25878beec1d08c9a50 *man/pdIdent.Rd 29fd73d168d9dcc80413d0f1a3988388 *man/pdLogChol.Rd a5d8a5b1c90dec35c67ecc5a1906e3f7 *man/pdMat.Rd e6bd54c4f5a59912f5aa8957fe2c831d *man/pdMatrix.Rd b84f89573def38056f3010d3d1a87dcf *man/pdMatrix.reStruct.Rd 5f06972eb22dfccd71057d67654f4eed *man/pdNatural.Rd 4a2e34fa8aed0c6d04be6269d15b24a8 *man/pdSymm.Rd 93a351b884476ef521c536902dda5947 *man/phenoModel.Rd fd88eb1e4fba6ffc184edbfe22420429 *man/plot.ACF.Rd 843a344393023289e6ba3d1c8329d633 *man/plot.Variogram.Rd 9cd50f9940c69b776bdc7ddfd84f2d92 *man/plot.augPred.Rd bb05371770bf4eda1295c4489bd7c2ec *man/plot.compareFits.Rd a89ab48cbf0c9c0822c3d386b3d7fd0b *man/plot.gls.Rd 18879d8d0bbc2523d2d420c21b88c755 *man/plot.intervals.lmList.Rd fc1d4dbb94d6b7227274f9a933a1a00c *man/plot.lmList.Rd e151f47f4eb2ac3af6fc8c020d21872a *man/plot.lme.Rd d025250c6943c2893e8898b5e85a8acb *man/plot.nffGroupedData.Rd 4c8238af9e34bd3257e9b0e70615dc40 *man/plot.nfnGroupedData.Rd 3a9c7c37b33b52f13d85724811daeb55 *man/plot.nmGroupedData.Rd a2eac5a8f41f9ae32eab5f422a7cc2dc *man/plot.ranef.lmList.Rd 5d229899c83a4c4fe3b68dbad8113c13 *man/plot.ranef.lme.Rd 5be17470ec36c0536de12f30eb3fcc01 *man/pooledSD.Rd 6d2e3289690dc40de6ca67a2a5169e27 *man/predict.gls.Rd 8e02e0690941f9618bcfd6987a7cd14e *man/predict.gnls.Rd b8bf3369965838b2dde2f82e6d8b9ba8 *man/predict.lmList.Rd c92a132e95e76496e7169d1c98b2f82a *man/predict.lme.Rd b0430fc0ce2ee0eb46da8bbc9e6ea466 *man/predict.nlme.Rd a24baf9d274faf0ee6a0b812bf0c67c3 *man/print.summary.pdMat.Rd 02e3f9d9a12c6c9d56ff14a247451f90 *man/print.varFunc.Rd 972006af5df348873567b608f8d77689 *man/qqnorm.gls.Rd 9917d10489f1027e4cedc2cabd2d9cf6 *man/qqnorm.lme.Rd 2964cb136bfd01e04e013c4fa93ef6cd *man/quinModel.Rd 04f98816fa09bf9b31c2e616fe258f12 *man/random.effects.Rd a29f4b3be852c55acdfc15b09c3ffca4 *man/ranef.lmList.Rd 3c1cfac382e04a0147e047c27ac32696 *man/ranef.lme.Rd ed75dae79409e98c064649641f82d875 *man/reStruct.Rd 30311327dee2255284dcaf920e7ec687 *man/recalc.Rd 4681091f21d53d0fba1afe8e620ad2c3 *man/recalc.corStruct.Rd c2bee8f3f6936f91cf4c9e14ff584f55 *man/recalc.modelStruct.Rd 4fa814469f33501c7c03deded49bbf53 *man/recalc.reStruct.Rd 317a99b8dd4d9d3f8bfc99fcb8986070 *man/recalc.varFunc.Rd f31a50fe948fbbf6f5ef16a49b498232 *man/residuals.gls.Rd 00520c2db40f534412eba33b691f6571 *man/residuals.glsStruct.Rd 60647b5fef599cc688ac18b1a10abbbf *man/residuals.gnlsStruct.Rd bddd6554150a0fb58d9a3f6292e6e161 *man/residuals.lmList.Rd b87b469b48e1d1e3f61d2facbd0b973d *man/residuals.lme.Rd 99f2c846413a4e4efa115bef0dd57ebf *man/residuals.lmeStruct.Rd deb3a9c9c02c7828e4d02f9ae970fca5 *man/residuals.nlmeStruct.Rd ffd9b0cd8e275cc7acaadacc520f96a2 *man/simulate.lme.Rd 9d3eb773650975aa8a91058bb091ac67 *man/solve.pdMat.Rd 23fc485c76bac59b5697957ba1c46b1f *man/solve.reStruct.Rd 2d335ff87e586bddd602dec64bedf103 *man/splitFormula.Rd 30b751285525b491459043db8949309e *man/summary.corStruct.Rd e2677fd6b951febd9b689bac8bacc5cb *man/summary.gls.Rd 6780ee835f6865026f484dfe3880de0b *man/summary.lmList.Rd c71e9718c0db94d80178e3949ed605e2 *man/summary.lme.Rd 6c686321938f6e4808b6efd371af7829 *man/summary.modelStruct.Rd 77742610400af09eb172489893c8003d *man/summary.nlsList.Rd f36698a423ebeefc8ab08a40c82488e4 *man/summary.pdMat.Rd dc38904f1e4952f38d9181c01be8e607 *man/summary.varFunc.Rd 500c2e217a6f3ea216fa90ad7fde69a0 *man/update.modelStruct.Rd fe93e070119eaec29a86dde2df59ae71 *man/update.varFunc.Rd 0b08d4906ec59a4d007980b4a02a3bfb *man/varClasses.Rd 90931caface7ab83c19fba204c7ac818 *man/varComb.Rd 9bab47d7d6c2b84ef6794ea19134a86f *man/varConstPower.Rd cf8f1ea7b02994d05cafdeac8afb78f0 *man/varExp.Rd 375a932377dee2e8f5e1227097368f5b *man/varFixed.Rd c0a263b2c59738dab3b4c196c8d797a6 *man/varFunc.Rd 13741091d4011b2d7be72cacfd6737ce *man/varIdent.Rd f75556c06a03f93a42697a1d2b6edbdb *man/varPower.Rd 7c37faad620348de3bef118def08ea00 *man/varWeights.Rd 974ac1176d9397c4cec9a625b4b9cd73 *man/varWeights.glsStruct.Rd ec5bee030bd1d4425fa01febc9d91ccd *man/varWeights.lmeStruct.Rd b03b7a91f77df2e169623ea20ceccff2 *po/R-de.po 81f6bd5d9b3fed2d19cc5ca1913100e6 *po/R-fr.po 090c60f624fabdb169b0176e86e3c985 *po/R-ko.po 4dde4fb303d5b03be886879588503998 *po/R-nlme.pot 443ee44fa0dd6a178973f454889dda41 *po/R-pl.po 47a3dae9d31a2f22c04fad96fcbe7c07 *po/de.po c46edd58f5ebab760f76d3fac01da938 *po/fr.po 8e629e17b8439113a6ab11eb9ad4bc1b *po/ko.po ee6164dce6d28ba0da6e8ca325de2896 *po/nlme.pot 248db4f3d9040b484c2f16ac53f57676 *po/pl.po 4a6ee9d66b62b2838b5d54e20f04f8b0 *src/Makevars 1a41e1d0a55c611ee6a8d4c7d873160b *src/base.h 50706c74629dbfa8b03d472135e7165f *src/chol.f c63109764f6bb64523ec70fc6aa29fd9 *src/corStruct.c 79c2e3613dba3642f53110b97fd88580 *src/gnls.c ee1ee57435cd51e17eff7cfcb765d89b *src/init.c f5638d8da756049ecb729345adf88eb7 *src/matrix.c bdb2a20b9e6c1597229accc9a817d725 *src/matrix.h 183fb67b22d772170ee934151870daa1 *src/nlOptimizer.c aee83096167846e585d243c9e7e93da7 *src/nlOptimizer.h d35c5058158b6d4b50a9817669b693b5 *src/nlme.c 59a68a3338528b95fea8e98c977020f8 *src/nlmefit.c 716000afd0baf90c06b6b4c209654ccc *src/nlmefit.h 5225d615caa3ab1cd28d8859f2da6554 *src/pdMat.c 87f59f283d5378beccb42f205be507cf *src/pdMat.h 40882409fb463a6dc1cbde0cf7d93661 *src/pythag.c a42b9bd64351934ca5b021009e777a63 *src/rs.f 683f1a1d208c479e7bed8df5bb420a2e *tests/anova.gls.R c338794f58a889a3c552fdfbb9c62374 *tests/augPred_lab.R cdced2c0665ee6e3f80188b92267e8c8 *tests/augPredmissing.R ab25428328f64b827b7ff267fc84ab5e *tests/coef.R 17c621b1a1a464be81f962133e61ca9b *tests/coef.Rout.save 8ff37dbadc319edc1c2c0a737ab2f845 *tests/contrMat.R 5d84af6fb453785dcb1d39674321dbaf *tests/data.frame.R f0a206bb1886e769376cd5b0f306e364 *tests/deparse.R 2038d7eef374b9c7131d202c15e0a742 *tests/deviance.R dea84bf6c5e3f953ea2c523ef749bfae *tests/fitted.R 2d06207872197b9abd28f869ff06f086 *tests/getData.R db2b6e128769fe949671803e3dff6737 *tests/gls.R 8c6c3eb850ed8c354ba02b1cbbc560bf *tests/gnls-ch8.R acbc43cefb4e2ab33d47609e745d6311 *tests/lmList.R 2cddd1873dda4ba139adf0aa86772429 *tests/lme.R 4195197f9b9304f360a5e66bfc9bbf50 *tests/lme.Rout.save 4191899f37fc372e70793b9c71d72304 *tests/missing.R 99f829516656a88d97a9e9617af9fdaf *tests/missing.Rout.save 2fbfea09caec83fc184a5ef2755e6d78 *tests/nlme-stall.R 9c3073d1e8cc0dd10e7bdf07ffd3b817 *tests/nlme.R 36ed5ca1573b56b898ef2f7cab338783 *tests/nlme2.R c891766c6501e010dd5f64ce00861d0e *tests/predict.lme.R 2e2ed18cde1ff6fdf0cd284d8073ed19 *tests/sigma-fixed-etc.R 52e8f5b5ecbec55ced361ee194ff972a *tests/ss2.rds 4c68332d00c3e3f1818fcb8aa60e0d9b *tests/updateLme.R 8bb1eb5670f185f8aaaa51b542866ee5 *tests/varIdent.R nlme/INDEX0000644000176200001440000004013211177507002011777 0ustar liggesusersACF Autocorrelation Function ACF.gls Autocorrelation Function for gls Residuals ACF.lme Autocorrelation Function for lme Residuals Alfalfa Split-Plot Experiment on Varieties of Alfalfa allCoef Extract Coefficients from a Set of Objects anova.gls Compare Likelihoods of Fitted Objects anova.lme Compare Likelihoods of Fitted Objects as.matrix.corStruct Matrix of a corStruct Object as.matrix.pdMat Matrix of a pdMat Object as.matrix.reStruct Matrices of an reStruct Object asOneFormula Combine Formulas of a Set of Objects Assay Bioassay on Cell Culture Plate asTable Convert groupedData to a matrix augPred Augmented Predictions balancedGrouped Create a groupedData object from a matrix bdf Language scores BIC Bayesian Information Criterion BIC.logLik BIC of a logLik Object BodyWeight Rat weight over time for different diets Cefamandole Pharmacokinetics of Cefamandole coef<- Assign Values to Coefficients coef.corStruct Coefficients of a corStruct Object coef.gnls Extract gnls Coefficients coef.lme Extract lme Coefficients coef.lmList Extract lmList Coefficients coef.modelStruct Extract modelStruct Object Coefficients coef.pdMat pdMat Object Coefficients coef.reStruct reStruct Object Coefficients coef.varFunc varFunc Object Coefficients collapse Collapse According to Groups collapse.groupedData Collapse a groupedData Object compareFits Compare Fitted Objects comparePred Compare Predictions corAR1 AR(1) Correlation Structure corARMA ARMA(p,q) Correlation Structure corCAR1 Continuous AR(1) Correlation Structure corClasses Correlation Structure Classes corCompSymm Compound Symmetry Correlation Structure corExp Exponential Correlation Structure corFactor Factor of a Correlation Matrix corFactor.corStruct Factor of a corStruct Object Matrix corGaus Gaussian Correlation Structure corLin Linear Correlation Structure corMatrix Extract Correlation Matrix corMatrix.corStruct Matrix of a corStruct Object corMatrix.pdMat Extract Correlation Matrix from a pdMat Object corMatrix.reStruct Extract Correlation Matrix from Components of an reStruct Object corNatural General correlation in natural parameterization corRatio Rational Quadratic Correlation Structure corSpatial Spatial Correlation Structure corSpher Spherical Correlation Structure corSymm General Correlation Structure covariate<- Assign Covariate Values covariate<-.varFunc Assign varFunc Covariate Dialyzer High-Flux Hemodialyzer Dim Extract Dimensions from an Object Dim.corSpatial Dimensions of a corSpatial Object Dim.corStruct Dimensions of a corStruct Object Dim.pdMat Dimensions of a pdMat Object Earthquake Earthquake Intensity ergoStool Ergometrics experiment with stool types Fatigue Cracks caused by metal fatigue fdHess Finite difference Hessian fitted.glsStruct Calculate glsStruct Fitted Values fitted.gnlsStruct Calculate gnlsStruct Fitted Values fitted.lme Extract lme Fitted Values fitted.lmeStruct Calculate lmeStruct Fitted Values fitted.lmList Extract lmList Fitted Values fitted.nlmeStruct Calculate nlmeStruct Fitted Values fixed.effects Extract Fixed Effects fixef.lmList Extract lmList Fixed Effects formula.pdBlocked Extract pdBlocked Formula formula.pdMat Extract pdMat Formula formula.reStruct Extract reStruct Object Formula gapply Apply a Function by Groups Gasoline Refinery yield of gasoline getCovariate Extract Covariate from an Object getCovariate.corStruct Extract corStruct Object Covariate getCovariate.data.frame Extract Data Frame Covariate getCovariateFormula Extract Covariates Formula getCovariate.varFunc Extract varFunc Covariate getData Extract Data from an Object getData.gls Extract gls Object Data getData.lme Extract lme Object Data getData.lmList Extract lmList Object Data getGroups Extract Grouping Factors from an Object getGroups.corStruct Extract corStruct Groups getGroups.data.frame Extract Groups from a Data Frame getGroupsFormula Extract Grouping Formula getGroups.gls Extract gls Object Groups getGroups.lme Extract lme Object Groups getGroups.lmList Extract lmList Object Groups getGroups.varFunc Extract varFunc Groups getResponse Extract Response Variable from an Object getResponseFormula Extract Formula Specifying Response Variable getVarCov Extract variance-covariance matrix gls Fit Linear Model Using Generalized Least Squares glsControl Control Values for gls Fit glsObject Fitted gls Object glsStruct Generalized Least Squares Structure Glucose Glucose levels over time Glucose2 Glucose Levels Following Alcohol Ingestion gnls Fit Nonlinear Model Using Generalized Least Squares gnlsControl Control Values for gnls Fit gnlsObject Fitted gnls Object gnlsStruct Generalized Nonlinear Least Squares Structure groupedData Construct a groupedData Object gsummary Summarize by Groups Gun Methods for firing naval guns IGF Radioimmunoassay of IGF-I Protein Initialize Initialize Object Initialize.corStruct Initialize corStruct Object Initialize.glsStruct Initialize a glsStruct Object Initialize.lmeStruct Initialize an lmeStruct Object Initialize.reStruct Initialize reStruct Object Initialize.varFunc Initialize varFunc Object intervals Confidence Intervals on Coefficients intervals.gls Confidence Intervals on gls Parameters intervals.lme Confidence Intervals on lme Parameters intervals.lmList Confidence Intervals on lmList Coefficients isBalanced Check a Design for Balance isInitialized Check if Object is Initialized LDEsysMat Generate system matrix for LDEs lme Linear Mixed-Effects Models lmeControl Control Values for lme Fit lme.groupedData LME fit from groupedData Object lme.lmList LME fit from lmList Object lmeObject Fitted lme Object lmeScale Scale for lme Optimization lmeStruct Linear Mixed-Effects Structure lmList List of lm Objects with a Common Model lmList.groupedData lmList Fit from a groupedData Object logDet Extract the Logarithm of the Determinant logDet.corStruct Extract corStruct Log-Determinant logDet.pdMat Extract Log-Determinant from a pdMat Object logDet.reStruct Extract reStruct Log-Determinants logLik.corStruct Extract corStruct Log-Likelihood logLik.glsStruct Log-Likelihood of a glsStruct Object logLik.gnls Log-Likelihood of a gnls Object logLik.gnlsStruct Log-Likelihood of a gnlsStruct Object logLik.lme Log-Likelihood of an lme Object logLik.lmeStruct Log-Likelihood of an lmeStruct Object logLik.lmList Log-Likelihood of an lmList Object logLik.reStruct Calculate reStruct Log-Likelihood logLik.varFunc Extract varFunc logLik Machines Productivity Scores for Machines and Workers MathAchieve Mathematics achievement scores MathAchSchool School demographic data for MathAchieve matrix<- Assign Matrix Values matrix<-.pdMat Assign Matrix to a pdMat Object matrix<-.reStruct Assign reStruct Matrices Meat Tenderness of meat Milk Protein content of cows' milk model.matrix.reStruct reStruct Model Matrix Muscle Contraction of heart muscle sections Names Names Associated with an Object Names.formula Extract Names from a formula Names.pdBlocked Names of a pdBlocked Object Names.pdMat Names of a pdMat Object Names.reStruct Names of an reStruct Object needUpdate Check if Update is Needed needUpdate.modelStruct Check if a modelStruct Object Needs Updating Nitrendipene Assay of nitrendipene nlme Nonlinear Mixed-Effects Models nlmeControl Control Values for nlme Fit nlme.nlsList NLME fit from nlsList Object nlmeObject Fitted nlme Object nlmeStruct Nonlinear Mixed-Effects Structure nlsList List of nls Objects with a Common Model nlsList.selfStart nlsList Fit from a selfStart Function Oats Split-plot Experiment on Varieties of Oats Orthodont Growth curve data on an orthdontic measurement Ovary Counts of Ovarian Follicles Oxboys Heights of Boys in Oxford Oxide Variability in Semiconductor Manufacturing pairs.compareFits Pairs Plot of compareFits Object pairs.lme Pairs Plot of an lme Object pairs.lmList Pairs Plot of an lmList Object PBG Effect of Phenylbiguanide on Blood Pressure pdBlocked Positive-Definite Block Diagonal Matrix pdClasses Positive-Definite Matrix Classes pdCompSymm Positive-Definite Matrix with Compound Symmetry Structure pdConstruct Construct pdMat Objects pdConstruct.pdBlocked Construct pdBlocked Objects pdDiag Diagonal Positive-Definite Matrix pdFactor Square-Root Factor of a Positive-Definite Matrix pdFactor.reStruct Extract Square-Root Factor from Components of an reStruct Object pdIdent Multiple of the Identity Positive-Definite Matrix pdLogChol General Positive-Definite Matrix pdMat Positive-Definite Matrix [.pdMat Subscript a pdMat Object pdMatrix Extract Matrix or Square-Root Factor from a pdMat Object pdMatrix.reStruct Extract Matrix or Square-Root Factor from Components of an reStruct Object pdNatural General Positive-Definite Matrix in Natural Parametrization pdSymm General Positive-Definite Matrix Phenobarb Phenobarbitol Kinetics phenoModel Model function for the Phenobarb data Pixel X-ray pixel intensities over time plot.ACF Plot an ACF Object plot.augPred Plot an augPred Object plot.compareFits Plot a compareFits Object plot.gls Plot a gls Object plot.intervals.lmList Plot lmList Confidence Intervals plot.lme Plot an lme or nls object plot.lmList Plot an lmList Object plot.nffGroupedData Plot an nffGroupedData Object plot.nfnGroupedData Plot an nfnGroupedData Object plot.nmGroupedData Plot an nmGroupedData Object plot.ranef.lme Plot a ranef.lme Object plot.ranef.lmList Plot a ranef.lmList Object plot.Variogram Plot a Variogram Object pooledSD Extract Pooled Standard Deviation predict.gls Predictions from a gls Object predict.gnls Predictions from a gnls Object predict.lme Predictions from an lme Object predict.lmList Predictions from an lmList Object predict.nlme Predictions from an nlme Object print.summary.pdMat Print a summary.pdMat Object print.varFunc Print a varFunc Object qqnorm.gls Normal Plot of Residuals from a gls Object qqnorm.lme Normal Plot of Residuals or Random Effects from an lme Object Quinidine Quinidine Kinetics quinModel Model function for the Quinidine data Rail Evaluation of Stress in Railway Rails random.effects Extract Random Effects ranef.lme Extract lme Random Effects ranef.lmList Extract lmList Random Effects RatPupWeight The weight of rat pups recalc Recalculate Condensed Linear Model Object recalc.corStruct Recalculate for corStruct Object recalc.modelStruct Recalculate for a modelStruct Object recalc.reStruct Recalculate for an reStruct Object recalc.varFunc Recalculate for varFunc Object Relaxin Assay for Relaxin Remifentanil Pharmacokinetics of remifentanil residuals.gls Extract gls Residuals residuals.glsStruct Calculate glsStruct Residuals residuals.gnlsStruct Calculate gnlsStruct Residuals residuals.lme Extract lme Residuals residuals.lmeStruct Calculate lmeStruct Residuals residuals.lmList Extract lmList Residuals residuals.nlmeStruct Calculate nlmeStruct Residuals reStruct Random Effects Structure simulate.lme Simulate results from lme models solve.pdMat Calculate Inverse of a Positive-Definite Matrix solve.reStruct Apply Solve to an reStruct Object Soybean Growth of soybean plants splitFormula Split a Formula Spruce Growth of Spruce Trees summary.corStruct Summarize a corStruct Object summary.gls Summarize a gls Object summary.lme Summarize an lme Object summary.lmList Summarize an lmList Object summary.modelStruct Summarize a modelStruct Object summary.nlsList Summarize an nlsList Object summary.pdMat Summarize a pdMat Object summary.varFunc Summarize varFunc Object Tetracycline1 Pharmacokinetics of tetracycline Tetracycline2 Pharmacokinetics of tetracycline update.modelStruct Update a modelStruct Object update.varFunc Update varFunc Object varClasses Variance Function Classes varComb Combination of Variance Functions varConstPower Constant Plus Power Variance Function VarCorr Extract variance and correlation components varExp Exponential Variance Function varFixed Fixed Variance Function varFunc Variance Function Structure varIdent Constant Variance Function Variogram Calculate Semi-variogram Variogram.corExp Calculate Semi-variogram for a corExp Object Variogram.corGaus Calculate Semi-variogram for a corGaus Object Variogram.corLin Calculate Semi-variogram for a corLin Object Variogram.corRatio Calculate Semi-variogram for a corRatio Object Variogram.corSpatial Calculate Semi-variogram for a corSpatial Object Variogram.corSpher Calculate Semi-variogram for a corSpher Object Variogram.default Calculate Semi-variogram Variogram.gls Calculate Semi-variogram for Residuals from a gls Object Variogram.lme Calculate Semi-variogram for Residuals from an lme Object varPower Power Variance Function varWeights Extract Variance Function Weights varWeights.glsStruct Variance Weights for glsStruct Object varWeights.lmeStruct Variance Weights for lmeStruct Object Wafer Modeling of Analog MOS Circuits Wheat Yields by growing conditions Wheat2 Wheat Yield Trials nlme/inst/0000755000176200001440000000000012763501322012163 5ustar liggesusersnlme/inst/CITATION0000644000176200001440000000102012763501322013311 0ustar liggesusersyear <- sub("-.*", "", meta$Date) note <- sprintf("R package version %s", meta$Version) bibentry(bibtype = "Manual", title = "{nlme}: Linear and Nonlinear Mixed Effects Models", author = c(person("Jose", "Pinheiro"), person("Douglas", "Bates"), person("Saikat", "DebRoy"), person("Deepayan", "Sarkar"), person("R Core Team")), year = year, note = note, url = "https://CRAN.R-project.org/package=nlme") nlme/inst/mlbook/0000755000176200001440000000000012213262320013436 5ustar liggesusersnlme/inst/mlbook/README0000644000176200001440000000031710513125543014325 0ustar liggesusersThe scripts in this directory reproduce some of the examples from the book Snijders, Tom and Bosker, Roel (1999), Multilevel Analysis: An Introduction to Basic and Advanced Multilevel Modeling, Sage. nlme/inst/mlbook/ch04.R0000644000176200001440000000163010513125543014325 0ustar liggesuserslibrary(nlme) # data(bdf) ## Fit the null model ## Compare with Table 4.1, p. 47 fm1 <- lme(langPOST ~ 1, data = bdf, random = ~ 1 | schoolNR) VarCorr(fm1) -2*c(logLik(fm1)) # deviance ## Fit model with fixed IQ term and random intercept ## Compare with Table 4.2, p. 49 ## From the results in Tables 4.2 and 4.4, it appears that ## maximum likelihood fits are used, not REML fits. fm2 <- update(fm1, langPOST ~ IQ.ver.cen) summary(fm2) VarCorr(fm2) -2 * c(logLik(fm2)) # deviance ## Purely fixed-effects model for comparison ## Compare with Table 4.3, p. 51 fm3 <- lm(langPOST ~ IQ.ver.cen, data = bdf) summary(fm3) -2 * c(logLik(fm3)) # deviance ## Model with average IQ for the school ## Compare with Table 4.4, p. 55 fm4 <- update(fm2, langPOST ~ IQ.ver.cen + avg.IQ.ver.cen) summary(fm4) VarCorr(fm4) -2 * c(logLik(fm4)) # deviance nlme/inst/mlbook/ch05.R0000644000176200001440000000100410513125543014321 0ustar liggesuserslibrary(nlme) # data(bdf) ## Model with random slope for IQ.ver.cen ## Compare with Table 5.1, p. 71. fm5 <- lme(langPOST ~ IQ.ver.cen + avg.IQ.ver.cen, data = bdf, random = ~ IQ.ver.cen, method = "ML") summary(fm5) VarCorr(fm5) -2 * c(logLik(fm5)) # deviance ## Add centered class size and interaction ## Compare with Table 5.2, p. 75 fm6 <- update(fm5, langPOST ~ avg.IQ.ver.cen + IQ.ver.cen * grpSiz.cen) summary(fm6) VarCorr(fm6) -2 * c(logLik(fm6)) # deviance nlme/inst/po/0000755000176200001440000000000012213262320012571 5ustar liggesusersnlme/inst/po/ko/0000755000176200001440000000000012213262320013202 5ustar liggesusersnlme/inst/po/ko/LC_MESSAGES/0000755000176200001440000000000013450712323014776 5ustar liggesusersnlme/inst/po/ko/LC_MESSAGES/R-nlme.mo0000644000176200001440000001156113450712323016471 0ustar liggesusers$<5\001)b)  #@#Uy$ 7*9?>y>CB;A~?<1\658 46U"< O D 0d 6 : / 07 6h / , 0 :- 2h : Q $(IMKGL+KxJH<XPOF6K}G3SE &:T   #$ " !"corStruct" object must have a "fixed" attribute%s and %s must have the same group levels%s not found in data%s not found in data'Id' must be between 0 and 1'Terms' must be between 1 and %d'form' must be a formula'form' must be a list'id' must be between 0 and 1'nam' must be a list'object' has not been Initialize()d'object' must be a formula'pdClass' must be a character vector'subset' must be a list'which' must be between 1 and %dall fitted objects must have the same estimation methodcannot change 'form'cannot change dimensions on an initialized "pdMat" objectcannot change the length of the parameter after initializationcannot change the length of the parameter of a "corAR1" objectcannot change the length of the parameter of a "corCompSymm" objectcannot change the length of the parameter of a "corNatural" objectcannot change the length of the parameter of a "corStruct" objectcannot change the length of the parameter of a "corSymm" objectcovariate must be a data framedo not know how to calculate correlation matrix of %s objectdo not know how to obtain parameters of %s objectinitial value in "corCompSymm" must be greater than %sinitial value of nugget ratio must be between 0 and 1maximum number of iterations reached without convergenceneed data to calculate covariateneed data to calculate covariate of "corStruct" objectno coefficients to fitno fitted "lme" objectnot implemented for "nlme" objectsstarting values for parameters are not of the correct lengthProject-Id-Version: nlme 3.1-105 POT-Creation-Date: 2019-04-02 18:40 PO-Revision-Date: 2013-08-16 18:52-0600 Last-Translator: Chel Hee Lee Language-Team: R Development Translation Teams (Korean) Language: ko MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; X-Poedit-SourceCharset: utf-8 X-Generator: Poedit 1.5.4 "corStruct" 객체는 반드시 "fixed" 속성을 가지고 있어야 합니다%s와 %s은 반드시 같은 그룹 수준들을 가져야 합니다데이터로부터 %s를 찾을 수 없습니다'Id'는 반드시 0과 1 사이에 있어야 합니다'Terms'는 반드시 1과 %d 사이에 있어야 합니다'form'은 반드시 formula 이어야 합니다'form'은 반드시 리스트이어야 합니다'id'는 반드시 0과 1 사이에 있어야 합니다'nam'은 반드시 리스트이어야 합니다'object'가 초기화 되지 않았습니다'object'는 반드시 formula이어야 합니다'pdClass'는 반드시 문자형 벡터이어야 합니다'subset'은 반드시 리스트이어야 합니다'which'는 반드시 1과 %d 사이에 있어야 합니다모든 객체들이 같은 추정방법을 이용하여 적합되어야 합니다'form'를 변경할 수 없습니다초기화된 "pdMat" 객체의 차원정보를 변경할 수 없습니다초기화 이후에는 파라미터의 길이를 변경할 수 없습니다"corAR1" 객체의 파라미터의 길이를 변경할 수 없습니다"corCompSymm" 객체의 파라미터의 길이를 변경할 수 없습니다"corNatural" 객체의 파라미터의 길이를 변경할 수 없습니다"corStruct" 객체의 파라미터의 길이를 변경할 수 없습니다"corSymm" 객체의 파라미터의 길이를 변경할 수 없습니다공변량은 반드시 데이터프레임이어야 합니다%s 객체의 상관행렬을 어떻게 계산해야 할 지 알 수 없습니다%s 객체의 파라미터들을 어떻게 얻어야 할지 알 수 없습니다"corCompSymm" 내의 초기값은 반드시 %s 보다 커야 합니다nugget ratio의 초기값은 반드시 0과 1 사이에 있어야 합니다수렴하지 않고 지정된 최대 반복수에 도달하였습니다공변량을 계산할 데이터가 필요합니다"corStruct" 객체의 공변량을 계산하기 위한 데이터가 필요합니다적합할 계수가 없습니다적합된 "lme" 객체가 없습니다"nlme" 객체들에 대하여 구현되지 않았습니다파라미터들에 대한 시작값들에 대한 길이가 올바르지 않습니다nlme/inst/po/ko/LC_MESSAGES/nlme.mo0000644000176200001440000000272513450712323016274 0ustar liggesusers\ 4!3 7T!98!M,@CmV5K>JAll parameters must be less than 1 in absolute valueCoefficient matrix not invertibleFirst observation on an individual must have a doseHaven't written the compound symmetry case for this yetUnknown spatial correlation classanalytic gradient is not available with compound symmetryanalytic gradient is not available with matrix logarithmProject-Id-Version: nlme 3.1-105 Report-Msgid-Bugs-To: POT-Creation-Date: 2019-04-02 18:40+0200 PO-Revision-Date: 2013-08-16 18:27-0600 Last-Translator: Chel Hee Lee Language-Team: R Development Translation Teams (Korean) Language: ko MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; X-Poedit-SourceCharset: utf-8 X-Generator: Poedit 1.5.4 모든 파라미터들의 절대값이 반드시 1 보다 작아야 합니다가역적이지 않은 계수행렬입니다개인의 첫번째 관측값은 반드시 dose 이어야 합니다이것에 대하여 compound symmetry의 경우는 아직 작성되지 않았습니다알 수 없는 spatial correlation 클래스입니다analytic gradient는 compound symmetry와 함께 사용할 수 없습니다analytic gradient는 matrix logarithm과 함께 사용할 수 없습니다nlme/inst/po/fr/0000755000176200001440000000000012213262320013200 5ustar liggesusersnlme/inst/po/fr/LC_MESSAGES/0000755000176200001440000000000013450712323014774 5ustar liggesusersnlme/inst/po/fr/LC_MESSAGES/R-nlme.mo0000644000176200001440000012613713450712323016475 0ustar liggesusers7 0#J$n)" *,$J+o;)6HV3@ 1>R5/JEBE0O1O-*.! 2+ 3^  &  " " !.!+K! w!%!!,!"!'"I"-c""&"9"##+#$F#Gk#.#$#&$..$-]$1$,$)$,%A%#Y%}%(% %=%2%&X&6u&:&&&6'/E'6u'='P'7;(;s(1(7(A)*[)$)>)3)c*;*<*0*1,+J^+7++Q+9H,<,>,5,$4-9Y-G-I-J%.>p.>.?.?./Cn/B/A/?70<w0A0B0$916^1/121+11$2V27t2F2C2@736x373"39 41D47v4*4D4*5.I5ox5o5VX6'616 7(7<B7B7=7D8EE8E8H8E9H`9-989):<::1w:2:1:,;8;;=t;;;=;=,<2j<Q<C<&3=2Z=4=.=?=%1>:W>;>;> ?O?&?@@>5@>t@6@%@%A86A<oA<A:A9$B8^B1B0B3B3.C2bCWC:C+(D6TD5D$DWD8>ETwE5E)F0,F2]F2F9FF?G8XG%GOG+HN3H8H3H*H/I1JI<|I@I3I.JOJJLJ:J)"KILKHK7K$L\UyIy=y$z9AzL{zGzD{:U{M{5{R|8g|G|1|X}Es}8}}~i4z<:!'JIPOV5WWZ<`M\FFV=A330(JATHK*Kv3†l_c6ÇDF?=FĈ) K5FLȉeΊ-4bGGD+2p3I׌N!MpLS @_9;ڎ9>P=w͏DE9BĐK+SwGe?D6E!GgGB#:?^L1gDYʕC$Dh07ޖ9KPM?*mGmU#?yJV?[7cӚ-78eQ1"@K_C%AW6pI 6BIDFў+*D+o%7gea2Ǡ.')*Q'|=F)%.))<+f 6;&OBBBեFF_=O34@hVKFLV`JKY9J*Qu&Ǫ( n8o,2taB%7d~L"+!_@g[- }$m&. ?(iT0l|)0IvMDh KU2z+u> ; pS*xwqA2/o=,yP:81,6\ 7nN4.(  $'fJc/`5Y%-e'6H"j&) E]{CQ#3 1s9b^<3r!5VZW#4RO*kGFX"corStruct" object must have a "fixed" attribute"pdMat" element must have a formula"pdMat" elements must have a formula%s and %s must have the same group levels%s can have at most two components%s can only be a list or numeric%s can only have names "const" and "power"%s is not a valid effect name%s is not a valid object for "pdMat"%s must have group names in 'varConstPower'%s not available for plotting%s not available for plotting%s not found in data%s not found in data%s not matched%s not matched%s problem, convergence error code = %s message = %s%s without "primary" can only be used with fits of "groupedData" objects'FUN' can only be a function or a list of functions'Id' must be between 0 and 1'L' must have at most %d column'L' must have at most %d columns'Terms' must be between 1 and %d'asTable' can only be used with balanced 'groupedData' objects'asTable' cannot be used with multilevel grouped data'data' in %s call must evaluate to a data frame'data' must be a "groupedData" object if 'formula' does not include groups'data' must be a "groupedData" object if 'groups' argument is missing'data' must be given explicitly to use 'nls' to get initial estimates'data' must be given explicitly to use 'nlsList''data' must inherit from "groupedData" class if 'random' does not define groups'distance' and 'object' have incompatible lengths'fixed' must be a formula or list of formulae'form' and 'nam' have incompatible lengths'form' and 'pdClass' have incompatible lengths'form' argument must be a formula'form' can only be a formula or a list of formulae'form' can only be a formula, or a list of formulas'form' must be a formula'form' must be a formula when not NULL'form' must be a list'form' must be a one-sided formula'form' must be a two-sided formula'form' must have a covariate'form' must have all components as formulas'form' not consistent with 'nam''id' can only be a formula or numeric'id' must be between 0 and 1'idLabels' can only be a formula or a vector'idLabels' of incorrect length'lme.lmList' will redefine 'data''model' must be a formula'nam' and 'pdClass' have incompatible lengths'nam' must be a list'nint' is not consistent with 'breaks''nlme.nlsList' will redefine 'fixed', 'data', and 'start''object' has not been Initialize()d'object' must be a formula'object' must be a list or a formula'object' must be a list when not missing, not a matrix, and not numeric'params' must be a formula or list of formulae'pdClass' must be a character vector'preserve' must be a two-sided formula'random' must be a formula or list of formulae'range' must be > 0 in "corLin" initial value'range' must be > 0 in "corSpatial" initial value'start' must have a component called 'fixed''subset' can only be character or integer'subset' ignored with single grouping factor'subset' must be a list'value' must be a one sided formula'value' must be a square matrix'which' can only be character or integer'which' must be between 1 and %dL may only involve fixed effects with the same denominator DFLNone of the arguments specify more than one blockLength of names should be %dall arguments to 'varComb' must be of class "varFunc".all elements in the argument must generate "pdMat" objectsall elements must have a non-zero sizeall elements must have formulas when any has a formulaall elements must have names when any has namesall elements of 'form' list must be two-sided formulasall elements of a "reStruct" object must have a non-zero sizeall elements of formula must be list of two-sided formulae or two-sided formulaeall fitted objects must have the same estimation methodall fitted objects must use the same number of observationsall variables used in 'formula' must be in 'data'an object of length %d does not match a Cholesky factoran object of length %d does not match the required parameter sizearguments imply different number of blocksat least two coefficients are neededaugmentation of random effects only available for single levelautoregressive order must be a non-negative integercan only construct "varFunc" object from another "varFunc" object, a formula, or a character stringcan only fit "lmList" objects with single grouping variablecan only fit "nlsList" objects with single grouping variablecannot access the matrix of object without namescannot access the matrix of uninitialized objectscannot access the number of columns of uninitialized objects without namescannot calculate REML log-likelihood for "gnls" objectscannot change 'form'cannot change coefficients before initialization or when all parameters are fixedcannot change dimensions on an initialized "pdMat" objectcannot change parameter length of initialized "pdMat" objectcannot change parameter length of initialized "varComb" objectcannot change parameter length of initialized objectscannot change the length of 'object'cannot change the length of covariate in "varFunc" objectcannot change the length of the "varExp" parameter after initializationcannot change the length of the "varIdent" parameter after initializationcannot change the length of the "varStruct" parameter after initializationcannot change the length of the parameter after initializationcannot change the length of the parameter of a "corAR1" objectcannot change the length of the parameter of a "corARMA" objectcannot change the length of the parameter of a "corCAR1" objectcannot change the length of the parameter of a "corCompSymm" objectcannot change the length of the parameter of a "corNatural" objectcannot change the length of the parameter of a "corStruct" objectcannot change the length of the parameter of a "corSymm" objectcannot change the number of columns on an initialized objectcannot change the parameter when ength of parameters is undefinedcannot change the parameter when length of parameters is undefinedcannot do pairs of just one variablecannot evaluate groups for desired levels on 'newdata'cannot extract groups formula without a formulacannot extract matrix from an uninitialized objectcannot extract model matrix without formulacannot extract parameters of uninitialized objectcannot extract the dimensionscannot extract the inverse from an uninitialized objectcannot extract the log of the determinant from an uninitialized objectcannot extract the matrix from an uninitialized "pdCompSymm" objectcannot extract the matrix from an uninitialized "pdIdent" objectcannot extract the matrix from an uninitialized objectcannot extract the matrix with uninitialized dimensionscannot fix variances in all groupscannot get confidence intervals on var-cov components: %scannot get the inverse of an uninitialized objectcannot have duplicated column names in a "pdMat" objectcannot have zero distances in "corSpatial"cannot obtain constrained coefficients with uninitialized dimensionscannot omit grouping factor without 'form'cannot use an anonymous function for the modelcannot use smaller level of grouping for "correlation" than for "random". Replacing the former with the latter.cannot use smaller level of grouping for 'correlation' than for 'random'. Replacing the former with the latter.collapsing level cannot be smaller than display level; setting it to the display levelcomputed "gls" fit is singular, rank %sconstant in "varConstPower" structure must be > 0covariate must be a data framecovariate must be numericcovariate must have a level attribute when 'id' is a formulacovariate must have a level attribute when 'idLabels' is a formulacovariate must have a level attribute when groups are presentcovariate must have unique values within groups for "corAR1" objectscovariate must have unique values within groups for "corARMA" objectscovariate must have unique values within groups for "corCAR1" objectscovariate must have unique values within groups for "corNatural" objectscovariate must have unique values within groups for "corSymm" objectsdata argument to "data.frame" method for 'getGroups' does not make sensedata in %s call must evaluate to a data framedegrees of freedom and weights must have the same lengthdimnames of 'value' must match or be NULLdo not know how to calculate correlation matrix of %s objectdo not know how to get coefficients for %s objectdo not know how to obtain constrained coefficientsdo not know how to obtain parameters of %s objecteffect %s not matchedeffects %s not matchedelements in 'object' must be formulas or "pdMat" objectsfewer observations than random effects in all level %s groupsfirst argument to 'groupedData' must be a two-sided formulafirst argument to 'nfGroupedData' must be a two-sided formulafirst argument to 'nmGroupedData' must be a two-sided formulafirst model has a different response from the restfitted objects with different fixed effects. REML comparisons are not meaningful.fixed parameter names in 'varIdent' must be a subset of group namesfixed parameters must have group namesfixed parameters must have group names in 'varExp'fixed parameters must have group names in 'varPower'fixed parameters must have names in 'varIdent'fixed-effects model must be a formula of the form "resp ~ pred"formula(object) must return a formulaformulae in 'fixed' must be of the form "parameter ~ expr"formulae in 'params' must be of the form "parameter ~ expr"formulae in 'random' must be of the form "parameter ~ expr"group name not matched in starting values for random effects: %sgroup names not matched in starting values for random effects: %sgroups levels mismatch in 'random' and starting values for 'random' at level %signoring 'group' in "varFixed" formulaignoring argument 'form'ignoring argument 'nam'incompatible formulas for groups in "random" and "correlation"incompatible formulas for groups in 'random' and 'correlation'incompatible lengths for 'random' and grouping factorsincompatible lengths for object namesindividual %s was not used in the fitinitial value for "corLin" parameters of wrong dimensioninitial value for "corNatural" parameters of wrong dimensioninitial value for "corSpatial" parameters of wrong dimensioninitial value for "corSpher" parameters of wrong dimensioninitial value for "corSymm" parameters of wrong dimensioninitial value for "reStruct" overwritten in 'lme.lmList'initial value for "varExp" should be of length %dinitial value for "varExp" should be of length 1initial value for "varIdent" should be of length %dinitial value for "varPower" should be of length %dinitial value for "varPower" should be of length 1initial value for 'range' less than minimum distance. Setting it to 1.1 * min(distance)initial value for 'reStruct' overwritten in 'nlme.nlsList'initial value for parameter of wrong lengthinitial value in "corCompSymm" must be greater than %sinitial value of nugget ratio must be between 0 and 1initial value should be of length %dinitial values for "corNatural" do not define a positive-definite correlation structureinitial values for "corNatural" must be between -1 and 1initial values for "corSymm" do not define a positive-definite correlation structureinitial values for "corSymm" must be between -1 and 1initial values for 'varIdent' must be > 0initial values must have group names in 'varExp'initial values must have group names in 'varIdent'initial values must have group names in 'varPower'initializing "pdCompSymm" object is not positive definiteinvalid formula for groupslength of 'nam' not consistent with dimensions of initial valuelevel %s not allowed for %slevels %s not allowed for %slevel of %s does not match formula %slist with starting values for random effects must have names or be of length %dlog-likelihood not available with NULL fitsmaximum number of iterations (lmeControl(maxIter)) reached without convergencemaximum number of iterations reached without convergencemismatch between group names and fixed values namesmissing call attribute in "nlsList" objectmodel formula must be of the form "resp ~ pred"model must be a formula of the form "resp ~ pred"models with "corStruct" and/or "varFunc" objects not allowedmore than one degree of freedom is needed when one them is zero.moving average order must be a non-negative integermultiple levels not allowedmust give names when initializing "pdCompSymm" from parameter without a formulamust give names when initializing "pdIdent" from parameter without a formulamust give names when initializing from matrix or parametermust have formula when no names are givennames being assigned do not correspond to a permutation of previous namesnames mismatch in 'random' and starting values for 'random' at level %snames of 'value' are not consistent with 'nam' argumentnames of object and value must matchnames of starting value for "varIdent" object must contain all but one of the stratum levelsneed an object with call componentneed data to calculate covariateneed data to calculate covariate of "corStruct" objectnegative degrees of freedom not allowedno coefficients to fitno condensed linear modelno default method for extracting the square root of a "pdMat" objectno degrees of freedom for estimating std. dev.no degrees of freedom specifiedno effects allowed in right side of formulano fitted "lme" objectno initial values for model parametersno model variogram available with 'showModel = TRUE'nonexistent group in 'newdata'nonexistent group names for initial valuesnonexistent group names for initial values in "varExp"nonexistent group names for initial values in "varPower"nonexistent group names for initial values in 'varIdent'nonexistent group requested in 'subset'nonexistent groups requested in 'subset'nonexistent level %snonexistent levels %snot implemented for "nlme" objectsnot implemented for multiple levels of nestingnumber of columns in starting values for random component at level %s should be %dnumber of rows in starting values for random component at level %s should be %dobject formula must be of the form "resp ~ pred"object must inherit from "data.frame"object must inherit from class "gls"object must inherit from class "lmList"object must inherit from class "lme"objects must have a "call" component or attributeobjects must have coefficients with same row namesold-style self-starting model functions are no longer supported. New selfStart functions are available. Use SSfpl instead of fpl, SSfol instead of first.order.log, SSbiexp instead of biexp, SSlogis instead of logistic. If writing your own selfStart model, see "help(selfStart)" for the new form of the "initial" attribute.only one display level allowedonly one level allowed for predictionsonly one level allowed in 'gapply'only one level allowed in 'gsummary'only one level of grouping allowedonly residuals allowedonly residuals and random effects allowedonly single effects allowed in left side of 'form'only single level allowedparameter in "corCompSymm" structure must be < 1 in absolute valueparameter in AR(1) structure must be between -1 and 1parameter in CAR(1) structure must be between 0 and 1parameters in ARMA structure must be < 1 in absolute valueplot method only implemented for comparing modelsrange must be > 0 in "corSpher" initial valueright-hand side of first argument must be a conditional expressionsecond argument must be a groupedData objectsecond argument to 'groupedData' must inherit from data.framesome fitted objects deleted because response differs from the first modelstarting estimates must have names when 'params' is missingstarting values for parameters are not of the correct lengthstarting values for random effects must include group levelsstarting values for random effects should be a list, or a matrixstarting values for the 'fixed' component are not the correct lengthstarting values for the random components should be a list of matricesterm %s not matchedterms %s not matchedterms can only be integers or charactersterms must all have the same denominator DFundefined collapsing level %s for %sundefined display level %s for %sundefined group declared in 'subset'unique values of the covariate for "corSymm" objects must be a sequence of consecutive integersunique values of the covariate for "corNatural" objects must be a sequence of consecutive integerswrong group levelsx-y data to splom got botched somehowProject-Id-Version: nlme 3.1-65 Report-Msgid-Bugs-To: bugs@r-project.org POT-Creation-Date: 2019-04-02 18:40 PO-Revision-Date: 2014-03-30 08:37+0100 Last-Translator: Philippe Grosjean Language-Team: French Language: fr MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); X-Generator: Poedit 1.6.4 l'objet "corStruct" doit avoir un attribut "fixed"l'lment "pdMat" doit contenir une formuleles lments de "pdMat" doivent contenir des formules%s et %s doivent avoir les mmes niveaux de groupes%s peut avoir jusqu' deux composantes%s ne peut qu'tre une liste, ou un nombre%s ne peut avoir que les noms "const" et "power"%s n'est pas un nom valide pour un effet%s n'est pas un objet correct pour "pdMat"%s doit avoir des noms de groupes dans 'varConstPower'%s non disponible pour le graphe%s non disponibles pour le graphe%s non trouv dans les donnes%s non trouv dans les donnes%s non assorti%s non assortisproblme %s, code d'erreur de convergence = %s message = %s%s sans "primary" ne peut tre utilis avec des ajustement d'objets "groupedData"'FUN' ne peut qu'tre une fonction ou une liste de fonctions'id' doit tre compris entre 0 et 1'L' doit avoir au moins %d colonne'L' doit avoir au moins %d colonnes'Terms' doivent tre compris entre 1 et %d'asTable' ne peut tre utilis qu'avec des objets 'groupedData' balancs'asTable' ne peut tre utilis avec des donnes groupements multiniveaux'data dans l'appel %s doit tre valu comme un data.frame'data' doit tre dans un objet "groupedData" si 'formula' n'inclus pas de groupes'data' doit tre un objet "groupedData" si l'argument 'groups' est manquant'data' doit tre fourni de manire explicite pour utiliser 'nls' afin d'obtenir les estimateurs initiaux'data' doit tre fourni explicitement pour utiliser 'nlsList''data' doit hriter de la classe "groupedData" si 'random' ne dfinit pas les groupes'distance' et 'object' ont des tailles incompatibles'fixed' doit tre une formule ou une liste de formules'form' et 'nam' ont des tailles incompatibles'form' et 'pdClass' ont des longueurs incompatiblesl'argument 'form' doit tre une formule'form' ne peut qu'tre une formule ou une liste de formules'form' ne peut tre qu'une formule, ou une liste de formules'form' doit tre une formule'form' doit tre une formule, lorsqu'il n'est pas NULL.'form' doit tre une liste'form' doit tre une formule un seul membre'formf doit tre une formule deux membres'form' doit avoir une covariable'form' doit avoir tous ses composantes sous forme de formules'form' non conforme avec 'nam''id' doit tre une formule ou une valeur numrique'id' doit tre compris entre 0 et 1'idLabels' ne peut tre qu'une formule ou un vecteur'idLabels' de longueur incorrecte'lme.lmList' va redfinir 'data''model' doit tre une formule'nam' et 'pdClass' ont des longueurs incompatibles'nam' doit tre une liste'nint' n'est pas consistant avec 'breaks''nlme.nlsList' va redfinir 'fixed', 'data', et 'start''object' n'a pas t initialis ; utilisez Initialize()'object' doit tre une formule'object' doit tre une liste ou une formule'object' doit tre une liste, lorsqu'il n'est pas manquant, pas une matrice ou un nombre'params' doit tre une formule ou une liste de formules'pdClass' doit tre un vecteur de chanes de caractres'preserve' doit tre une formule deux membres'random' doit tre une formule ou une liste de formulesl'tendue ('range') doit tre > 0 pour les valeurs initiales dans "corLin"l'tendue des valeurs initiales ('range') dans "corSpatial" doit tre > 0 'start' doit avoir une composante nomme 'fixed''subset' ne peut qu'tre une chane de caractres ou une valeur numrique'subset' ignor lors de l'utilisation d'un seul facteur pour le regroupement'subset' doit tre une liste'value' doit tre une formule un seul membre'value' doit tre une matrice carre'which' ne peut tre qu'une chane de caractres ou un entier'which' doit tre compris entre 1 et %d'L' ne peut que prendre en compte des effets fixes ayant mme degr de libert au dnominateurAucun des arguments ne spcifie plus d'un blocLa longueur des noms devrait tre %dtous les arguments de 'varComb' doivent tre de classe "varFunc".tous les lments dans l'argument doivent gnrer des objets "pdMat"tous les lments doivent avoir une taille non nulletous les lments doivent contenir des formules, si au moins l'un d'eux en contient unetous les lments doivent tre nomms, lorsqu'au moins un l'esttous les lments de la liste 'form' doivent tre des formules double membrestous les lments d'un objet "reStruct" doivent avoir une taille non nulletous les lments de type formule doivent tre des listes de formules deux membres ou des formules deux membrestous les objets ajusts doivent l'tre l'aide de la mme mthode d'estimationtous les objets ajusts doivent utiliser le mme nombre d'observationstoutes les variables utilises dans 'formula' doivent aussi se retrouver dans 'data'un objet de longueur %d ne correspond pas une factorisation de Choleskyun objet de longeur %d ne correspond pas la taille requise du paramtreles arguments impliquent des nombres diffrents de blocsil faut au moins deux coefficientsl'augmentation des effets alatoires n'est disponible que pour un seul niveaul'ordre autorgressif doit tre un entier positif ou nulun objet "varFunc" ne peut tre construit qu' partir d'un autre objet "varFunc", une formula ou une chane de caractresseuls les objets "lmList" peuvent tre ajusts avec une seule variable de groupeseuls les objets "nlsList" peuvent tre ajusts avec une seule variable de groupeimpossible d'accder la matrice d'un objet dont les noms ne sont pas dfinisimpossible d'accder la matrice d'objets non initialissimpossible de changer le nombre de colonnes d'un objet non initialis et sans nomsimpossible de calculer la log-vraissemblance REML pour les objets "gnls"Impossible de changer 'form'impossible de changer les coefficients avant initialisation ou lorsque tous les paramtres sont fixsimpossible de changer les dimensions d'un objet "pdMat" initialisimpossible de changer la longueur des paramtres dans un objet "pdMat" initialisimpossible de modifier la longueur du paramtre pour des objets "varComb" initialissla longueur du paramtre ne peut tre modifie dans les objets initialissimpossible de modifier la taille de 'object'impossible de changer la longueur de la covariable dans l'objet "varFunc"impossible de changer la longueur du paramtre "varExp" aprs l'initialisationimpossible de changer la longueur du paramtre "varIdent" aprs l'initialisationimpossible de changer la longueur du paramtre "varStruct" aprs l'initialisationimpossible de changer la longueur du paramtre aprs l'initialisationImpossible de changer la longueur des paramtres d'un objet "corAR1"impossible de changer la longueur des paramtres d'un objet "corARMA"Impossible de changer la longueur des paramtres d'un objet "corCAR1"impossible de changer la longueur des paramtres d'un objet "corCompSymm"impossible de changer la longueur des paramtres d'un objet "corNatural"impossible de changer la longueur des paramtres d'un objet "corStruct"impossible de changer la longueur des paramtres d'un objet "corSymm"impossible de changer le nombre de colonnes d'un objet initialisle paramtre ne peut tre modifi lorsque la longueur des paramtres n'est pas dfiniele paramtre ne peut tre modifi lorsque la longueur des paramtres est indfinieimpossible d'apparier avec seulement une variableimpossible d'valuer les groupes pour les niveaux dsirs de 'newdata'impossible d'extraire les groupes sans une formule dispositionimpossible d'extraire une matrice pour un objet non initialisimpossible d'extraire la matrice du modle sans une formule dispositionimpossible d'extraire les paramtres d'objets non initialissimpossible d'extraire les dimensionsimpossible d'extraire l'inverse d'un objet non initialisimpossible d'extraire le logarithme du dterminant d'un objet non initialisimpossible d'extraire la matrice d'un objet "pdCompSymm" non initialisimpossible d'extraire la matrice d'un objet "pdIdent" non initialisimpossible d'extraire la matrice d'un objet non initialisimpossible d'extraire la matrice en utilisant des dimensions non initialisesimpossible de fixer les variances de tous les groupesimpossible de calculer un intervalle de confiance sur les composantes var-cov : %simpossible d'obtenir l'inverse d'un objet non initialisles noms de colonnes dupliqus ne sont pas permis dans un objet "pdMat"distances nulles non autorises dans "corSpatial"impossible d'obtenir les coefficients de contrainte avec des dimensions non initialisesle facteur utilis pour le regroupement ne peut tre omis sans 'form'impossible d'utiliser une formule anonyme pour le modleimpossible d'utiliser un niveau plus petit pour le regroupement de "correlation" par rapport "random". Replacement du premier par le second.impossible d'utiliser un niveau plus petit pour le regroupement de 'correlation' par rapport 'random'. Replacement du premier par le second.le niveau de fusion ne peut tre plus petit que le niveau d'affichage ; il est fix au niveau d'affichagel'ajustement "gls" calcul est singulier, de rang %sla constante dans la structure "varConstPower" doit tre > Ola covariable doit tre un tableau de donnes (data.frame)la covariable doit tre numriquela covariable doit avoir un attribut 'level', lorsque 'id' est une formulela covariable doit avoir un attribut 'level', lorsque 'idLabels' est une formulela covariable doit avoir un attribut 'level', lorsque des groupes sont prsentsLa covariable doit avoir des valeurs uniques pour les intragroupes des objets "corAR1"la covariable doit avoir des valeurs uniques pour les intragroupes des objets "corARMA"la covariable doit avoir des valeurs uniques pour les intragroupes des objets "corCAR1"la cavariable doit avoir des valeurs uniques pour les intragroupes des objets 'corNatural'La covariable doit avoir des valeurs uniques l'intrieur des groupes pour les objets "corSymm"l'argument 'data' pour la mthode "data.frame" de 'getGroups' n'a pas de sensles donnes dans l'appel %s doivent tre values comme un tableau de donnes ("data frame")les degrs de libert et les pondrations doivent avoir la mme tailleles noms de dimensions ('dimnames') des valeurs doivent correspondre ou bien tre NULLIncapable de calculer la matrice de corrlation de l'objet %simpossible d'obtenir les coefficients de l'objet %simpossible d'obtenir les coefficients de contrainteincapable d'obtenir les paramtres de l'objet %seffet %s incohrenteffets %s incohrentles lments dans 'object' doivent tre des formules ou des objets "pdMat"moins d'observations qu'il n'y a d'effets alatoires dans les niveaux des groupes %sle premier argument 'groupedData' doit tre une formule deux membresle premier argument de 'nfGroupedData' doit tre une formule deux membresle premier argument de 'nmGroupedData' doit tre une formule deux membresle premier modle a une rponse diffrente du resteles objets ont t ajusts avec diffrents effets fixes. Les comparaisons REML n'ont aucun sens dans ce cas.les noms des paramtres fixs dans 'varIdent' doivent tre un sous-ensemble des noms de groupesles paramtres fixs doivent avoir des noms de groupesles paramtres fixes doivent avoir des noms de groupes dans 'varExp'les paramtres fixs doivent avoir des noms de groupes dans 'varPower'les paramtres fixs doivent avoir leurs noms dans 'varIdent'un modle effet fixe doit tre une formule de la forme "resp ~ pred"formula(object) doit renvoyer une formuleles formules dans 'fixed' doivent tre de la forme "paramtre ~ expression"les formules dans 'params' doivent tre de la forme "parameter ~ expr"les formules dans 'random' doivent tre de la forme "paramtre ~ expression"le nom de groupe ne correspond pas aux valeurs de dpart pour les effets alatoires : %sles noms des groupes ne correspondent pas aux valeurs de dpart pour les effets alatoires : %sniveaux de groupes incohrents dans 'random' et dans les valeurs de dpart pour 'random' au niveau %s'group' est ignor dans la formule "varFixed"L'argument 'form' est ignorL'argument 'nam' est ignorformules incompatibles entre les groupes dans "random" et "correlation"formules incompatibles entre les groupes dans 'random' et 'correlation'tailles incompatibles entre 'random' et les facteurs de regroupementlongueurs non compatibles pour les noms de l'objetl'individu %s n'a pas t utilis dans l'ajustementla valeur initiale pour les paramtres "corLin" n'ont pas la bonne tailleLa valeur initiale pour les paramtres "corNatural" n'a pas la bonne dimensionla valeur initiale pour les paramtres "corSpatial" n'ont pas la bonne taillela valeur initiale pour les paramtres "corSpher" sont de la mauvaise tailleLa valeur initiale pour les paramtres de "corSymm" n'ont pas les bonnes dimensionsla valeur initiale de "reStruct" est remplace dans 'lme.lmList'la valeur initiale pour "varExp" doit tre de longueur %dla valeur initiale pour "varExp" devrait tre de longueur 1la valeur initiale de "varIdent" doit tre de longueur %dla valeur initiale pour "varPower" devrait tre de longueur %dla valeur initiale pour "varPower" devrait tre de longueur 1la valeur initiale pour l'tendue ('range') est infrieure la distance minimale. Elle est fixe 1.1 * min(distance)la valeur initiale pour 'reStruct' est remplace dans 'nlme.nlsList'la valeur initiale du paramtre est de la mauvaise tailleLa valeur initiale dans "corCompSymm" doit tre plus grande que %sla valeur initiale du coefficient de ppite doit tre comprise entre 0 et 1la valeur initiale doit tre de longueur %dLes valeurs initiales pour "corNatural" ne sont pas dfinies sous forme d'une structure de corrlation positive-dfinieLes valeurs initiales pour "corNatural" doivent se situer entre -1 et 1les valeurs initiales pour "corSymm" ne dfinissent pas une structure de corrlation positive-dfinieLes valeurs initiales pour "corSymm" doivent se situer entre -1 et 1les valeurs initiales pour 'varIdent' doivent tre > 0les valeurs initiales doivent avoir des noms de groupes dans 'varExp'les valeurs initiales doivent avoir des noms de groupes dans 'varIdent'les valeurs initiales doivent avoir des noms de groupes dans 'varPower'l'initialisation d'un objet "pdCompSymm" n'est pas fini et positifformule incorrecte pour les groupesla longueur de 'nam' ne correspond pas aux dimensions initialesle niveau %s non autoriss pour %sles niveaux %s sont non autoriss pour %sle niveau de %s ne correspond pas la formule %sla liste contenant les valeurs de dpart pour les effets alatoires doit tre nommes ou de longueur %dla log-vraissemblance n'est pas disponible avec des ajustements NULLle nombre maximum d'itrations (lmeControl(maxIter)) est atteint, mais pas la convergencele nombre maximum d'itrations est atteint, mais pas la convergenceincohrence entre les noms de groupes et les noms des valeurs fixesattribut d'appel manquant dans l'objet "nlsList"la formule du modle doit tre de la forme "rep ~ pred"le modle doit tre une formule de la forme "resp ~ pred"les modles avec objets "corStruct" et / ou "varFunc" ne sont pas autorissplus d'un degr de libert est ncessaire lorsque l'un d'entre eux vaut zro.l'ordre de la moyenne mobile doit tre un entier positif ou nulniveaux multiples non permisil faut fournir les noms lors de l'initialisation de "pdCompSymm" depuis un paramtre sans fournir de formuleil faut fournir les noms lorsqu'un objet "pdIdent" est initialis depuis un paramtre sans fournir de formulelors de l'initialisation depuis une matrice ou un paramtre, il faut fournir les nomsune formule est ncessaire lorsque les noms ne sont pas fournisles noms affect ne correspondent pas une permutation des noms de dpartincohrence de noms entre 'random' et les valeurs de dpart pour 'random' au niveau %sLes noms de 'value' ne sont pas conformes avec l'argument 'nam'les noms de l'objet et ses valeurs ne correspondent pasles noms des valeurs de dpart pour "varIdent" doivent contenir tous les niveaux stratifis sauf unncessite un objet avec une composante 'call'des donnes sont ncessaires pour calculer la covariabledes donnes sont ncessaires pour calculer les covariables d'un objet "corStruct"des degrs de libert ngatifs ne sont pas permispas de coefficients ajusteraucun modle linaire condenspas de mthode par dfaut pour extraire la racine carre de l'objet "pdMat"aucun nombre de degrs de libert pour l'estimation de l'cart typeaucun degr de libert n'est spcifiaucun effet n'est autoris dans le membre de droite de la formulepas d'objet "lme" ajustpas de valeurs initiales pour les paramtres du modleaucun variogramme n'est disponible pour le modle avec 'showModel = TRUE'groupe inexistant dans 'newdata'noms de groupes inexistants pour les valeurs initialesnoms de groupes inexistants pour les valeurs initiales de "varExp"noms de groupes inexistants pour les valeurs initiales de "varPower"noms de groupes inexistants pour les valeurs initiales dans 'varIdent'groupe inexistant mais requis dans 'subset'groupes inexistants demands dans 'subset'niveau inexistant %sniveaux inexistants %sPas implment pour des objets "nlme"Pas implment pour des niveaux multiples d'imbricationle nombre de colonnes dans les valeurs de dpart pour la composante alatoire au niveau %s doit tre %dle nombre de lignes dans les valeurs de dpart pour la composante alatoire au niveau %s doit tre %dl'objet formule doit tre de la forme "rep ~ pred"l'objet doit hriter de la classe "data.frame"l'objet doit hriter de la classe "gls"l'objet doit hriter de la classe "lmList"l'objet doit hriter de la classe "lme"les objets doivent avoir une composante ou un attribut "call"les objets doivent avoir des coefficients qui ont mmes noms de lignesles fonctions de modles 'self-start' d'un ancien style ne sont plus supportes. Les nouvelles fonctions selfStart sont disponibles. Utilisez SSfpl la place de fpl, SSfol la place de first.order.log, SSbiexp la place de biexp, SSlogis la place de logistic. Si vous crez votre propre fonction de modle selfStart, voyez "help(selfStart)" pour la nouvelle forme de l'attribut "initial".un seul niveau d'affichage est permisseul un niveau est permis pour les prdictionsseul un niveau est autoris pour 'gapply'seul un niveau est permis dans 'gsummary'seul un niveau de regroupement est autorisseuls les rsidus sont autorissseuls les rsidus et les effets alatoires sont permisseul un effet est permis dans le membre de gauche de 'form'seul un niveau est autorisles paramtres d'une structure "corCompSymm" doivent tre < 1 en valeur absolueLe paramtre dans la structure AR(1) doit se situer entre - 1 et 1Le paramtre dans la structure CAR(1) doit se situer entre -1 et 1les paramtres d'une structure ARMA doivent tre < 1 en valeur absoluela mthode 'plot' n'est implmente que pour la comparaison de modlesl'tendue des valeurs initiales dans "corSpher" doit tre > 0le membre de droite du premier argument doit tre une expression conditionnellele second argument doit tre un objet 'groupedData'le second argument de 'groupedData' doit hriter d'un data.framecertains objets ajusts sont limins parce que leur rponse diffre du premier modleles estimations initiales doivent tre nomms lorsque 'params' est manquantles valeurs initiales pour les paramtres n'ont pas la taille correcteles valeurs de dpart pour les effets alatoires doivent inclure les niveaux de groupeles valeurs de dpart pour les effets alatoires doivent tre dans une liste ou dans une matriceles valeurs de dpart pour la composante 'fixed' n'ont pas la bonne tailleles valeurs de dpart pour les composantes alatoires devraient tre un liste de matricesle terme %s est incohrentles termes %s sont incohrentsLes termes peuvent tre seulement des entiers ou des chanes de caractresLes termes doivent tous avoir le mme nombre de degrs de libert au dnominateurniveau de fusion non dfini %s pour %sniveau d'affichage non dfini %s pour %sgroupe non dclar dans 'subset'les valeurs uniques des covariables pour les objets "corSymm" doivent tre des squences d'entiers conscutifsles valeurs uniques pour la covariables des objets "corNatural" doivent tre une squence d'entiers conscutifsniveaux de groupes erronsles donnes x-y de 'splom' ont t corrompusnlme/inst/po/fr/LC_MESSAGES/nlme.mo0000644000176200001440000000320113450712323016260 0ustar liggesusers l 4!&3H7|0E!+9M8AI%;8D&Yk)FJ6  All parameters must be less than 1 in absolute valueCoefficient matrix not invertibleFirst observation on an individual must have a doseHaven't written the compound symmetry case for this yetSingularity in backsolve at level %ld, block %ldUnable to form eigenvalue-eigenvector decomposition [RS(.) ierr = %d]Unknown spatial correlation classanalytic gradient is not available with compound symmetryanalytic gradient is not available with matrix logarithmProject-Id-Version: nlme 3.1-65 Report-Msgid-Bugs-To: POT-Creation-Date: 2019-04-02 18:40+0200 PO-Revision-Date: 2005-12-08 01:00+0100 Last-Translator: Philippe Grosjean Language-Team: French Language: fr MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Tous les paramtres doivent tre infrieurs 1 en valeur absolueMatrice de coefficient non inversibleLa premire observation sur un individu doit avoir une doseLes cas de symtrie compose n'ont pas encore t critsSingularit rencontre en rsolution inverse au niveau %ld, bloc %ldIncapable de former la dcomposition valeurs propres - vecteurs propres [RS(.) ierr = %d]Classes de corrlation spatiale inconnuesun gradient analytique n'est pas disponible avec une symtrie composeun gradient analytique n'est pas disponible avec une matrice logarithmiquenlme/inst/po/de/0000755000176200001440000000000012213262320013161 5ustar liggesusersnlme/inst/po/de/LC_MESSAGES/0000755000176200001440000000000013450712321014753 5ustar liggesusersnlme/inst/po/de/LC_MESSAGES/R-nlme.mo0000644000176200001440000013044213450712321016446 0ustar liggesusersJl 0#$B#Ef)" *E$c+;)68Ho3@  J>k5/J E[ E 0 O!1h!-!*!.!!""2D"3w""&"""#"$#G#+d# #%##,#!$!@$b$-|$$&$9$# %D%$_%G%.%$%& &.G&-v&1&,&)',-'Z'lr':'#(>((^( (((;(>)=W)2)) )),)7(*6`*:*&*6*/0+6`+=+P+7&,;^,1,7,A-*F-$q->-3-c .;m.<.0.1/JI/7//Q/930<m0>050$19D1G~1I1J2>[2>2?2?3CY3B3A3?"4<b4A4B4$$56I5/525+516A67_6F6C6@"76c777"797H/81x878*8D 9*R9.}9o9o:V:':1 ;=;\;<v;B;=;D4<Ey<E<H=EN=H=-=8 >D>)d><>1>2>10?,b?8?=?;@=B@=@2@Q@CCA&A2A4A.B?EB%B:B;B;"C^COC&1DXDqD>D>D6E%>E%dE8E<E<F:=F9xF8F1F0G3NG3G2GWG:AH+|H6H5H$IW:I8ITI5 J)VJ0J2J2J9KQKnK?K8K%LO(L+xLNLGL8;M3tM*M/M1N<5N@rN3NNOOLSO:O)OIPHOP7P$P\P"RQ uQ6Q'QQ RD&R.kRR+RR&R4$SYS*xS6S8S8T'LT(tT*TTT"U.@URoUOU0V%CV$iV'V$V1V2 W+@WLlWX&X"X$"Y"GYjY)Y2YYBY5;Z5qZ:Z1Z-[BB[,[=[![I\;\\<\<\@]DS]F](](^+1^$]^!^$^`^b*__%__3ga'a*aKaK:b2b*b+b0c Ac*bc.c]c5d3Pd6dVdAe!TeHve)eIeD3f3xfQfHf`Gg@gWg2Ah:th+h/h% i=1i=oii-ii'j)Om%m,m<m-n2Ln5n7n3n!oq?o@o)o*p7Gp&p'ppCpF.qAuq1qq rr0r<PrDr?r7sDJsBs@sPt_dtEtL uGWu:uKu=&v.dvLv>vfwLwLwD xPex]xCy#Xyh|yUyG;zSzIz0!{IR{T{[{WM|K|M|N?}N}R}Q0~P~N~Q"^tY5-Nc<K6;Nr,Ib8TRHCJ=׃NZdF?2Fgy=?_jm,؇4!:\BzHDRKSSVFSG29=l+;֋O>bPDB7?zJDFJF3؎_ Pl+79!2[B-ѐ=>=>|c>,ϒ? ?L;$ȓ3:!=\=;ؔ::O.450$6U`<.*7Y;!͗V@FS=ۘ,4F4{6?'G@f>%M ,ZNG֛8AW,0Ɯ4B,IoLe#aP0<BmR>2Bfu0ܠ2 L@%&ҡP;J6ܢ'8"&[.:?:,2g28ͤg'n1UȥT2s#1ʦ*&'<N=0ɧsn'"$ש&#+8<d=9:47o33۫B1R=)¬I56:l?HG0Hx>.=/+m$*xybܰ/5fa)=h XG.6H.D>'UN(Q-'OC:[?d7 I"# I(jcYE^+@:$ -AJ9~A=Z;H0!>W"6&%#1t)F;%kr2Tz F5 3\J P+sK9|go` 3!{}pRE,CbqV7uny8/4<  x@MLwi$1lB8D4?e2S*m]0vBG <_&,/*"corStruct" object must have a "fixed" attribute"pdMat" element must have a formula"pdMat" elements must have a formula%d error caught in %s: %s%d times caught the same error in %s: %s%d errors caught in %s. The error messages and their frequencies are%s and %s must have the same group levels%s can have at most two components%s can only be a list or numeric%s can only have names "const" and "power"%s is not a valid effect name%s is not a valid object for "pdMat"%s must have group names in 'varConstPower'%s not available for plotting%s not available for plotting%s not found in data%s not found in data%s not matched%s not matched%s problem, convergence error code = %s message = %s%s without "primary" can only be used with fits of "groupedData" objects'FUN' can only be a function or a list of functions'Id' must be between 0 and 1'L' must have at most %d column'L' must have at most %d columns'Terms' must be between 1 and %d'asTable' can only be used with balanced 'groupedData' objects'asTable' cannot be used with multilevel grouped data'data' in %s call must evaluate to a data frame'data' must be a "groupedData" object if 'formula' does not include groups'data' must be a "groupedData" object if 'groups' argument is missing'data' must be given explicitly to use 'nls' to get initial estimates'data' must be given explicitly to use 'nlsList''data' must inherit from "groupedData" class if 'random' does not define groups'distance' and 'object' have incompatible lengths'fixed' must be a formula or list of formulae'form' and 'nam' have incompatible lengths'form' and 'pdClass' have incompatible lengths'form' argument must be a formula'form' can only be a formula or a list of formulae'form' can only be a formula, or a list of formulas'form' must be a formula'form' must be a formula when not NULL'form' must be a list'form' must be a one-sided formula'form' must be a two-sided formula'form' must have a covariate'form' must have all components as formulas'form' not consistent with 'nam''id' can only be a formula or numeric'id' must be between 0 and 1'idLabels' can only be a formula or a vector'idLabels' of incorrect length'lme.lmList' will redefine 'data''model' must be a formula'nam' and 'pdClass' have incompatible lengths'nam' must be a list'nint' is not consistent with 'breaks''nlme.nlsList' will redefine 'fixed', 'data', and 'start''object' has not been Initialize()d'object' must be a formula'object' must be a list or a formula'object' must be a list when not missing, not a matrix, and not numeric'params' must be a formula or list of formulae'pdClass' must be a character vector'preserve' must be a two-sided formula'random' must be a formula or list of formulae'range' must be > 0 in "corLin" initial value'range' must be > 0 in "corSpatial" initial value'start' must have a component called 'fixed''subset' can only be character or integer'subset' ignored with single grouping factor'subset' must be a list'sumLenSq := sum(table(groups)^2)' = %g is too large. Too large or no groups in your correlation structure?'sumLenSq' = %g is too large (larger than maximal integer)'value' must be a one sided formula'value' must be a square matrix'which' can only be character or integer'which' must be between 1 and %dAIC undefined for REML fitDo increase 'msMaxIter'!Iteration %d, LME step: nlm() did not converge (code = %d).Iteration %d, LME step: nlminb() did not converge (code = %d).L may only involve fixed effects with the same denominator DFLNone of the arguments specify more than one blockLength of names should be %dPORT message:PackageRather re-install it with this version of R.Within-group std. dev. must be a positive numeric valueall arguments to 'varComb' must be of class "varFunc".all elements in the argument must generate "pdMat" objectsall elements must have a non-zero sizeall elements must have formulas when any has a formulaall elements must have names when any has namesall elements of 'form' list must be two-sided formulasall elements of a "reStruct" object must have a non-zero sizeall elements of formula must be list of two-sided formulae or two-sided formulaeall fitted objects must have the same estimation methodall fitted objects must use the same number of observationsall variables used in 'formula' must be in 'data'an object of length %d does not match a Cholesky factoran object of length %d does not match the required parameter sizearguments imply different number of blocksat least two coefficients are neededaugmentation of random effects only available for single levelautoregressive order must be a non-negative integercan only construct "varFunc" object from another "varFunc" object, a formula, or a character stringcan only fit "lmList" objects with single grouping variablecan only fit "nlsList" objects with single grouping variablecannot access the matrix of object without namescannot access the matrix of uninitialized objectscannot access the number of columns of uninitialized objects without namescannot calculate REML log-likelihood for "gnls" objectscannot change 'form'cannot change coefficients before initialization or when all parameters are fixedcannot change dimensions on an initialized "pdMat" objectcannot change parameter length of initialized "pdMat" objectcannot change parameter length of initialized "varComb" objectcannot change parameter length of initialized objectscannot change the length of 'object'cannot change the length of covariate in "varFunc" objectcannot change the length of the "varExp" parameter after initializationcannot change the length of the "varIdent" parameter after initializationcannot change the length of the "varStruct" parameter after initializationcannot change the length of the parameter after initializationcannot change the length of the parameter of a "corAR1" objectcannot change the length of the parameter of a "corARMA" objectcannot change the length of the parameter of a "corCAR1" objectcannot change the length of the parameter of a "corCompSymm" objectcannot change the length of the parameter of a "corNatural" objectcannot change the length of the parameter of a "corStruct" objectcannot change the length of the parameter of a "corSymm" objectcannot change the number of columns on an initialized objectcannot change the parameter when ength of parameters is undefinedcannot change the parameter when length of parameters is undefinedcannot do pairs of just one variablecannot evaluate groups for desired levels on 'newdata'cannot extract groups formula without a formulacannot extract matrix from an uninitialized objectcannot extract model matrix without formulacannot extract parameters of uninitialized objectcannot extract the dimensionscannot extract the inverse from an uninitialized objectcannot extract the log of the determinant from an uninitialized objectcannot extract the matrix from an uninitialized "pdCompSymm" objectcannot extract the matrix from an uninitialized "pdIdent" objectcannot extract the matrix from an uninitialized objectcannot extract the matrix with uninitialized dimensionscannot fix variances in all groupscannot get confidence intervals on var-cov components: %scannot get confidence intervals on var-cov components: %s Consider '%s'cannot get the inverse of an uninitialized objectcannot have duplicated column names in a "pdMat" objectcannot have zero distances in "corSpatial"cannot obtain constrained coefficients with uninitialized dimensionscannot omit grouping factor without 'form'cannot use an anonymous function for the modelcannot use smaller level of grouping for "correlation" than for "random". Replacing the former with the latter.cannot use smaller level of grouping for 'correlation' than for 'random'. Replacing the former with the latter.collapsing level cannot be smaller than display level; setting it to the display levelcomputed "gls" fit is singular, rank %sconstant in "varConstPower" structure must be > 0covariate must be a data framecovariate must be numericcovariate must have a level attribute when 'id' is a formulacovariate must have a level attribute when 'idLabels' is a formulacovariate must have a level attribute when groups are presentcovariate must have unique values within groups for "corAR1" objectscovariate must have unique values within groups for "corARMA" objectscovariate must have unique values within groups for "corCAR1" objectscovariate must have unique values within groups for "corNatural" objectscovariate must have unique values within groups for "corSymm" objectsdata argument to "data.frame" method for 'getGroups' does not make sensedata in %s call must evaluate to a data framedegrees of freedom and weights must have the same lengthdeviance undefined for REML fitdimnames of 'value' must match or be NULLdo not know how to calculate correlation matrix of %s objectdo not know how to get coefficients for %s objectdo not know how to obtain constrained coefficientsdo not know how to obtain parameters of %s objecteffect %s not matchedeffects %s not matchedelements in 'object' must be formulas or "pdMat" objectsfewer observations than random effects in all level %s groupsfirst argument to 'groupedData' must be a two-sided formulafirst argument to 'nfGroupedData' must be a two-sided formulafirst argument to 'nmGroupedData' must be a two-sided formulafirst model has a different response from the restfitted objects with different fixed effects. REML comparisons are not meaningful.fixed parameter names in 'varIdent' must be a subset of group namesfixed parameters must have group namesfixed parameters must have group names in 'varExp'fixed parameters must have group names in 'varPower'fixed parameters must have names in 'varIdent'fixed-effects model must be a formula of the form "resp ~ pred"formula(object) must return a formulaformulae in 'fixed' must be of the form "parameter ~ expr"formulae in 'params' must be of the form "parameter ~ expr"formulae in 'random' must be of the form "parameter ~ expr"group name not matched in starting values for random effects: %sgroup names not matched in starting values for random effects: %sgroups levels mismatch in 'random' and starting values for 'random' at level %signoring 'group' in "varFixed" formulaignoring argument 'form'ignoring argument 'nam'incompatible formulas for groups in "random" and "correlation"incompatible formulas for groups in 'random' and 'correlation'incompatible lengths for 'random' and grouping factorsincompatible lengths for object namesindividual %s was not used in the fitinitial value for "corLin" parameters of wrong dimensioninitial value for "corNatural" parameters of wrong dimensioninitial value for "corSpatial" parameters of wrong dimensioninitial value for "corSpher" parameters of wrong dimensioninitial value for "corSymm" parameters of wrong dimensioninitial value for "reStruct" overwritten in 'lme.lmList'initial value for "varExp" should be of length %dinitial value for "varExp" should be of length 1initial value for "varIdent" should be of length %dinitial value for "varPower" should be of length %dinitial value for "varPower" should be of length 1initial value for 'range' less than minimum distance. Setting it to 1.1 * min(distance)initial value for 'reStruct' overwritten in 'nlme.nlsList'initial value for parameter of wrong lengthinitial value in "corCompSymm" must be greater than %sinitial value of nugget ratio must be between 0 and 1initial value should be of length %dinitial values for "corNatural" do not define a positive-definite correlation structureinitial values for "corNatural" must be between -1 and 1initial values for "corSymm" do not define a positive-definite correlation structureinitial values for "corSymm" must be between -1 and 1initial values for 'varIdent' must be > 0initial values must have group names in 'varExp'initial values must have group names in 'varIdent'initial values must have group names in 'varPower'initializing "pdCompSymm" object is not positive definiteinstalled with old R versioninvalid formula for groupslength of 'nam' not consistent with dimensions of initial valuelevel %s not allowed for %slevels %s not allowed for %slevel of %s does not match formula %slist with starting values for random effects must have names or be of length %dlog-likelihood not available with NULL fitsmaximum number of iterations (lmeControl(maxIter)) reached without convergencemaximum number of iterations (maxIter = %d) reached without convergencemaximum number of iterations reached without convergencemismatch between group names and fixed values namesmissing call attribute in "nlsList" objectmodel formula must be of the form "resp ~ pred"model must be a formula of the form "resp ~ pred"models with "corStruct" and/or "varFunc" objects not allowedmore than one degree of freedom is needed when one them is zero.moving average order must be a non-negative integermultiple levels not allowedmust give names when initializing "pdCompSymm" from parameter without a formulamust give names when initializing "pdIdent" from parameter without a formulamust give names when initializing from matrix or parametermust have formula when no names are givennames being assigned do not correspond to a permutation of previous namesnames mismatch in 'random' and starting values for 'random' at level %snames of 'value' are not consistent with 'nam' argumentnames of object and value must matchnames of starting value for "varIdent" object must contain all but one of the stratum levelsneed an object with call componentneed data to calculate covariateneed data to calculate covariate of "corStruct" objectnegative degrees of freedom not allowedno coefficients to fitno condensed linear modelno default method for extracting the square root of a "pdMat" objectno degrees of freedom for estimating std. dev.no degrees of freedom specifiedno effects allowed in right side of formulano fitted "lme" objectno initial values for model parametersno model variogram available with 'showModel = TRUE'nonexistent group in 'newdata'nonexistent group names for initial valuesnonexistent group names for initial values in "varExp"nonexistent group names for initial values in "varPower"nonexistent group names for initial values in 'varIdent'nonexistent group requested in 'subset'nonexistent groups requested in 'subset'nonexistent level %snonexistent levels %snot (yet) implemented. Contributions are welcome; use intervals() instead (for now)not implemented for "nlme" objectsnot implemented for multiple levels of nestingnumber of columns in starting values for random component at level %s should be %dnumber of rows in starting values for random component at level %s should be %dobject formula must be of the form "resp ~ pred"object must inherit from "data.frame"object must inherit from class "gls"object must inherit from class "lmList"object must inherit from class "lme"objects must have a "call" component or attributeobjects must have coefficients with same row namesobjects must inherit from classes %s, or %sold-style self-starting model functions are no longer supported. New selfStart functions are available. Use SSfpl instead of fpl, SSfol instead of first.order.log, SSbiexp instead of biexp, SSlogis instead of logistic. If writing your own selfStart model, see "help(selfStart)" for the new form of the "initial" attribute.only one display level allowedonly one level allowed for predictionsonly one level allowed in 'gapply'only one level allowed in 'gsummary'only one level of grouping allowedonly residuals allowedonly residuals and random effects allowedonly single effects allowed in left side of 'form'only single level allowedparameter in "corCompSymm" structure must be < 1 in absolute valueparameter in AR(1) structure must be between -1 and 1parameter in CAR(1) structure must be between 0 and 1parameters in ARMA structure must be < 1 in absolute valueplot method only implemented for comparing modelsrange must be > 0 in "corSpher" initial valueright-hand side of first argument must be a conditional expressionsecond argument must be a groupedData objectsecond argument to 'groupedData' must inherit from data.frameshould not be used with R versionsome fitted objects deleted because response differs from the first modelstarting estimates must have names when 'params' is missingstarting values for parameters are not of the correct lengthstarting values for random effects must include group levelsstarting values for random effects should be a list, or a matrixstarting values for the 'fixed' component are not the correct lengthstarting values for the random components should be a list of matricesterm %s not matchedterms %s not matchedterms can only be integers or charactersterms must all have the same denominator DFundefined collapsing level %s for %sundefined display level %s for %sundefined group declared in 'subset'unique values of the covariate for "corSymm" objects must be a sequence of consecutive integersunique values of the covariate for "corNatural" objects must be a sequence of consecutive integerswrong group levelsx-y data to splom got botched somehowProject-Id-Version: R 3.6.0 / nlme-3.1-137 Report-Msgid-Bugs-To: bugs@r-project.org POT-Creation-Date: 2019-04-02 18:40 PO-Revision-Date: 2019-04-02 11:18+0200 Last-Translator: Detlef Steuer Language-Team: German Language: de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); "corStruct"-Objekt muss ein "fixed"-Attribut haben."pdMat"-Element muss eine Formel haben."pdMat"-Elemente müssen eine Formel haben%d Fehler abgefangen in %s: %s%d Mal denselben Fehler abgefangen in %s: %s%d Fehler abgefangen in %s. Die Fehlermeldungen und ihre Häufigkeiten sind%s und %s müssen die gleichen Gruppenstufen haben%s kann höchstens zwei Komponenten haben.%s kann nur eine Liste oder numerisch sein.%s kann nur die Namen "const" und "power" haben.%s ist kein gültiger Effektname%s ist kein gültiges Objekt für "pdMat".%s muss Gruppennamen in 'varConstPower' haben.%s nicht verfügbar für grafische Darstellung%s nicht verfügbar für grafische Darstellung%s nicht in Daten gefunden%s nicht in Daten gefunden%s nicht übereinstimmend%s nicht übereinstimmend%s Problem, Konvergenzfehlerkode = %s Nachricht = %s%s ohne "primary" kann nur für Anpassungen von "groupedData"-Objekten genutzt werden.'FUN' kann nur eine Funktion oder eine Liste von Funktionen sein.'Id' muss zwischen 0 und 1 liegen'L' muss zumindest %d Spalte haben:'L' muss zumindest %d Spalten haben:'Terms' müssen zwischen 1 und %d liegen.'asTable' kann nur mit balancierten 'groupedData'-Objekten benutzt werden'asTable' kann nicht mit mehrstufig gruppierten Daten benutzt werden'data' in %s muss sich zu einem Dataframe berechnen'data' muss ein "groupedData"-Objekt sein, wenn 'formula' keine Gruppen enthält.'data' muss ein "groupedData"-Objekt sein, falls 'groups'-Argument fehlt'data' muss explizit angegeben werden, um 'nls' zum Gewinnen von Initialschätzungen zu nutzen.'data' muss explizit angegeben werden, um 'nlsList' zu benutzen.'data' muss von der Klasse "groupedData" erben, falls 'random' keine Gruppen definiert.'distance' und 'object' haben inkompatible Längen'fixed' muss eine Formel oder eine Liste von Formeln sein.'form' und 'nam' haben inkompatible Längen'form' und 'pdClass' haben inkompatible Längen'form'-Argument muss eine Formel sein'form' kann nur eine Formel oder eine Liste von Formeln sein.'form' kann nur eine Formel oder eine Liste von Formeln sein.'form' muss eine Formel sein'form' muss eine Formel sein, wenn nicht NULL'form' muss eine Liste sein'form' muss eine einseitige Formel sein'form' muss eine zweiseitige Formel sein.'form' muss eine Kovariate haben.'form' muss alle Komponenten als Formeln enthalten.'form' nicht konsistent mit 'nam''id' kann nur eine Formel oder numerisch sein.'id' muss zwischen 0 und 1 liegen'idLabels' kann nur eine Formel oder eine Vektor sein.'idLabels' hat falsche Länge'lme.lmList' wird 'data' redefinieren'model' muss eine Formel sein.'nam' und 'pdClass' haben inkompatible Längen'nam' muss eine Liste sein'nint' ist nicht konsistent mit 'breaks''nlme.nlsList' wird 'fixed', 'data' und 'start' neu definierenInitialize() wurde nicht für »object« ausgeführt'object' muss eine Formel sein'object' muss eine Liste oder Formel sein'object' muss eine Liste sein, wenn es nicht fehlt, keine Matrix und nicht numerisch.'params' müssen eine Formel oder eine Liste von Formeln sein.'pdClass' muss ein Zeichenvektor sein'preserve' muss eine zweiseitige Formel sein'random' muss eine Formel oder eine Liste von Formeln sein.'range' im "corLin"-Anfangswert muss > 0 sein'range' muss im "corSpatial"-Anfangswert > 0 sein.'start' muss eine Komponente mit Namen 'fixed' haben.'subset' kann nur ein Zeichen oder eine ganze Zahl sein'subset' mit einzelnem Gruppierungsfaktor ignoriert'subset' muss eine Liste sein'sumLenSq := sum(table(groups)^2)' = %g ist zu groß. Zu große oder keine Gruppen in der Korrelationsstrujtur? 'sumLenSq' = %g ist zu groß (größer als maximale Integerzahl)'value' muss eine einseitige Formel sein.'value' muss eine quadratische Matrix sein'which' kann nur ein Buchstabe oder eine Ganzzahl sein.'which' muss zwischen 1 und %d liegen.AIC für REML Anpassung nicht definiertBitte 'msMaxIter' erhöhen!Iteration %d, LME Schritt: nlm() hat nicht konvergiert (Kode = %d).Iteration %d, LME Schritt: nlminb() hat nicht konvergiert (Kode = %d).L kann nur feste Effekte mit dem gleichen Nenner DF einschließenKeines der Argumente gibt mehr als einen Block anLänge von names sollte %d seinPORT Nachricht:PaketBesser mit dieser R Version erneut installieren.SD innerhalb der Gruppe muss positiver numerischer Wert seinAlle Argumente für 'varComb' müssen von der Klasse "varFunc" sein.Alle Elemente des Arguments müssen "pdMat"-Objekte generieren.Alle Elemente müssen eine Größe ungleich Null haben.Alle Elemente müssen Formeln habe, wenn irgendeins eine Formel hat.Alle Elemente müssen Namen habe, wenn irgendeins einen Namen hat.Alle Elemente der 'form'-Liste müssen zweiseitige Formeln sein.Alle Elemente eines "reStruct"-Objekts müssen eine Größe ungleich Null haben.Alle Elemente der Formel müssen eine Liste zweiseitiger Formeln oder zweiseitige Formeln sein.Alle gefitteten Objekte müssen die gleiche Schätzungsmethode haben.Alle gefitteten Objekte müssen die gleiche Zahl von Beobachtungen benutzen.Alle in 'formula' benutzten Variablen müssen in 'data' enthalten sein.Ein Objekt der Länge %d entspricht keinem Cholesky-FaktorEin Objekt der Länge %d entspricht nicht der benötigten Parametergröße.Argumente implizieren eine unterschiedliche Zahl von Blöckenmindestens zwei Koeffizienten werden benötigtAugmentation von zufälligen Effekten ist nur für einzelne Stufe verfügbarAutoregressive Ordnung muss eine nicht-negative Ganzzahl sein."varFunc"-Objekt kann nur aus anderem "varFunc", einer Formel oder einer Zeichenkette erstellt werden.Nur "lmList"-Objekte mit einzelner Gruppenvariable können angepasst werden.nur "lmList"-Objekte mit einzelner Gruppenvariable können angepasst werden.Auf die Matrix des Objekts kann ohne Namen nicht zugegriffen werden.Auf die Matrix der nicht initialisierten Objekten kann nicht zugegriffen werden.Auf die Spaltenanzahl nicht initialisierter Objekte kann ohne Namen nicht zugegriffen werden.REML Log-likelihood für "gnls"-Objekte kann nicht berechnet werden'form' kann nicht geändert werden.Koeffizienten können nicht vor der Initialisierung oder wenn alle Parameter fest sind geändert werden.Die Dimensionen eines initialisierten "pdMat"-Objekts können nicht geändert werden.Länge des initialisierten "pdMat"-Objekts kann nicht geändert werden.Parameterlänge eines initialisierten "varComb"-Objekts kann nicht geändert werdenParameterlänge von initialisierten Objekten kann nicht geändert werden.Länge von 'object' kann nicht geändert werden.Die Länge der Kovariate im "varFunc"-Objekt kann nicht geändert werden.Länge des Parameters "varExp" kann nach der Initialisierung nicht geändert werden.Länge des Parameters "varIdent" kann nach der Initialisierung nicht mehr geändert werden.Länge des Parameters "varStruct" kann nach der Initialisierung nicht geändert werden.Länge des Parameters kann nach der Initialisierung nicht geändert werden.Die Länge des Parameters eines "corAR1"-Objekts kann nicht geändert werden.Die Länge des Parameters eines "corARMA"-Objekts kann nicht geändert werden.Die Länge des Parameters eines "corCAR1"-Objekts kann nicht geändert werden.Die Länge des Parameters eines "corCompSymm"-Objekts kann nicht geändert werden.Die Länge des Parameters eines "corNatural"-Objekts kann nicht geändert werden.Die Länge des Parameters eines "corStruct"-Objekts kann nicht geändert werden.Die Länge des Parameters eines "corSymm"-Objekts kann nicht geändert werden.Die Anzahl der Spalten eines initialisierten Objekts kann nicht geändert werden.Der Parameter kann nicht geändert werden, wenn die Länge der Parameters nicht definiert ist.Der Parameter kann nicht geändert werden, wenn die Länge der Parameter undefiniert ist.kann pairs nicht mit nur einer Variablen durchführenGruppen für gewünschte Stufen auf 'newdata' können nicht ausgewertet werdenGruppenformel ohne eine Formel kann nicht extrahiert werden.Matrix kann nicht von einem nicht initialisierten Objekt extrahiert werden.Modellmatrix kann ohne Formel nicht extrahiert werden.Parameter eines nicht initialisierten Objekts können nicht extrahiert werden.Dimensionen können nicht extrahiert werden.Inverse eines nicht initialisierten Objekts kann nicht extrahiert werden.Der Logarithmus der Determinante eines nicht initialisierten Objekts kann nicht extrahiert werden.Matrix eines nicht initialisierten "pdCompSymm"-Objekts kann nicht extrahiert werdenMatrix eines nicht initialisierten "pdIdent"-Objekts kann nicht extrahiert werden.Matrix eines nicht initialisierten Objekts kann nicht extrahiert werden.Matrix mit nicht initialisierten Dimensionen kann nicht extrahiert werden.Varianzen können nicht in allen Gruppen festgehalten werden.Konfidenzintervalle für var-cov-Komponenten können nicht bestimmt werden: %sKonfidenzintervalle für var-cov-Komponenten können nicht bestimmt werden: %s Evtl. '%s'Inverse eines nicht initialisierten Objekts kann nicht bestimmt werdenIn "pdMat"-Objekten darf es keine doppelten Spaltennamen geben.Es darf keine Null-Distanzen in "corSpatial" gebenEingeschränkte Koeffizienten können nicht mit nicht initialisierten Dimensionen nicht erlangt werden.Gruppierungsfaktor ohne 'form' kann nicht weggelassen werden.eine anonyme Funktion kann für das Modell nicht benutzt werdenZur Gruppierung in "correlation" kann keine kleinere Stufe als für "random" benutzt werden. Ersteres wird durch letzteres ersetzt.Für die Gruppierung von 'correlation' kann keine kleinere Stufe als für 'random' benutzt werden. Ersteres wird durch letzteres ersetzt.Die Collapsing-Stufe kann nicht kleiner sein, als die Anzeigestufe; sie wird auf die Anzeigestufe gesetzt.errechneter "gls"-Fit ist singulär, Rang %sKonstante in "varConstPower"-Struktur muss > 0 sein.Kovariate muss ein Dataframe seinKovariate muss numerisch seinKovariate muss ein Stufenattribut haben, wenn 'id' eine Formel istKovariate muss ein Stufenattribut haben, wenn 'idLabels' eine Formel istKovariate muss ein Stufenattribut haben, wenn Gruppen vorhanden sindKovariate muss eindeutige Werte innerhalb der Gruppen für "corAR1-Objekte" haben.Kovariate muss eindeutige Werte innerhalb der Gruppen für "corARMA-Objekte" haben.Kovariate muss eindeutige Werte innerhalb der Gruppen für "corCAR1-Objekte" haben.Kovariate muss eindeutige Werte innerhalb der Gruppen für "corNatural-Objekte" haben.Kovariate muss eindeutige Werte innerhalb der Gruppen für "corSymm"-Objekte haben.Datenargument für "data.frame"-Methode für 'getGroups' nicht sinnvollDaten im %s-Aufruf müssen einen Dataframe ergebenFreiheitsgrade und Gewichte müssen die gleiche Länge haben.Devianz für REML Anpassung nicht definiertdimnames von 'value' müssen übereinstimmen oder NULL seinEs ist nicht bekannt, wie die Korrelationsmatrix des Objekts %s berechnet wird.nicht bekannt, wie Koeffizienten erlangt werden für %s-ObjektEs ist nicht bekannt, wie eingeschränkte Koeffizienten bestimmt werden können.Es ist nicht bekannt, wie Parameter des Objekts %s abgefragt werden.Effekt %s nicht übereinstimmendEffekte %s nicht übereinstimmendElemente in 'object' müssen Formeln oder "pdMat"-Objekte sein.weniger Beobachtungen als zufällige Effekte in allen Gruppen der Stufe %serstes Argument für 'groupedData' muss eine zweiseitige Formel seinerstes Argument für 'nfGroupedData' muss eine zweiseitige Formel seinerstes Argument für 'nmGroupedData' muss eine zweiseitige Formel seinerstes Modell hat eine vom Rest abweichende AntwortGefittete Objekte mit unterschiedlichen festen Effekten. REML Vergleiche haben keine Bedeutung.Feste Parameternamen in 'varIdent' müssen eine Teilmenge von Gruppennamen sein.Feste Parameter müssen Gruppennamen haben.Feste Parameter müssen Gruppennamen in 'varExp' haben.Feste Parameter müssen Gruppennamen in 'varPower' haben.Feste Parameter müssen in 'varIdent' Namen haben.Feste-Effekte-Modell muss eine Formel der Form "resp ~ pred" sein.Formel(Objekt) muss eine Formel zurückgeben.Formeln in 'fixed' müssen die Form "parameter ~ expr" haben.Formeln in 'params' müssen die Form "parameter ~ expr" haben.Formeln in 'random' müssen die Form "parameter ~ expr" haben.Gruppenname nicht zu Startwerten für Zufallseffekte passend: %sGruppennamen nicht zu Startwerten für Zufallseffekte passend: %sGruppenstufen stimmen in 'random' und in den Startwerten für 'random' auf Stufe %s nicht überein.'group' in "varFixed"-Formel wird ignoriert.Argument 'form' wird ignoriertArgument 'nam' wird ignoriertinkompatible Formeln für Gruppen in "random" und "correlation"inkompatible Formeln für Gruppen in 'random' und 'correlation'inkompatible Längen für 'random' und Gruppierungsfaktoreninkompatible Länge für ObjektnamenIndividuum %s wurde in der Anpassung nicht benutzt.Anfangswert für Parameter "corLin" hat falsche Dimension.Anfangswert für "corNatural"-Parameter hat falsche DimensionAnfangswert des Parameters "corSpatial" hat falsche DimensionAnfangswert für Parameter "corSpher" hat falsche DimensionAnfangswert für "corSymm"-Parameter hat falsche DimensionAnfangswert für "reStruct" in 'lme.lmList' überschriebenStartwert von "varExp" sollte Länge %d haben.Anfangswert für "varExp" sollte die Länge 1 haben.Startwert von "varIndent" sollte die Länge %d haben.Startwert von "varPower" sollte Länge %d haben.Anfangswert für "varPower" sollte die Länge 1 haben.Anfangswert für 'range' kleiner als minimale Distanz. Er wird auf 1.1 * min (distance) gesetzt.Anfangswert für 'reStruct' in 'nlme.nlsList' überschriebenAnfangswerte für Parameter hat falsche LängeAnfangswert in "corCompSymm" muss größer als %s sein.Anfangswert des Nugget-Anteils muss zwischen 0 und 1 liegenStartwert sollte Länge %d haben.Anfangswerte für "corNatural" definieren keine positiv-definite Korrelationsstruktur.Anfangswerte für "corNatural" müssen zwischen -1 und 1 liegen.Anfangswerte für "corSymm" definieren keine positiv-definite Korrelationsstruktur.Anfangswerte für "corSymm" müssen zwischen -1 und 1 liegen.Startwerte für 'varIdent' müssen > 0 sein.Anfangswerte müssen Gruppennamen in 'varExp' haben.Startwerte müssen Gruppennamen in 'varIdent' haben.Anfangswerte müssen Gruppennamen in 'varPower' haben.Initialisierendes "pdCompSymm"-Objekt ist nicht positiv-definitinstalliert mit alter R Versionungültige Formel für GruppenLänge von 'nam' nicht konsistent mit Dimensionen des StartwertsStufe %s nicht für %s erlaubtStufen %s nicht für %s erlaubtStufe von %s passt nicht zu Formel %sListe mit Startwerten für Zufallseffekte muss Namen haben oder %d lang sein.Log-likelihood nicht mit NULL-Fit verfügbarmaximale Anzahl der Iterationen (lmeControl(maxIter)) ohne Konvergenz erreichtmaximale Anzahl der Iterationen (maxIter = %d) ohne Konvergenz erreichtmaximale Anzahl der Iterationen ohne Konvergenz erreichtkeine Übereinstimmung zwischen Gruppennamen und festen Wertnamenfehlendes Aufrufattribut in "nlsList"-ObjektModell-Formel muss die Form "resp ~ pred" haben.Modell muss eine Formel der Form "resp ~ pred" sein.Modelle mit "corStruct"- und/oder "varFunc"-Objekten nicht erlaubtMehr als ein Freiheitsgrad wird benötigt, wenn einer von ihnen Null ist.Ordnung des gleitenden Durchschnitts muss eine nicht-negative Ganzzahl sein.mehrere Stufen nicht erlaubtWenn "pdCompSymm" über Parameter ohne eine Formel initialisiert wird, müssen Namen vergeben werden.Wenn "pdIdent" über Parameter ohne eine Formel initialisiert wird, müssen Namen gegeben werden.Namen müssen vergeben werden, wenn von Matrix oder Parameter initialisiert wirdmuss Formel haben, wenn keine Namen gegeben sindZugeordnete Namen entsprechen keiner Permutation vorheriger Namen.Namen in 'random' und in den Startwerten für 'random' auf Stufe %s passen nicht Namen von 'value' sind nicht mit dem Argument 'nam' konsistentNamen von Objekt und Wert müssen übereinstimmen.Die Namen des Startwerts für ein "varIdent"-Objekt müssen alles außer einer Schichtstufe enthalten.ein Objekt mit Aufruf-Komponenten wird benötigtUm Kovariate zu berechnen, werden Daten benötigt.Zur Berechnung der Kovariate des "corStruct"-Objekts werden Daten benötigt.negative Freiheitsgrade nicht erlaubtkeine Koeffizienten anzupassenkein zusammengefasstes lineares Modellkeine Standardmethode, um die Quadratwurzel eines "pdMat"-Objekts zu extrahierenkeine Freiheitsgrade für Schätzung von Standardabweichungkeine Freiheitsgrade angegebenkeine Effekte auf der rechten Seite der Formel erlaubtkein angepasstes "lme"-Objektkeine Anfangswerte für Modellparameterkein Modell-Variogramm mit 'showModel = TRUE' verfügbarnicht existierende Gruppe in 'newdata'Nicht existierende Gruppenamen für Startwertenicht existente Gruppennamen für Anfangswerte in "varExp"nicht existierende Gruppennamen für Anfangswerte in "varPower"nicht existente Gruppennamen für Startwerte in 'varIdent'nicht existierende Gruppe in 'subset' angefordert.nicht existierende Gruppen in 'subset' angefordertnicht existierende Stufe %snicht existierende Stufen %s(nocht) nicht implementiert. Beiträge sind willkommen; Für den Moment stattdessen intervals() nutzennicht für "nlme"-Objekte implementiertnicht für mehrstufige Schachtelung implementiertAnzahl der Spalten in Startwerten für Zufallskomponente auf Stufe %s sollte %d sein.Anzahl der Zeilen in Startwerten für Zufallskomponente auf Stufe %s sollte %d sein.Objekt-Formel muss von der Form "resp ~ pred" seinObjekt muss von "data.frame" erben.Objekt muss von der Klasse "gls" abgeleitet sein.Objekt muss von der Klasse "lmList" erben.Objekt muss von der Klasse "lme" erbenObjekte müssen eine "call"-Komponente oder -Attribut haben.Objekte müssen Koeffizienten mit gleichen Zeilennamen haben.Objekte müssen von den Klassen %s oder %s erbenSelbst-startende Model Funktionen im alten Stil werden nicht mehr unterstützt. Neue selbst-startende Funktionen sind verfügbar. Nutzen Sie SSfpl statt fpl, SSfol statt first.order.lag, SSbiexp statt biexp, SSlogis statt logistic. Um eigene selbst-startende Modelle zu implementieren, sehen Sie unter "help(selfStart)" die neue Form der "initial" Attribute nach.nur eine Anzeigestufe erlaubtnur eine Stufe für Vorhersagen erlaubtnur eine Stufe in 'gapply' erlaubtnur eine Stufe in 'gsummary' erlaubtnur eine Stufe der Gruppierung erlaubtnur Residuen erlaubtnur Residuen und zufällige Effekte erlaubtnur einzelne Effekte auf der linken Seite von 'form' erlaubtnur einzelne Stufe erlaubtParameter in "corCompSymm"-Struktur muss vom Betrag < 1 sein.Parameter in AR(1)-Struktur muss zwischen -1 und 1 liegenParameter in CAR(1)-Struktur muss zwischen 0 und 1 liegen.Parameter in ARMA-Struktur müssen vom Betrag < 1 sein.Plotmehtode nur für Modellvergleiche implementiertSpannweite im "corSpher"-Anfangswert muss > 0 sein.rechte Seite des ersten Arguments muss ein bedingter Ausdruck seinzweites Argument muss ein groupedData-Objekt seinzweites Argument für 'groupedData' muss von data.frame erbensollte nicht benutzt werden mit R Versioneinige gefittete Objekte gelöscht, da Antwort vom ersten Modell abweichtStartschätzung muss Namen haben, wenn 'params' fehltStartwerte für Parameter haben nicht die richtige Länge.Startwerte für Zufallseffekte müssen Gruppenstufen enthalten.Startwerte für Zufallseffekte sollten eine Liste oder eine Matrix sein.Startwerte für die Komponente 'fixed' haben nicht die richtige Länge.Startwerte für Zufallskomponenten sollten eine Liste von Matrizen sein.Term %s nicht übereinstimmendTerme %s nicht übereinstimmendTerme können nur Ganzzahlen oder Zeichen seinTerme müssen alle den gleichen Freiheitsgrad im Nenner habenCollapsing-Stufe %s für %s nicht definiertundefinierte Anzeigestufe %s für %sundefinierte Gruppe in 'subset' deklariertEindeutige Werte der Kovariate für "corSymm"-Objekte müssen eine Sequenz von aufeinander folgenden ganzen Zahlen sein.Eindeutige Werte der Kovariate für "corNatural"-Objekte müssen eine Sequenz von aufeinanderfolgenden ganzen Zahlen seinfalsche Gruppenstufenx-y-Daten an splom wurden irgendwie verpfuscht.nlme/inst/po/de/LC_MESSAGES/nlme.mo0000644000176200001440000000357613450712321016256 0ustar liggesusers | 4!!V3x70T'E|!98W/&9BK|3hI~)J@=    All parameters must be less than 1 in absolute valueCoefficient matrix not invertibleFirst observation on an individual must have a doseHaven't written the compound symmetry case for this yetOverfitted model!Singularity in backsolve at level %ld, block %ldUnable to form Cholesky decomposition: the leading minor of order %d is not pos.def.Unable to form eigenvalue-eigenvector decomposition [RS(.) ierr = %d]Unknown spatial correlation classanalytic gradient is not available with compound symmetryanalytic gradient is not available with matrix logarithmProject-Id-Version: R 3.6.0 / nlme 3.1-137 Report-Msgid-Bugs-To: POT-Creation-Date: 2019-04-02 18:40+0200 PO-Revision-Date: 2019-04-01 14:17+0200 Last-Translator: Detlef Steuer Language-Team: German Language: de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Der Betrag aller Parameter muss kleiner 1 sein.Koeffizientenmatrix nicht invertierbarErste Beobachtung eines Individuums muss eine Dosis habenFall von zusammengesetzter Symmetrie wurde für dies noch nicht geschriebenÜberangepasstes Modell!Singularität in backsolve auf Stufe %ld, Block %ldCholesky-Zerlegung kann nicht bestimmt werden: Führender Minor der Ordnung %d ist nicht positiv definitUnfähig eine Eigenwert-Eigenvektor-Zerlegung zu bilden [RS(.) ierr = %d]Unbekannte räumliche Korrelations-Klasseanalytischer Gradient ist nicht mit zusammengesetzter Symmetrie verfügbaranalytischer Gradient ist nicht mit Matrixlogarithmus verfügbarnlme/inst/po/pl/0000755000176200001440000000000012213262320013204 5ustar liggesusersnlme/inst/po/pl/LC_MESSAGES/0000755000176200001440000000000013450712324015001 5ustar liggesusersnlme/inst/po/pl/LC_MESSAGES/R-nlme.mo0000644000176200001440000012710713450712324016500 0ustar liggesusers6 |0 #:$^)" *$:+_;)6HF3@ !>B5/JE2Ex0O1?-q*.!2 3N  &  " " !+;! g!%!!,!!!"9"-S""&"9"#"#$6#G[#.#$#&#.$-M$1{$,$)$,%1%#I%m%(% %=%2&H&6e&:&&&6&/5'6e'='P'7+(;c(1(7(A )*K)$v)>)3)c*;r*<*0*1+JN+7++Q+98,<r,>,5,$$-9I-G-I-J.>`.>.?.?/C^/B/A/?'0<g0A0B0$)16N1/121+112F27d2F2C2@'36h373"3931447f4*4D4*5.95oh5o5VH6'61667<27Bo7=7D7E58E{8H8E 9HP9-989):<*:1g:2:1:,:8+;=d;;;=;=<2Z<C<&<2<4+=.`=?=%=:=;0>;l>>O+?&{???>?>@6Q@%@%@8@< A<JA:A9A8A15B0gB3B3B2CW3C:C+C6C5)D$_DWD8DTE5jE)E0E2E2.F9aFF?F8F%/GOUG+GNG8 H3YH*H/H1H<I@WI3IIOIL8J:J)JIJH4K7}K$K\K"7L ZL6{L'LLLD M.PMM+MM&M4 N>N*]N6N8N8N'1O(YO*O"O.OROORP0P%P$P'Q$FQ1kQ2QLQS&c7c6d:Vd#d?d?d15eBge e1e/e4-fKbf3f6f'g=Ag.g4g$g9hBh!bhVhEh2!i0Tiai8i/ j3Pj8j@jDj6CkDzkDk"l2'l0ZlCl+lWl<Sm#m]mEn1XnDn@nCoJTo_oGoHGp9p@pF q,Rq.qIq;qt4rSrTr9RsHsJsU t$vtctFtMFuMuAu1$vOVvGvIvJ8w>w@w@x@DxDxCxBy@Qy8yIyIz,_zAz1z@{4A{=v{!{D{J|Sf|P|@ }BL}3}F}> ~CI~5~U~5/Ouujk3ր1 +<%hPM߁D-brbՂb8ebTd:;P0674-%cSQK YU[[ 4gH.9;N6]*JJIJߊ*b'.֌::-?h%.΍@Q>DBՎNPg=<?3?s>kI^?@C)0m^C[AC4=?T>EӔN7k(dGcȖK,Fx9JVDISA9%{^bGc+=ך_:u1y)\_^(E%n%HDH9f37 ,5M@BğB,J6wLOWKef Jp-/)/C1sB/h26˥8,;h-=(>6Y58ƧQ8QB/ͨ]n[?ʩ@ QKMKL7f;3'*[.9{~kEtaB$6d~L!*!_@g[, }#m&- ?'iT/l|(0IvMDh KU2z+u> ;pS)xwqA1.o=,yP:81+6\ 7nN4.(  $&fJc/`5Y%-e'5H "j%)E]{CQ"3 0s9b^<2r 4VZW#3RO*kGFX"corStruct" object must have a "fixed" attribute"pdMat" element must have a formula"pdMat" elements must have a formula%s and %s must have the same group levels%s can have at most two components%s can only be a list or numeric%s can only have names "const" and "power"%s is not a valid effect name%s is not a valid object for "pdMat"%s must have group names in 'varConstPower'%s not available for plotting%s not available for plotting%s not found in data%s not found in data%s not matched%s not matched%s problem, convergence error code = %s message = %s%s without "primary" can only be used with fits of "groupedData" objects'FUN' can only be a function or a list of functions'Id' must be between 0 and 1'L' must have at most %d column'L' must have at most %d columns'Terms' must be between 1 and %d'asTable' can only be used with balanced 'groupedData' objects'asTable' cannot be used with multilevel grouped data'data' in %s call must evaluate to a data frame'data' must be a "groupedData" object if 'formula' does not include groups'data' must be a "groupedData" object if 'groups' argument is missing'data' must be given explicitly to use 'nls' to get initial estimates'data' must be given explicitly to use 'nlsList''data' must inherit from "groupedData" class if 'random' does not define groups'distance' and 'object' have incompatible lengths'fixed' must be a formula or list of formulae'form' and 'nam' have incompatible lengths'form' and 'pdClass' have incompatible lengths'form' argument must be a formula'form' can only be a formula or a list of formulae'form' can only be a formula, or a list of formulas'form' must be a formula'form' must be a formula when not NULL'form' must be a list'form' must be a one-sided formula'form' must be a two-sided formula'form' must have a covariate'form' must have all components as formulas'form' not consistent with 'nam''id' can only be a formula or numeric'id' must be between 0 and 1'idLabels' can only be a formula or a vector'idLabels' of incorrect length'lme.lmList' will redefine 'data''model' must be a formula'nam' and 'pdClass' have incompatible lengths'nam' must be a list'nint' is not consistent with 'breaks''nlme.nlsList' will redefine 'fixed', 'data', and 'start''object' has not been Initialize()d'object' must be a formula'object' must be a list or a formula'object' must be a list when not missing, not a matrix, and not numeric'params' must be a formula or list of formulae'pdClass' must be a character vector'preserve' must be a two-sided formula'random' must be a formula or list of formulae'range' must be > 0 in "corLin" initial value'range' must be > 0 in "corSpatial" initial value'start' must have a component called 'fixed''subset' can only be character or integer'subset' ignored with single grouping factor'subset' must be a list'value' must be a one sided formula'value' must be a square matrix'which' can only be character or integer'which' must be between 1 and %dL may only involve fixed effects with the same denominator DFLNone of the arguments specify more than one blockLength of names should be %dall arguments to 'varComb' must be of class "varFunc".all elements in the argument must generate "pdMat" objectsall elements must have a non-zero sizeall elements must have formulas when any has a formulaall elements must have names when any has namesall elements of 'form' list must be two-sided formulasall elements of a "reStruct" object must have a non-zero sizeall elements of formula must be list of two-sided formulae or two-sided formulaeall fitted objects must have the same estimation methodall fitted objects must use the same number of observationsall variables used in 'formula' must be in 'data'an object of length %d does not match a Cholesky factoran object of length %d does not match the required parameter sizearguments imply different number of blocksat least two coefficients are neededaugmentation of random effects only available for single levelautoregressive order must be a non-negative integercan only construct "varFunc" object from another "varFunc" object, a formula, or a character stringcan only fit "lmList" objects with single grouping variablecan only fit "nlsList" objects with single grouping variablecannot access the matrix of object without namescannot access the matrix of uninitialized objectscannot access the number of columns of uninitialized objects without namescannot calculate REML log-likelihood for "gnls" objectscannot change 'form'cannot change coefficients before initialization or when all parameters are fixedcannot change dimensions on an initialized "pdMat" objectcannot change parameter length of initialized "pdMat" objectcannot change parameter length of initialized "varComb" objectcannot change parameter length of initialized objectscannot change the length of 'object'cannot change the length of covariate in "varFunc" objectcannot change the length of the "varExp" parameter after initializationcannot change the length of the "varIdent" parameter after initializationcannot change the length of the "varStruct" parameter after initializationcannot change the length of the parameter after initializationcannot change the length of the parameter of a "corAR1" objectcannot change the length of the parameter of a "corARMA" objectcannot change the length of the parameter of a "corCAR1" objectcannot change the length of the parameter of a "corCompSymm" objectcannot change the length of the parameter of a "corNatural" objectcannot change the length of the parameter of a "corStruct" objectcannot change the length of the parameter of a "corSymm" objectcannot change the number of columns on an initialized objectcannot change the parameter when ength of parameters is undefinedcannot change the parameter when length of parameters is undefinedcannot do pairs of just one variablecannot evaluate groups for desired levels on 'newdata'cannot extract groups formula without a formulacannot extract matrix from an uninitialized objectcannot extract model matrix without formulacannot extract parameters of uninitialized objectcannot extract the dimensionscannot extract the inverse from an uninitialized objectcannot extract the log of the determinant from an uninitialized objectcannot extract the matrix from an uninitialized "pdCompSymm" objectcannot extract the matrix from an uninitialized "pdIdent" objectcannot extract the matrix from an uninitialized objectcannot extract the matrix with uninitialized dimensionscannot fix variances in all groupscannot get confidence intervals on var-cov components: %scannot get the inverse of an uninitialized objectcannot have duplicated column names in a "pdMat" objectcannot have zero distances in "corSpatial"cannot obtain constrained coefficients with uninitialized dimensionscannot omit grouping factor without 'form'cannot use an anonymous function for the modelcannot use smaller level of grouping for "correlation" than for "random". Replacing the former with the latter.cannot use smaller level of grouping for 'correlation' than for 'random'. Replacing the former with the latter.collapsing level cannot be smaller than display level; setting it to the display levelcomputed "gls" fit is singular, rank %sconstant in "varConstPower" structure must be > 0covariate must be a data framecovariate must be numericcovariate must have a level attribute when 'id' is a formulacovariate must have a level attribute when 'idLabels' is a formulacovariate must have a level attribute when groups are presentcovariate must have unique values within groups for "corAR1" objectscovariate must have unique values within groups for "corARMA" objectscovariate must have unique values within groups for "corCAR1" objectscovariate must have unique values within groups for "corNatural" objectscovariate must have unique values within groups for "corSymm" objectsdata argument to "data.frame" method for 'getGroups' does not make sensedata in %s call must evaluate to a data framedegrees of freedom and weights must have the same lengthdimnames of 'value' must match or be NULLdo not know how to calculate correlation matrix of %s objectdo not know how to get coefficients for %s objectdo not know how to obtain constrained coefficientsdo not know how to obtain parameters of %s objecteffect %s not matchedeffects %s not matchedelements in 'object' must be formulas or "pdMat" objectsfewer observations than random effects in all level %s groupsfirst argument to 'groupedData' must be a two-sided formulafirst argument to 'nfGroupedData' must be a two-sided formulafirst argument to 'nmGroupedData' must be a two-sided formulafirst model has a different response from the restfixed parameter names in 'varIdent' must be a subset of group namesfixed parameters must have group namesfixed parameters must have group names in 'varExp'fixed parameters must have group names in 'varPower'fixed parameters must have names in 'varIdent'fixed-effects model must be a formula of the form "resp ~ pred"formula(object) must return a formulaformulae in 'fixed' must be of the form "parameter ~ expr"formulae in 'params' must be of the form "parameter ~ expr"formulae in 'random' must be of the form "parameter ~ expr"group name not matched in starting values for random effects: %sgroup names not matched in starting values for random effects: %sgroups levels mismatch in 'random' and starting values for 'random' at level %signoring 'group' in "varFixed" formulaignoring argument 'form'ignoring argument 'nam'incompatible formulas for groups in "random" and "correlation"incompatible formulas for groups in 'random' and 'correlation'incompatible lengths for 'random' and grouping factorsincompatible lengths for object namesindividual %s was not used in the fitinitial value for "corLin" parameters of wrong dimensioninitial value for "corNatural" parameters of wrong dimensioninitial value for "corSpatial" parameters of wrong dimensioninitial value for "corSpher" parameters of wrong dimensioninitial value for "corSymm" parameters of wrong dimensioninitial value for "reStruct" overwritten in 'lme.lmList'initial value for "varExp" should be of length %dinitial value for "varExp" should be of length 1initial value for "varIdent" should be of length %dinitial value for "varPower" should be of length %dinitial value for "varPower" should be of length 1initial value for 'range' less than minimum distance. Setting it to 1.1 * min(distance)initial value for 'reStruct' overwritten in 'nlme.nlsList'initial value for parameter of wrong lengthinitial value in "corCompSymm" must be greater than %sinitial value of nugget ratio must be between 0 and 1initial value should be of length %dinitial values for "corNatural" do not define a positive-definite correlation structureinitial values for "corNatural" must be between -1 and 1initial values for "corSymm" do not define a positive-definite correlation structureinitial values for "corSymm" must be between -1 and 1initial values for 'varIdent' must be > 0initial values must have group names in 'varExp'initial values must have group names in 'varIdent'initial values must have group names in 'varPower'initializing "pdCompSymm" object is not positive definiteinvalid formula for groupslength of 'nam' not consistent with dimensions of initial valuelevel %s not allowed for %slevels %s not allowed for %slevel of %s does not match formula %slist with starting values for random effects must have names or be of length %dlog-likelihood not available with NULL fitsmaximum number of iterations (lmeControl(maxIter)) reached without convergencemaximum number of iterations reached without convergencemismatch between group names and fixed values namesmissing call attribute in "nlsList" objectmodel formula must be of the form "resp ~ pred"model must be a formula of the form "resp ~ pred"models with "corStruct" and/or "varFunc" objects not allowedmore than one degree of freedom is needed when one them is zero.moving average order must be a non-negative integermultiple levels not allowedmust give names when initializing "pdCompSymm" from parameter without a formulamust give names when initializing "pdIdent" from parameter without a formulamust give names when initializing from matrix or parametermust have formula when no names are givennames being assigned do not correspond to a permutation of previous namesnames mismatch in 'random' and starting values for 'random' at level %snames of 'value' are not consistent with 'nam' argumentnames of object and value must matchnames of starting value for "varIdent" object must contain all but one of the stratum levelsneed an object with call componentneed data to calculate covariateneed data to calculate covariate of "corStruct" objectnegative degrees of freedom not allowedno coefficients to fitno condensed linear modelno default method for extracting the square root of a "pdMat" objectno degrees of freedom for estimating std. dev.no degrees of freedom specifiedno effects allowed in right side of formulano fitted "lme" objectno initial values for model parametersno model variogram available with 'showModel = TRUE'nonexistent group in 'newdata'nonexistent group names for initial valuesnonexistent group names for initial values in "varExp"nonexistent group names for initial values in "varPower"nonexistent group names for initial values in 'varIdent'nonexistent group requested in 'subset'nonexistent groups requested in 'subset'nonexistent level %snonexistent levels %snot implemented for "nlme" objectsnot implemented for multiple levels of nestingnumber of columns in starting values for random component at level %s should be %dnumber of rows in starting values for random component at level %s should be %dobject formula must be of the form "resp ~ pred"object must inherit from "data.frame"object must inherit from class "gls"object must inherit from class "lmList"object must inherit from class "lme"objects must have a "call" component or attributeobjects must have coefficients with same row namesold-style self-starting model functions are no longer supported. New selfStart functions are available. Use SSfpl instead of fpl, SSfol instead of first.order.log, SSbiexp instead of biexp, SSlogis instead of logistic. If writing your own selfStart model, see "help(selfStart)" for the new form of the "initial" attribute.only one display level allowedonly one level allowed for predictionsonly one level allowed in 'gapply'only one level allowed in 'gsummary'only one level of grouping allowedonly residuals allowedonly residuals and random effects allowedonly single effects allowed in left side of 'form'only single level allowedparameter in "corCompSymm" structure must be < 1 in absolute valueparameter in AR(1) structure must be between -1 and 1parameter in CAR(1) structure must be between 0 and 1parameters in ARMA structure must be < 1 in absolute valueplot method only implemented for comparing modelsrange must be > 0 in "corSpher" initial valueright-hand side of first argument must be a conditional expressionsecond argument must be a groupedData objectsecond argument to 'groupedData' must inherit from data.framesome fitted objects deleted because response differs from the first modelstarting estimates must have names when 'params' is missingstarting values for parameters are not of the correct lengthstarting values for random effects must include group levelsstarting values for random effects should be a list, or a matrixstarting values for the 'fixed' component are not the correct lengthstarting values for the random components should be a list of matricesterm %s not matchedterms %s not matchedterms can only be integers or charactersterms must all have the same denominator DFundefined collapsing level %s for %sundefined display level %s for %sundefined group declared in 'subset'unique values of the covariate for "corSymm" objects must be a sequence of consecutive integersunique values of the covariate for "corNatural" objects must be a sequence of consecutive integerswrong group levelsx-y data to splom got botched somehowProject-Id-Version: nlme 3.1-115 Report-Msgid-Bugs-To: bugs@r-project.org POT-Creation-Date: 2019-04-02 18:40 PO-Revision-Date: 2014-03-25 17:00+0100 Last-Translator: Łukasz Daniel Language-Team: Łukasz Daniel Language: pl_PL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); X-Poedit-SourceCharset: iso-8859-1 X-Generator: Poedit 1.5.4 X-Poedit-Bookmarks: -1,-1,-1,72,-1,-1,-1,-1,-1,-1 obiekt "corStruct" musi posiadać atrybut "fixed".element "pdMat" musi posiadać formułęelementy "pdMat" muszą posiadać formułę%s oraz %s muszą mieć te same poziomy grup%s może posiadać najwyżej dwa komponenty%s może być jedynie listą lub liczbą%s może posiadać jedynie nazwy "const" oraz "power"%s nie jest poprawną nazwą efektu%s nie jest poprawnym obiektem dla klasy "pdMat"%s musi posiadać nazwy grup w 'varConstPower'%s nie jest dostępne do rysowania%s nie są dostępne do rysowania%s nie są dostępne do rysowania%s nie został znaleziony w danych%s nie zostały znalezione w danych%s nie zostały znalezione w danychczłon %s nie został dopasowanyczłony %s nie zostały dopasowaneczłony %s nie zostały dopasowaneproblem %s, kod błędu zbieżności = %s komunikat = %s%s bez "primary" może być użyte jedynie z dopasowaniami obiektów "groupedData"argument 'FUN' może być jedynie funkcją lub listą funkcjiargument 'id' musi być pomiędzy 0 a 1'L' musi mieć co najwyzej %d kolumnę'L' musi mieć co najwyzej %d kolumny'L' musi mieć co najwyzej %d kolumnargument 'Terms' musi być pomiędzy 1 a %dfunkcja 'asTable()' może być użyta jedynie ze zbalansowanymi obiektami klasy "groupedData"funkcja 'asTable()' nie może być użyta z wielopoziomowymi zgrupowanymi danymiargument 'data' w wywołaniu %s musi wyliczać się do ramki danychargument 'data' musi być obiektem klasy "groupedData" jeśli argument 'fomula' nie zawiera grupargument 'data' musi być obiektem klasy "groupedData" jeśli brakuje argumentu 'groups' argument 'data' musi być podany bezpośrednio aby użyć 'nls()' w celu uzyskania początkowych oszacowańargument 'data' musi być podane bezpośrednio aby użyć funkcji 'nlsList()'argument 'data' musi być obiektem klasy "groupedData" jeśli argument 'random' nie określa grupargumenty 'distance' oraz 'object' mają niespójne długościargument 'fixed' musi być formułą lub listą formułargumenty 'form' oraz 'nam' mają niezgodne długościargumenty 'form' oraz 'pdClass' mają niezgodne długościargument 'form' musi być formułąargument 'form' może być jedynie formułą lub listą formułargument 'form' może być jedynie formułą lub listą formułargument 'form' nie jest obiektem klasy "formula"argument 'form' musi być formułą, gdy nie jest wartością NULLargument 'form' musi być listąargument 'form' musi być jednostronną formułąargument 'form' musi być dwustronną formułąargument 'form' musi posiadać zmienną niezależnąargument 'form' musi mieć wszystkie komponenty przedstawione jako formułyargument 'form' nie jest spójny z argumentem 'nam'argument 'id' może być jedynie formułą lub liczbąargument 'id' musi być pomiędzy 0 a 1argument 'IdLabels' może być jedynie formułą lub wektoremargument 'IdLabels' ma niepoprawną długośćfunkcja 'lme.lmList()' przedefiniuje argument 'data'argument 'model' musi być formułąargumenty 'nam' oraz 'pdClass' mają niezgodne długościargument 'nam' musi być listą'nint' jest niespójne z 'breaks'funkcja 'nlme.nlsList()' ponownie przedefiniuje argumenty 'fixed', 'data' oraz 'start'argument 'object' nie został zainicjalizowany metodą 'Initialize()'argument 'model' nie jest obiektem klasy "formula"argument 'object' musi być listą lub formułąargument 'object' musi być listą, gdy nie jest brakujący, nie jest macierzą, ani też liczbąargument 'params' musi być formułą lub listą formułargument 'pdClass' musi być wektorem tekstowymargument 'preserve' musi być dwustronną formułąargument 'random' musi być formułą lub listą formułargument 'range' musi być > 0 w początkowej wartości "corLin"argument 'range' musi być > 0 w początkowej wartości "corSpatial"argument 'start' musi mieć komponent o nazwie 'fixed'argument 'subset' może być jedynie znakiem lub liczbą całkowitąargument 'subset' został zignorowany z jednym czynnikem grupującymargument 'subset' musi być listąargument 'value' musi być jednostronną formułąargument 'value' musi być kwadratową macierząargument 'which' może być jedynie tekstem lub liczbą całkowitąargument 'which' musi być pomiędzy 1 a %d'L' może zawierać jedynie stałe efekty z tą samą liczbą stopni swobody mianownikażaden z argumentów nie określa więcej niż jednego blokuDługość nazw powinna wynosić %dwszystkie argumenty przekazywane do funkcji 'varComb()' muszą być obiektami klasy "varFunc"wszystkie elementy w argumencie muszą tworzyć obiekty klasy "pdMat"wszystkie elementy muszą mieć niezerowy rozmiarwszystkie elementy muszą mieć formułę, gdy którykolwiek posiadawszystkie elementy muszą mieć nazwy, gdy którykolwiek posiadawszystkie elementy listy 'form' muszą być dwustronnymi formułamiwszystkie elementy obiektu klasy "reStruct" muszą mieć niezerowy rozmiarwszystkie elementy formuły muszą być listą dwustronnych formuł lub dwustronnymi formułamiwszystkie dopasowane obiekty muszą mieć tę samą metodę oszacowaniawszystkie dopasowane obiekty muszą używać tej samej liczby obserwacjiwszystkie zmienne użyte w 'formula' muszą być w 'data'obiekt o długości %d nie zgadza się z czynnikiem Cholesky'egoobiekt o długości %d nie zgadza się z wymaganym rozmiarem parametruargumenty sugerują różną liczbę blokówprzynajmniej dwa współczynniki są potrzebnerozszerzenie efektów losowych dostępne jedynie dla pojedynczego poziomurząd autoregresji musi być nieujemną liczbą całkowitąmożna stworzyć jedynie obiekt klasy "varFunc" z innego obiektu klasy "varFunc", formuły lub łańcucha tekstowegomożna dopasować jedynie obiekty klasy "lmList" z pojedynczą zmienną grupującąmożna dopasować jedynie obiekty klasy "nlsList" z pojedynczą zmienną grupującąnie można uzyskać dostępu do macierzy obiektu bez nazwnie można uzyskać dostępu do macierzy niezainicjalizowanych obiektównie można uzyskać liczby kolumn niezainicjalizowanych obiektów bez nazwnie można obliczyć REML logarytmu funkcji wiarygodności dla obiektów klasy "gnls"nie można zmienić argumentu 'form'nie można zmienić współczynników przed zainicjowaniem lub gdy wszystkie parametry są ustalonenie można zmienić wymiarów zainicjalizowanego obiektu klasy "pdMat"nie można zmienić długości parametru zainicjowanego obiektu klasy "pdMat"nie można zmienić długości parametru zainicjalizowanego obiektu "varComb"nie można zmienić długości parametru zainicjowanych obiektównie można zmienić długości argumentu 'object'nie można zmienić długości zmiennej niezależnej w obiekcie klasy "varFunc"nie można zmienić długości parametru "varExp" po jego zainicjowaniunie można zmienić długości parametru "varIdent" po jego zainicjowaniunie można zmienić długości parametru "varStruct" po jego zainicjowaniunie można zmienić długości parametru po jego zainicjowaniunie można zmienić długości parametru obiektu klasy "corCAR1"nie można zmienić długości parametru obiektu klasy "corARMA"nie można zmienić długości parametru obiektu klasy "corCAR1"nie można zmienić długości parametru obiektu klasy "corCompSymm"nie można zmienić długości parametru obiektu klasy "corNatural"nie można zmienić długości parametru obiektu klasy "corStruct"nie można zmienić długości parametru obiektu klasy "corSymm"nie można zmienić liczby kolumn zainicjowanego obiektunie można zmienić parametru gdy długość parametru jest nieokreślonanie można zmienić parametru gdy długość parametru jest nieokreślonanie można zrobić par tylko jednej zmiennejnie można wyznaczyć grup dla pożądanych poziomów w 'newdata'nie można wyodrębnić formuł grup bez formułynie można wyodrębnić macierzy z niezainicjalizowanego obiektunie można wyodrębnić macierzy modelu bez formułynie można wyodrębnić parametrów niezainicjowanego obiektunie można wyodrębnić wymiarównie można wyodrębnić odwrotności z niezainicjalizowanego obiektunie można wyodrębnić logarytmu macierzy z niezainicjalizowanego obiektunie można wyodrębnić macierzy z niezainicjalizowanego obiektu klasy "pdCompSymm"nie można wyodrębnić macierzy z niezainicjalizowanego obiektu klasy "pdIdent"nie można wyodrębnić macierzy z niezainicjalizowanego obiektunie można wyodrębnić macierzy z niezainicjalizowanymi wymiaraminie można ustalić wariancji we wszystkich grupachnie można uzyskać przedziałów ufności na komponentach var-cov: %snie można uzyskać odwrotności niezainicjalizowanego obiektunie można mieć powtórzonych nazw kolumn w obiekcie klasy "pdMat"nie można mieć zerowych odległości w "corSpatial"nie można uzyskać ograniczonych współczynników z niezainicjalizowanych wymiarównie można pominąć czynnika grupującego bez 'form'nie można użyć anonimowej funkcji dla modelunie można użyć mniejszego poziomu grupowania dla "correlation" niż dla "random". Zastępowanie pierwszego drugim.nie można użyć mniejszego poziomu grupowania dla 'correlation' niż dla 'random'. Zastępowanie pierwszego drugim.poziom zapadania nie może być mniejszy niż poziom wyświetlania; ustawianie go do poziomu wyświetlaniaobliczone dopasowanie "gls" jest osobliwe, ranga %sstała w strukturze "varConstPower" musi być > 0zmienna niezależna musi być ramką danychzmienna niezależna musi być liczbązmienna niezależna musi mieć atrybut poziomu, gdy argument 'id' jest formułązmienna niezależna musi mieć atrybut poziomu, gdy 'idLabels' jest formułązmienna niezależna musi mieć atrybut poziomu, gdy grupy są obecnezmienna wyjaśniająca musi mieć unikalne wartości w obrębie grup dla obiektów klasy "corCAR1"zmienna wyjaśniająca musi mieć unikalne wartości w obrębie grup dla obiektów klasy "corARMA"zmienna wyjaśniająca musi mieć unikalne wartości w obrębie grup dla obiektów klasy "corCAR1"zmienna wyjaśniająca musi mieć unikalne wartości w obrębie grup dla obiektów klasy "corNatural"zmienna wyjaśniająca musi mieć unikalne wartości w obrębie grup dla obiektów klasy "corSymm"argument danych przekazywany do metody 'data.frame()' dla 'getGroups()' nie ma sensudane w wywołaniu %s muszą wyliczać się do ramki danychstopnie swobody oraz wagi muszą mieć tę samą długośćnazwy wymiarów argumentu 'value' muszą się zgadzać lub być wartością NULLnie wiadomo jak policzyć macierz korelacji obiektu %snie wiadomo jak uzyskać współczynniki dla obiektu %snie wiadomo jak uzyskać ograniczone współczynnikinie wiadomo jak uzyskać parametry obiektu %sefekt %s nie został dopasowanyefekty %s nie zostały dopasowaneefekty %s nie zostały dopasowaneelementy w argumencie 'object' muszą być formułami lub obiektami klasy "pdMat"mniej obserwacji niż losowych efektów we wszystkich grupach w poziomie %spierwszy argument przekazywany do funkcji 'groupedData()' musi być dwustronną formułąpierwszy argument przekazywany do funkcji 'nmGroupedData()' musi być dwustronną formułąpierwszy argument przekazywany do funkcji 'nmGroupedData()' musi być dwustronną formułąpierwszy model ma inną zmienną zależną od resztyustalone nazwy parametrów w 'varIdent' muszą być podzbiorem nazw grupustalone parametry muszą posiadać nazwy grupustalone parametry muszą posiadać nazwy grup w 'varExp'ustalone parametry muszą posiadać nazwy grup w 'varPower'ustalone parametry muszą posiadać nazwy w 'varIdent'model stałych efektów musi być formułą o formie "zmienna zależna ~ zmienna niezależna"'formuła(obiekt)' musi zwracać formułęformuły w argumencie 'fixed' muszą mieć formę "parametr ~ wyrażenie".formuły w argumencie 'param' muszą mieć formę "parametr ~ wyrażenie"formuły w argumencie 'random' muszą mieć formę "parametr ~ wyrażenie"nazwa grupy nie zgadza się z początkowymi wartościami dla efektów losowych: %snazwy grup nie zgadzają się z początkowymi wartościami dla efektów losowych: %snazwy grup nie zgadzają się z początkowymi wartościami dla efektów losowych: %spoziomy grup nie zgadzają się w 'random' oraz początkowych wartościach 'random' na poziomie %sIgnorowanie 'group' w formule klasy "varFixed"ignorowanie argumentu 'form'ignorowanie argumentu 'nam'niespójne formuły dla grup w "random" oraz "correlation"niespójne formuły dla grup w 'random' oraz 'correlation'niespójne długości dla 'random' oraz czynników grupującychniezgodne długości dla nazw obiektujednostka %s nie została użyta w dopasowaniupoczątkowa wartość parametrów "corLin" ma niepoprawny wymiarpoczątkowe wartości dla parametrów "corNatural" posiadają niepoprawne wymiarypoczątkowa wartość parametrów "corSpatial" ma niepoprawny wymiarpoczątkowa wartość parametrów "corSpher" ma niepoprawny wymiarpoczątkowe wartości dla parametrów "corSymm" posiadają niepoprawne wymiarypoczątkowa wartość dla "reStruct" została nadpisana w funkcji 'lme.lmList()'początkowa wartość dla "varExp" powinna być długości %dpoczątkowa wartość dla "varExp" powinna być długości 1początkowa wartość dla "varIdent" powinna być długości %dpoczątkowa wartość dla "varPower" powinna być długości %dpoczątkowa wartość dla "varPower" powinna być długości 1początkowa wartość 'range' mniejsza niż minimalna odległość. Ustawianie jej na '1.1 * min(distance)'początkowa wartość dla 'reStruct' nadpisana w funkcji 'nlme.nlsList()'początkowa wartość parametru posiada niepoprawną długośćpoczątkowa wartość w "corCompSymm" musi być większa niż %spoczątkowa wartość proporcji samorodka musi być pomiędzy 0 a 1początkowa wartość powinna być długości %dpoczątkowe wartości dla "corNatural" nie definiują dodatnio określonej strukture korelacjipoczątkowe wartości dla "corNatural" muszą być pomiędzy -1 a 1początkowe wartości dla "corSymm" nie definiują dodatnio określonej struktury korelacjipoczątkowe wartości dla "corNatural" muszą być pomiędzy -1 a 1początkowe wartości dla 'varIdent' muszą być > 0początkowe wartości muszą posiadać nazwy grupy w 'varExp'początkowe wartości muszą posiadać nazwy grupy w 'varIdent'początkowe wartości muszą posiadać nazwy grup w 'varPower'inicjalizowany obiekt klasy "pdCompSymm" nie jest dodatnio określonyniepoprawna formuła dla grupdługość argumentu 'nam' nie jest spójna z wymiarami początkowej wartościpoziom %s nie jest dozwolony dla %spoziomy %s nie są dozwolone dla %spoziomy %s nie są dozwolone dla %spoziom %s nie zgadza się z formułą %slista z początkowymi wartościami dla efektów losowych musi zawierać nazwy lub być długości %dlogarytm funkcji wiarygodności nie jest dostępny z dopasowaniami NULLmaksymalna liczba iteracji ('lmeControl(maxIter)') została osiągnięta bez uzyskania zbieżnościmaksymalna liczba iteracji została osiągnięta bez uzyskania zbieżnościniezgodność pomiędzy nazwami grup oraz nazwami ustalonych wartościbrakuje wywoływanego atrybutu w obiekcie klasy "nlsList"formuła modelu musi mieć formę "zmienna zależna ~ zmienna niezależna"argument 'model' musi być formułą o formie "zmienna zależna ~ zmienna niezależna"modele z obiektami klasy "corStruct" oraz/lub "varFunc" nie są dozwolonewięcej niż jeden stopień swobody jest potrzebny jeśli jeden człon wynosi zero.rząd średniej ruchomej musi być nieujemną liczbą całkowitąwielokrotne poziomy nie są dozwolonenazwy są wymagane podczas inicjalizowania obiektu klasy "pdCompSymm" z parametru bez formułynazwy są wymagane gdy występuje inicjalizowanie obiektu klasy "pdIdent" z parametru bez formułynazwy są wymagane, gdy następuje inicjowanie z macierzy lub parametruformuła jest wymagana, gdy nie podano nazwprzypisane nazwy nie odpowiadają permutacji poprzednich nazwnazwy nie zgadzają się w 'random' oraz początkowych wartościach dla 'random' na poziomie %snazwy argumentu 'value' nie są spójne z argumentem 'nam'nazwy obiektu oraz wartości muszą się zgadzaćnazwy wartości początkowych dla obiektu klasy "varIdent" muszą zawierać wszystkie oprócz jednego z poziomów warstwywymagany jest obiekt z komponentem 'call'argument 'data' jest wymagany aby wyliczyć zmienną wyjaśniającą obiektu klasy "corSpatial"argument 'data' jest wymagany aby wyliczyć zmienną wyjaśniającą obiektu klasy "corStruct"ujemne stopnie swobody nie są dozwolonebrak współczynników do dopasowaniabrak skondensowanego modelu liniowegobrak domyślnej metody dla uzyskania pierwiastka z obiektu klasy "pdMat"brak stopni swobody na potrzeby oszacowania odchylenia standardowegonie określono stopni swobodynie są dozwolone żadne efekty po prawej stronie fomułybrak dopasowanego obiektu "lme"brak początkowych wartości dla parametrów modelubrak dostępnego modelu wariogramu w 'showModel = TRUE'nieistniejąca grupa w 'newdata'nieistniejące nazwy grup dla początkowych wartościnieistniejące nazwy grup dla początkowych wartości w "varExp"nieistniejące nazwy grup dla początkowych wartości w "varPower"nieistniejące nazwy grup dla początkowych wartości w 'varIdent'zażądano nieistniejącej grupy w 'subset'.zażądano nieistniejących grup w argumencie 'subset'nieistniejący poziom %snieistniejące poziomy %snieistniejące poziomy %sfunkcja 'getVarCov.lme()' nie jest zaimplementowana dla obiektów klasy "nlme"funkcja 'getVarCov.lme()' nie jest zaimplementowana dla wielu poziomów zagnieżdżenialiczba kolumn w wartościach początkowych dla losowego komponentu na poziomie %s powinna wynosić %dliczba wierszy w wartościach początkowych dla losowego komponentu na poziomie %s powinna wynosić %dformuła modelu musi mieć formę "zmienna zależna ~ zmienna niezależna"obiekt musi dziedziczyć z klasy "data.frame"argument 'object' nie jest obiektem klasy "gls"argument nie jest obiektem klasy "lmList"argument 'object' nie jest obiektem klasy "lme"obiekty muszą mieć komponent 'call' lub atrybutobiekty muszą mieć współczynniki z tymi samymi nazwami wierszysamoinicjujące się funkcje modelu starego stylu nie są już dłużej wspierane Brak dostępnych funkcji 'selfStart'. Użyj 'SSfpl' zamiast 'fpl', 'SSfol' zamiast 'first.order.log', 'SSbiexp' zamiast 'biexp', 'SSlogis' zamiast 'logistic'. Jeśli piszesz swój własny model 'selfStart', zobacz 'help(selfStart)' aby uzyskać informację o nowej formie atrybutu 'initial'.tylko jeden poziom wyświetlenia jest dozwolonytylko jeden poziom jest dozwolony dla przewidywańtylko jeden poziom jest dozwolony w funkcji 'gapply()'tylko jeden poziom jest dostępny w funkcji 'gsummary()'tylko jeden poziom grupowania jest dozwolonyjedynie reszty są dozwolonetylko reszty oraz efekty losowe są dozwolonetylko pojedynczy efekt jest dozwolony po lewej stronie 'form'jedynie pojedynczy poziom jest dozwolonyparametr w strukturze "corCompSymm" musi być pomiędzy -1 a 1parametr w strukturze AR(1) musi być pomiędzy -1 a 1parametr w strukturze AR(1) musi być pomiędzy 0 a 1parametry w strukturze ARMA muszą być pomiędzy -1 a 1metoda rysująca wykres została zaimplementowana jedynie do porównywania modelizakres musi być > 0 w początkowej wartości "corShere"prawa strona pierwszego argumentu musi być wyrażeniem warunkowymdrugi argument musi być obiektem "groupedData"drugi argument przekazywany do funkcji 'groupedData()' musi dziedziczyć z klasy "data.frame"niektóre dopasowane obiekty zostały usunięte ponieważ zmienne zależne różnią się od pierwszego modelupoczątkowe oszacowania muszą mieć nazwy gdy brakuje 'params'wartości początkowe parametrów nie mają poprawnej długościwartości początkowe dla losowych efektów muszą zawierać w sobie poziomy gruppoczątkowe wartości dla efektów losowych powinny być listą lub macierząpoczątkowe wartości dla komponentu 'fixed' nie mają poprawnej długościwartości początkowe dla losowych komponentów powinny być listą macierzyczłon %s nie został dopasowanyczłony %s nie zostały dopasowaneczłony %s nie zostały dopasowaneczłony mogą być tylko liczbami całkowitymi lub tekstamiwszystkie człony muszą mieć ten sam mianownik DFniezdefiniowany poziom %s zapadania dla %sniezdefiniowany poziom %s wyświetlenia dla %sniezdefiniowana grupa zadeklarowana w argumencie 'subset'unikalne wartości zmiennej wyjaśniającej dla obiektów klasy "corSymm" muszą być ciągiem kolejnych liczb całkowitychunikalne wartości zmiennej wyjaśniającej dla obiektów klasy "corNatural" muszą być ciągiem kolejnych liczb całkowitychbłędne poziomy grupydane x-y przekazywane do funkcji 'splom()' zostały jakoś uszkodzonenlme/inst/po/pl/LC_MESSAGES/nlme.mo0000644000176200001440000000336413450712324016277 0ustar liggesusers l 4!&3H7|0E!+9M89-4CHx4U&L?s@  All parameters must be less than 1 in absolute valueCoefficient matrix not invertibleFirst observation on an individual must have a doseHaven't written the compound symmetry case for this yetSingularity in backsolve at level %ld, block %ldUnable to form eigenvalue-eigenvector decomposition [RS(.) ierr = %d]Unknown spatial correlation classanalytic gradient is not available with compound symmetryanalytic gradient is not available with matrix logarithmProject-Id-Version: nlme 3.1-115 Report-Msgid-Bugs-To: POT-Creation-Date: 2019-04-02 18:40+0200 PO-Revision-Date: Last-Translator: Łukasz Daniel Language-Team: Łukasz Daniel Language: pl_PL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit na-Revision-Date: 2012-05-29 07:55+0100 Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); X-Poedit-SourceCharset: iso-8859-1 X-Generator: Poedit 1.5.4 Wszystkie parametry muszą być na moduł mniejsze niż 1Macierz współczynników nie jest odwracalnaPierwsza obserwacja jednostki musi mieć zamknięcieJak na razie nie została napisany przypadek dla tej złożonej symetriiOsobliwość w 'backsolve' na poziomie %ld, blok %ldNie można uformować dekompozycji wartość własna-wektor własny [RS(.) ierr = %d]Nieznana klasa przestrzennej korelacjigradient analityczny nie jest dostępny dla złożonej symetriigradient analityczny nie jest dostępny z algorytmem macierzowymnlme/inst/po/en@quot/0000755000176200001440000000000012213262320014204 5ustar liggesusersnlme/inst/po/en@quot/LC_MESSAGES/0000755000176200001440000000000013450712322015777 5ustar liggesusersnlme/inst/po/en@quot/LC_MESSAGES/R-nlme.mo0000644000176200001440000012406713450712322017500 0ustar liggesusersL| 0#$BCE)" *:e$+;):6XH3 @) j>5; /< Jl E E 0C!Ot!1!-!*$".O"!~"2"3"#& #G#"]#"##+# #% $3$,P$}$!$$-$%&%9B%#|%%$%G%.(&$W&&|&.&-&1',2')_',''l':;(#v(((( ());8)>t)=)2)$* A*O*,W*7*6*:*&.+6U+/+6+=+P1,7,;,1,7(-A`-*-$->-31.ce.;.</0B/1s/J/7/(0Q=090<0>15E1${191G1I"2Jl2>2>2?53?u3C3B3A<4?~4<4A4B=5$565/52 6+?61k6676F6C:7@~76777".89Q8H81879*>9Di9*9.9o:ox:V:'?;1g;;;<;B<=R<D<E<E=Ha=E=H=-9>8g>>)><>1'?2Y?1?,?8?=$@;b@=@=@2AQMACA&A2 B4=B.rB?B%B:C;BC;~CCO=D&DDD>D>$E6cE%E%E8E<F<\F:F9F8G1GG0yG3G3G2HWEH:H+H6I5;I$qIWI8IT'J5|J)J0J2 K2@K9sKKK?K8%L%^LOL+LNMGOM8M3M*N//N1_N<N@N3OCOO_OLO:O)7PIaPHP7P$,Q\QQ"Q Q6Q')RQRhRDR.RR+SBS&YS4SS*S6S86T8oT'T(T*TT$U"yU.URUOV0nV%V$V'V$W17W2iW+WLWY&4Y"[Y$~Y"YY)Y2Z:ZBTZ5Z5Z:[1>[-p[B[,[=\!L\/n\I\;\<$]<a]@]D]F$^(k^(^+^$^!_$0_`U_b_`%,`7R`0a#a$aBbEGb)b"b b*b&c$Dc/ic;c)cc6dHTd7d dHd$?eFde9e?e3%fRYfMfMf8HgWg9g1h2Eh6xh%h6h7 iDi*aii&i&i i/j(Ej)nj j0j"j) k7k5Ukk.kIk'lEl(dlKl2l( m*5m2`m1m5m4m-0n0^nnpn>o'[o#o,o$oop;1p>mp=p2pq :qHq,Pq7}q:q:q&+r6Rr/r:r=rP2s7s;s9s71tAit*t$t>t3:ucnu;u<v0Kv1|vJv7v1wQJw9w<w>x5Rx(x9xGxI3yJ}y>y>z?Fz?zCzB {AM{?{<{A |BN|$|:|/|2!}+T}1}}7}F~CO~@~6~7 "C9fL17*WD.ǀ.o%wV 'd1݂@F8=DEEHHEׄL-j8х-<1\21,< =]?AۇA2_QG&,6S82É?%6>\??ۊW*!>>ZF:%%A8g<<ݍ:9U<1̎03/3c2[ʏB&+i65̐$W'8T5 -C4q66ݒ9NkC8ʓ%O)+yNG8<3u*/ԕ1<6@s3OLT:)ܗIPP?$\"c 6'ޙD7.|+˚&85"n*68<,+i,*œT"B.eRO07%h$'$۞122+eLޠ&&$(K"t)6ءB)5l5:آ1-EBs,A!%/GIw?<<>@{HF(L(u+$ʦ!(`:b%6gb*>i YH/7J/F?(VO)R.(PE <\Ae8!J#$ K)k#dZF_,B;% .CL:B?[<I1"@X7'&$2u*G=&l;s3U{ H6 4]K  Q,tL:}hpa 4"|~qSG-DcrW8voz905>! yANMxj%2mD9E5@f3T+n^1 wCI =`'-0+"corStruct" object must have a "fixed" attribute"pdMat" element must have a formula"pdMat" elements must have a formula%d error caught in %s: %s%d times caught the same error in %s: %s%d errors caught in %s. The error messages and their frequencies are%s and %s must have the same group levels%s can have at most two components%s can only be a list or numeric%s can only have names "const" and "power"%s is not a valid effect name%s is not a valid object for "pdMat"%s must have group names in 'varConstPower'%s not available for plotting%s not available for plotting%s not found in data%s not found in data%s not matched%s not matched%s problem, convergence error code = %s message = %s%s without "primary" can only be used with fits of "groupedData" objects'FUN' can only be a function or a list of functions'Id' must be between 0 and 1'L' must have at most %d column'L' must have at most %d columns'Terms' must be between 1 and %d'asTable' can only be used with balanced 'groupedData' objects'asTable' cannot be used with multilevel grouped data'data' argument not used, but taken from groupedData object'data' in %s call must evaluate to a data frame'data' must be a "groupedData" object if 'formula' does not include groups'data' must be a "groupedData" object if 'groups' argument is missing'data' must be given explicitly to use 'nls' to get initial estimates'data' must be given explicitly to use 'nlsList''data' must inherit from "groupedData" class if 'random' does not define groups'distance' and 'object' have incompatible lengths'fixed' must be a formula or list of formulae'form' and 'nam' have incompatible lengths'form' and 'pdClass' have incompatible lengths'form' argument must be a formula'form' can only be a formula or a list of formulae'form' can only be a formula, or a list of formulas'form' must be a formula'form' must be a formula when not NULL'form' must be a list'form' must be a one-sided formula'form' must be a two-sided formula'form' must have a covariate'form' must have all components as formulas'form' not consistent with 'nam''id' can only be a formula or numeric'id' must be between 0 and 1'idLabels' can only be a formula or a vector'idLabels' of incorrect length'lme.lmList' will redefine 'data''model' must be a formula'nam' and 'pdClass' have incompatible lengths'nam' must be a list'nint' is not consistent with 'breaks''nlme.nlsList' will redefine 'fixed', 'data', and 'start''object' has not been Initialize()d'object' must be a formula'object' must be a list or a formula'object' must be a list when not missing, not a matrix, and not numeric'params' must be a formula or list of formulae'pdClass' must be a character vector'preserve' must be a two-sided formula'random' must be a formula or list of formulae'range' must be > 0 in "corLin" initial value'range' must be > 0 in "corSpatial" initial value'start' must have a component called 'fixed''subset' can only be character or integer'subset' ignored with single grouping factor'subset' must be a list'sumLenSq := sum(table(groups)^2)' = %g is too large. Too large or no groups in your correlation structure?'sumLenSq' = %g is too large (larger than maximal integer)'value' must be a one sided formula'value' must be a square matrix'which' can only be character or integer'which' must be between 1 and %dAIC undefined for REML fitDo increase 'msMaxIter'!Iteration %d, LME step: nlm() did not converge (code = %d).Iteration %d, LME step: nlminb() did not converge (code = %d).L may only involve fixed effects with the same denominator DFLNone of the arguments specify more than one blockLength of names should be %dPORT message:PackageRather re-install it with this version of R.Within-group std. dev. must be a positive numeric valueall arguments to 'varComb' must be of class "varFunc".all elements in the argument must generate "pdMat" objectsall elements must have a non-zero sizeall elements must have formulas when any has a formulaall elements must have names when any has namesall elements of 'form' list must be two-sided formulasall elements of a "reStruct" object must have a non-zero sizeall elements of formula must be list of two-sided formulae or two-sided formulaeall fitted objects must have the same estimation methodall fitted objects must use the same number of observationsall variables used in 'formula' must be in 'data'an object of length %d does not match a Cholesky factoran object of length %d does not match the required parameter sizearguments imply different number of blocksat least two coefficients are neededaugmentation of random effects only available for single levelautoregressive order must be a non-negative integercan only construct "varFunc" object from another "varFunc" object, a formula, or a character stringcan only fit "lmList" objects with single grouping variablecan only fit "nlsList" objects with single grouping variablecannot access the matrix of object without namescannot access the matrix of uninitialized objectscannot access the number of columns of uninitialized objects without namescannot calculate REML log-likelihood for "gnls" objectscannot change 'form'cannot change coefficients before initialization or when all parameters are fixedcannot change dimensions on an initialized "pdMat" objectcannot change parameter length of initialized "pdMat" objectcannot change parameter length of initialized "varComb" objectcannot change parameter length of initialized objectscannot change the length of 'object'cannot change the length of covariate in "varFunc" objectcannot change the length of the "varExp" parameter after initializationcannot change the length of the "varIdent" parameter after initializationcannot change the length of the "varStruct" parameter after initializationcannot change the length of the parameter after initializationcannot change the length of the parameter of a "corAR1" objectcannot change the length of the parameter of a "corARMA" objectcannot change the length of the parameter of a "corCAR1" objectcannot change the length of the parameter of a "corCompSymm" objectcannot change the length of the parameter of a "corNatural" objectcannot change the length of the parameter of a "corStruct" objectcannot change the length of the parameter of a "corSymm" objectcannot change the number of columns on an initialized objectcannot change the parameter when ength of parameters is undefinedcannot change the parameter when length of parameters is undefinedcannot do pairs of just one variablecannot evaluate groups for desired levels on 'newdata'cannot extract groups formula without a formulacannot extract matrix from an uninitialized objectcannot extract model matrix without formulacannot extract parameters of uninitialized objectcannot extract the dimensionscannot extract the inverse from an uninitialized objectcannot extract the log of the determinant from an uninitialized objectcannot extract the matrix from an uninitialized "pdCompSymm" objectcannot extract the matrix from an uninitialized "pdIdent" objectcannot extract the matrix from an uninitialized objectcannot extract the matrix with uninitialized dimensionscannot fix variances in all groupscannot get confidence intervals on var-cov components: %scannot get confidence intervals on var-cov components: %s Consider '%s'cannot get the inverse of an uninitialized objectcannot have duplicated column names in a "pdMat" objectcannot have zero distances in "corSpatial"cannot obtain constrained coefficients with uninitialized dimensionscannot omit grouping factor without 'form'cannot use an anonymous function for the modelcannot use smaller level of grouping for "correlation" than for "random". Replacing the former with the latter.cannot use smaller level of grouping for 'correlation' than for 'random'. Replacing the former with the latter.collapsing level cannot be smaller than display level; setting it to the display levelcomputed "gls" fit is singular, rank %sconstant in "varConstPower" structure must be > 0covariate must be a data framecovariate must be numericcovariate must have a level attribute when 'id' is a formulacovariate must have a level attribute when 'idLabels' is a formulacovariate must have a level attribute when groups are presentcovariate must have unique values within groups for "corAR1" objectscovariate must have unique values within groups for "corARMA" objectscovariate must have unique values within groups for "corCAR1" objectscovariate must have unique values within groups for "corNatural" objectscovariate must have unique values within groups for "corSymm" objectsdata argument to "data.frame" method for 'getGroups' does not make sensedata in %s call must evaluate to a data framedegrees of freedom and weights must have the same lengthdeviance undefined for REML fitdimnames of 'value' must match or be NULLdo not know how to calculate correlation matrix of %s objectdo not know how to get coefficients for %s objectdo not know how to obtain constrained coefficientsdo not know how to obtain parameters of %s objecteffect %s not matchedeffects %s not matchedelements in 'object' must be formulas or "pdMat" objectsfewer observations than random effects in all level %s groupsfirst argument to 'groupedData' must be a two-sided formulafirst argument to 'nfGroupedData' must be a two-sided formulafirst argument to 'nmGroupedData' must be a two-sided formulafirst model has a different response from the restfitted objects with different fixed effects. REML comparisons are not meaningful.fixed parameter names in 'varIdent' must be a subset of group namesfixed parameters must have group namesfixed parameters must have group names in 'varExp'fixed parameters must have group names in 'varPower'fixed parameters must have names in 'varIdent'fixed-effects model must be a formula of the form "resp ~ pred"formula(object) must return a formulaformulae in 'fixed' must be of the form "parameter ~ expr"formulae in 'params' must be of the form "parameter ~ expr"formulae in 'random' must be of the form "parameter ~ expr"group name not matched in starting values for random effects: %sgroup names not matched in starting values for random effects: %sgroups levels mismatch in 'random' and starting values for 'random' at level %signoring 'group' in "varFixed" formulaignoring argument 'form'ignoring argument 'nam'incompatible formulas for groups in "random" and "correlation"incompatible formulas for groups in 'random' and 'correlation'incompatible lengths for 'random' and grouping factorsincompatible lengths for object namesindividual %s was not used in the fitinitial value for "corLin" parameters of wrong dimensioninitial value for "corNatural" parameters of wrong dimensioninitial value for "corSpatial" parameters of wrong dimensioninitial value for "corSpher" parameters of wrong dimensioninitial value for "corSymm" parameters of wrong dimensioninitial value for "reStruct" overwritten in 'lme.lmList'initial value for "varExp" should be of length %dinitial value for "varExp" should be of length 1initial value for "varIdent" should be of length %dinitial value for "varPower" should be of length %dinitial value for "varPower" should be of length 1initial value for 'range' less than minimum distance. Setting it to 1.1 * min(distance)initial value for 'reStruct' overwritten in 'nlme.nlsList'initial value for parameter of wrong lengthinitial value in "corCompSymm" must be greater than %sinitial value of nugget ratio must be between 0 and 1initial value should be of length %dinitial values for "corNatural" do not define a positive-definite correlation structureinitial values for "corNatural" must be between -1 and 1initial values for "corSymm" do not define a positive-definite correlation structureinitial values for "corSymm" must be between -1 and 1initial values for 'varIdent' must be > 0initial values must have group names in 'varExp'initial values must have group names in 'varIdent'initial values must have group names in 'varPower'initializing "pdCompSymm" object is not positive definiteinstalled with old R versioninvalid formula for groupslength of 'nam' not consistent with dimensions of initial valuelevel %s not allowed for %slevels %s not allowed for %slevel of %s does not match formula %slist with starting values for random effects must have names or be of length %dlog-likelihood not available with NULL fitsmaximum number of iterations (lmeControl(maxIter)) reached without convergencemaximum number of iterations (maxIter = %d) reached without convergencemaximum number of iterations reached without convergencemismatch between group names and fixed values namesmissing call attribute in "nlsList" objectmodel formula must be of the form "resp ~ pred"model must be a formula of the form "resp ~ pred"models with "corStruct" and/or "varFunc" objects not allowedmore than one degree of freedom is needed when one them is zero.moving average order must be a non-negative integermultiple levels not allowedmust give names when initializing "pdCompSymm" from parameter without a formulamust give names when initializing "pdIdent" from parameter without a formulamust give names when initializing from matrix or parametermust have formula when no names are givennames being assigned do not correspond to a permutation of previous namesnames mismatch in 'random' and starting values for 'random' at level %snames of 'value' are not consistent with 'nam' argumentnames of object and value must matchnames of starting value for "varIdent" object must contain all but one of the stratum levelsneed an object with call componentneed data to calculate covariateneed data to calculate covariate of "corStruct" objectnegative degrees of freedom not allowedno coefficients to fitno condensed linear modelno default method for extracting the square root of a "pdMat" objectno degrees of freedom for estimating std. dev.no degrees of freedom specifiedno effects allowed in right side of formulano fitted "lme" objectno initial values for model parametersno model variogram available with 'showModel = TRUE'nonexistent group in 'newdata'nonexistent group names for initial valuesnonexistent group names for initial values in "varExp"nonexistent group names for initial values in "varPower"nonexistent group names for initial values in 'varIdent'nonexistent group requested in 'subset'nonexistent groups requested in 'subset'nonexistent level %snonexistent levels %snot (yet) implemented. Contributions are welcome; use intervals() instead (for now)not implemented for "nlme" objectsnot implemented for multiple levels of nestingnumber of columns in starting values for random component at level %s should be %dnumber of rows in starting values for random component at level %s should be %dobject formula must be of the form "resp ~ pred"object must inherit from "data.frame"object must inherit from class "gls"object must inherit from class "lmList"object must inherit from class "lme"objects must have a "call" component or attributeobjects must have coefficients with same row namesobjects must inherit from classes %s, or %sold-style self-starting model functions are no longer supported. New selfStart functions are available. Use SSfpl instead of fpl, SSfol instead of first.order.log, SSbiexp instead of biexp, SSlogis instead of logistic. If writing your own selfStart model, see "help(selfStart)" for the new form of the "initial" attribute.only one display level allowedonly one level allowed for predictionsonly one level allowed in 'gapply'only one level allowed in 'gsummary'only one level of grouping allowedonly residuals allowedonly residuals and random effects allowedonly single effects allowed in left side of 'form'only single level allowedparameter in "corCompSymm" structure must be < 1 in absolute valueparameter in AR(1) structure must be between -1 and 1parameter in CAR(1) structure must be between 0 and 1parameters in ARMA structure must be < 1 in absolute valueplot method only implemented for comparing modelsrange must be > 0 in "corSpher" initial valueright-hand side of first argument must be a conditional expressionsecond argument must be a groupedData objectsecond argument to 'groupedData' must inherit from data.frameshould not be used with R versionsingle group not supported -- use groupedData()some fitted objects deleted because response differs from the first modelstarting estimates must have names when 'params' is missingstarting values for parameters are not of the correct lengthstarting values for random effects must include group levelsstarting values for random effects should be a list, or a matrixstarting values for the 'fixed' component are not the correct lengthstarting values for the random components should be a list of matricesterm %s not matchedterms %s not matchedterms can only be integers or charactersterms must all have the same denominator DFundefined collapsing level %s for %sundefined display level %s for %sundefined group declared in 'subset'unique values of the covariate for "corSymm" objects must be a sequence of consecutive integersunique values of the covariate for "corNatural" objects must be a sequence of consecutive integerswrong group levelsx-y data to splom got botched somehowProject-Id-Version: nlme 3.1-138 POT-Creation-Date: 2019-04-02 18:40 PO-Revision-Date: 2019-04-02 18:40 Last-Translator: Automatically generated Language-Team: none MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Language: en Plural-Forms: nplurals=2; plural=(n != 1); "corStruct" object must have a "fixed" attribute"pdMat" element must have a formula"pdMat" elements must have a formula%d error caught in %s: %s%d times caught the same error in %s: %s%d errors caught in %s. The error messages and their frequencies are%s and %s must have the same group levels%s can have at most two components%s can only be a list or numeric%s can only have names "const" and "power"%s is not a valid effect name%s is not a valid object for "pdMat"%s must have group names in ‘varConstPower’%s not available for plotting%s not available for plotting%s not found in data%s not found in data%s not matched%s not matched%s problem, convergence error code = %s message = %s%s without "primary" can only be used with fits of "groupedData" objects‘FUN’ can only be a function or a list of functions‘Id’ must be between 0 and 1‘L’ must have at most %d column‘L’ must have at most %d columns‘Terms’ must be between 1 and %d‘asTable’ can only be used with balanced ‘groupedData’ objects‘asTable’ cannot be used with multilevel grouped data‘data’ argument not used, but taken from groupedData object‘data’ in %s call must evaluate to a data frame‘data’ must be a "groupedData" object if ‘formula’ does not include groups‘data’ must be a "groupedData" object if ‘groups’ argument is missing‘data’ must be given explicitly to use ‘nls’ to get initial estimates‘data’ must be given explicitly to use ‘nlsList’‘data’ must inherit from "groupedData" class if ‘random’ does not define groups‘distance’ and ‘object’ have incompatible lengths‘fixed’ must be a formula or list of formulae‘form’ and ‘nam’ have incompatible lengths‘form’ and ‘pdClass’ have incompatible lengths‘form’ argument must be a formula‘form’ can only be a formula or a list of formulae‘form’ can only be a formula, or a list of formulas‘form’ must be a formula‘form’ must be a formula when not NULL‘form’ must be a list‘form’ must be a one-sided formula‘form’ must be a two-sided formula‘form’ must have a covariate‘form’ must have all components as formulas‘form’ not consistent with ‘nam’‘id’ can only be a formula or numeric‘id’ must be between 0 and 1‘idLabels’ can only be a formula or a vector‘idLabels’ of incorrect length‘lme.lmList’ will redefine ‘data’‘model’ must be a formula‘nam’ and ‘pdClass’ have incompatible lengths‘nam’ must be a list‘nint’ is not consistent with ‘breaks’‘nlme.nlsList’ will redefine ‘fixed’, ‘data’, and ‘start’‘object’ has not been Initialize()d‘object’ must be a formula‘object’ must be a list or a formula‘object’ must be a list when not missing, not a matrix, and not numeric‘params’ must be a formula or list of formulae‘pdClass’ must be a character vector‘preserve’ must be a two-sided formula‘random’ must be a formula or list of formulae‘range’ must be > 0 in "corLin" initial value‘range’ must be > 0 in "corSpatial" initial value‘start’ must have a component called ‘fixed’‘subset’ can only be character or integer‘subset’ ignored with single grouping factor‘subset’ must be a list‘sumLenSq := sum(table(groups)^2)’ = %g is too large. Too large or no groups in your correlation structure?‘sumLenSq’ = %g is too large (larger than maximal integer)‘value’ must be a one sided formula‘value’ must be a square matrix‘which’ can only be character or integer‘which’ must be between 1 and %dAIC undefined for REML fitDo increase ‘msMaxIter’!Iteration %d, LME step: nlm() did not converge (code = %d).Iteration %d, LME step: nlminb() did not converge (code = %d).L may only involve fixed effects with the same denominator DFLNone of the arguments specify more than one blockLength of names should be %dPORT message:PackageRather re-install it with this version of R.Within-group std. dev. must be a positive numeric valueall arguments to ‘varComb’ must be of class "varFunc".all elements in the argument must generate "pdMat" objectsall elements must have a non-zero sizeall elements must have formulas when any has a formulaall elements must have names when any has namesall elements of ‘form’ list must be two-sided formulasall elements of a "reStruct" object must have a non-zero sizeall elements of formula must be list of two-sided formulae or two-sided formulaeall fitted objects must have the same estimation methodall fitted objects must use the same number of observationsall variables used in ‘formula’ must be in ‘data’an object of length %d does not match a Cholesky factoran object of length %d does not match the required parameter sizearguments imply different number of blocksat least two coefficients are neededaugmentation of random effects only available for single levelautoregressive order must be a non-negative integercan only construct "varFunc" object from another "varFunc" object, a formula, or a character stringcan only fit "lmList" objects with single grouping variablecan only fit "nlsList" objects with single grouping variablecannot access the matrix of object without namescannot access the matrix of uninitialized objectscannot access the number of columns of uninitialized objects without namescannot calculate REML log-likelihood for "gnls" objectscannot change ‘form’cannot change coefficients before initialization or when all parameters are fixedcannot change dimensions on an initialized "pdMat" objectcannot change parameter length of initialized "pdMat" objectcannot change parameter length of initialized "varComb" objectcannot change parameter length of initialized objectscannot change the length of ‘object’cannot change the length of covariate in "varFunc" objectcannot change the length of the "varExp" parameter after initializationcannot change the length of the "varIdent" parameter after initializationcannot change the length of the "varStruct" parameter after initializationcannot change the length of the parameter after initializationcannot change the length of the parameter of a "corAR1" objectcannot change the length of the parameter of a "corARMA" objectcannot change the length of the parameter of a "corCAR1" objectcannot change the length of the parameter of a "corCompSymm" objectcannot change the length of the parameter of a "corNatural" objectcannot change the length of the parameter of a "corStruct" objectcannot change the length of the parameter of a "corSymm" objectcannot change the number of columns on an initialized objectcannot change the parameter when ength of parameters is undefinedcannot change the parameter when length of parameters is undefinedcannot do pairs of just one variablecannot evaluate groups for desired levels on ‘newdata’cannot extract groups formula without a formulacannot extract matrix from an uninitialized objectcannot extract model matrix without formulacannot extract parameters of uninitialized objectcannot extract the dimensionscannot extract the inverse from an uninitialized objectcannot extract the log of the determinant from an uninitialized objectcannot extract the matrix from an uninitialized "pdCompSymm" objectcannot extract the matrix from an uninitialized "pdIdent" objectcannot extract the matrix from an uninitialized objectcannot extract the matrix with uninitialized dimensionscannot fix variances in all groupscannot get confidence intervals on var-cov components: %scannot get confidence intervals on var-cov components: %s Consider ‘%s’cannot get the inverse of an uninitialized objectcannot have duplicated column names in a "pdMat" objectcannot have zero distances in "corSpatial"cannot obtain constrained coefficients with uninitialized dimensionscannot omit grouping factor without ‘form’cannot use an anonymous function for the modelcannot use smaller level of grouping for "correlation" than for "random". Replacing the former with the latter.cannot use smaller level of grouping for ‘correlation’ than for ‘random’. Replacing the former with the latter.collapsing level cannot be smaller than display level; setting it to the display levelcomputed "gls" fit is singular, rank %sconstant in "varConstPower" structure must be > 0covariate must be a data framecovariate must be numericcovariate must have a level attribute when ‘id’ is a formulacovariate must have a level attribute when ‘idLabels’ is a formulacovariate must have a level attribute when groups are presentcovariate must have unique values within groups for "corAR1" objectscovariate must have unique values within groups for "corARMA" objectscovariate must have unique values within groups for "corCAR1" objectscovariate must have unique values within groups for "corNatural" objectscovariate must have unique values within groups for "corSymm" objectsdata argument to "data.frame" method for ‘getGroups’ does not make sensedata in %s call must evaluate to a data framedegrees of freedom and weights must have the same lengthdeviance undefined for REML fitdimnames of ‘value’ must match or be NULLdo not know how to calculate correlation matrix of %s objectdo not know how to get coefficients for %s objectdo not know how to obtain constrained coefficientsdo not know how to obtain parameters of %s objecteffect %s not matchedeffects %s not matchedelements in ‘object’ must be formulas or "pdMat" objectsfewer observations than random effects in all level %s groupsfirst argument to ‘groupedData’ must be a two-sided formulafirst argument to ‘nfGroupedData’ must be a two-sided formulafirst argument to ‘nmGroupedData’ must be a two-sided formulafirst model has a different response from the restfitted objects with different fixed effects. REML comparisons are not meaningful.fixed parameter names in ‘varIdent’ must be a subset of group namesfixed parameters must have group namesfixed parameters must have group names in ‘varExp’fixed parameters must have group names in ‘varPower’fixed parameters must have names in ‘varIdent’fixed-effects model must be a formula of the form "resp ~ pred"formula(object) must return a formulaformulae in ‘fixed’ must be of the form "parameter ~ expr"formulae in ‘params’ must be of the form "parameter ~ expr"formulae in ‘random’ must be of the form "parameter ~ expr"group name not matched in starting values for random effects: %sgroup names not matched in starting values for random effects: %sgroups levels mismatch in ‘random’ and starting values for ‘random’ at level %signoring ‘group’ in "varFixed" formulaignoring argument ‘form’ignoring argument ‘nam’incompatible formulas for groups in "random" and "correlation"incompatible formulas for groups in ‘random’ and ‘correlation’incompatible lengths for ‘random’ and grouping factorsincompatible lengths for object namesindividual %s was not used in the fitinitial value for "corLin" parameters of wrong dimensioninitial value for "corNatural" parameters of wrong dimensioninitial value for "corSpatial" parameters of wrong dimensioninitial value for "corSpher" parameters of wrong dimensioninitial value for "corSymm" parameters of wrong dimensioninitial value for "reStruct" overwritten in ‘lme.lmList’initial value for "varExp" should be of length %dinitial value for "varExp" should be of length 1initial value for "varIdent" should be of length %dinitial value for "varPower" should be of length %dinitial value for "varPower" should be of length 1initial value for ‘range’ less than minimum distance. Setting it to 1.1 * min(distance)initial value for ‘reStruct’ overwritten in ‘nlme.nlsList’initial value for parameter of wrong lengthinitial value in "corCompSymm" must be greater than %sinitial value of nugget ratio must be between 0 and 1initial value should be of length %dinitial values for "corNatural" do not define a positive-definite correlation structureinitial values for "corNatural" must be between -1 and 1initial values for "corSymm" do not define a positive-definite correlation structureinitial values for "corSymm" must be between -1 and 1initial values for ‘varIdent’ must be > 0initial values must have group names in ‘varExp’initial values must have group names in ‘varIdent’initial values must have group names in ‘varPower’initializing "pdCompSymm" object is not positive definiteinstalled with old R versioninvalid formula for groupslength of ‘nam’ not consistent with dimensions of initial valuelevel %s not allowed for %slevels %s not allowed for %slevel of %s does not match formula %slist with starting values for random effects must have names or be of length %dlog-likelihood not available with NULL fitsmaximum number of iterations (lmeControl(maxIter)) reached without convergencemaximum number of iterations (maxIter = %d) reached without convergencemaximum number of iterations reached without convergencemismatch between group names and fixed values namesmissing call attribute in "nlsList" objectmodel formula must be of the form "resp ~ pred"model must be a formula of the form "resp ~ pred"models with "corStruct" and/or "varFunc" objects not allowedmore than one degree of freedom is needed when one them is zero.moving average order must be a non-negative integermultiple levels not allowedmust give names when initializing "pdCompSymm" from parameter without a formulamust give names when initializing "pdIdent" from parameter without a formulamust give names when initializing from matrix or parametermust have formula when no names are givennames being assigned do not correspond to a permutation of previous namesnames mismatch in ‘random’ and starting values for ‘random’ at level %snames of ‘value’ are not consistent with ‘nam’ argumentnames of object and value must matchnames of starting value for "varIdent" object must contain all but one of the stratum levelsneed an object with call componentneed data to calculate covariateneed data to calculate covariate of "corStruct" objectnegative degrees of freedom not allowedno coefficients to fitno condensed linear modelno default method for extracting the square root of a "pdMat" objectno degrees of freedom for estimating std. dev.no degrees of freedom specifiedno effects allowed in right side of formulano fitted "lme" objectno initial values for model parametersno model variogram available with ‘showModel = TRUE’nonexistent group in ‘newdata’nonexistent group names for initial valuesnonexistent group names for initial values in "varExp"nonexistent group names for initial values in "varPower"nonexistent group names for initial values in ‘varIdent’nonexistent group requested in ‘subset’nonexistent groups requested in ‘subset’nonexistent level %snonexistent levels %snot (yet) implemented. Contributions are welcome; use intervals() instead (for now)not implemented for "nlme" objectsnot implemented for multiple levels of nestingnumber of columns in starting values for random component at level %s should be %dnumber of rows in starting values for random component at level %s should be %dobject formula must be of the form "resp ~ pred"object must inherit from "data.frame"object must inherit from class "gls"object must inherit from class "lmList"object must inherit from class "lme"objects must have a "call" component or attributeobjects must have coefficients with same row namesobjects must inherit from classes %s, or %sold-style self-starting model functions are no longer supported. New selfStart functions are available. Use SSfpl instead of fpl, SSfol instead of first.order.log, SSbiexp instead of biexp, SSlogis instead of logistic. If writing your own selfStart model, see "help(selfStart)" for the new form of the "initial" attribute.only one display level allowedonly one level allowed for predictionsonly one level allowed in ‘gapply’only one level allowed in ‘gsummary’only one level of grouping allowedonly residuals allowedonly residuals and random effects allowedonly single effects allowed in left side of ‘form’only single level allowedparameter in "corCompSymm" structure must be < 1 in absolute valueparameter in AR(1) structure must be between -1 and 1parameter in CAR(1) structure must be between 0 and 1parameters in ARMA structure must be < 1 in absolute valueplot method only implemented for comparing modelsrange must be > 0 in "corSpher" initial valueright-hand side of first argument must be a conditional expressionsecond argument must be a groupedData objectsecond argument to ‘groupedData’ must inherit from data.frameshould not be used with R versionsingle group not supported -- use groupedData()some fitted objects deleted because response differs from the first modelstarting estimates must have names when ‘params’ is missingstarting values for parameters are not of the correct lengthstarting values for random effects must include group levelsstarting values for random effects should be a list, or a matrixstarting values for the ‘fixed’ component are not the correct lengthstarting values for the random components should be a list of matricesterm %s not matchedterms %s not matchedterms can only be integers or charactersterms must all have the same denominator DFundefined collapsing level %s for %sundefined display level %s for %sundefined group declared in ‘subset’unique values of the covariate for "corSymm" objects must be a sequence of consecutive integersunique values of the covariate for "corNatural" objects must be a sequence of consecutive integerswrong group levelsx-y data to splom got botched somehownlme/inst/po/en@quot/LC_MESSAGES/nlme.mo0000644000176200001440000000361013450712322017267 0ustar liggesusers 041!f370H7TE!9=8wX4 !>3`70HTXE!98O    All parameters must be less than 1 in absolute valueCoefficient matrix not invertibleFirst observation on an individual must have a doseHaven't written the compound symmetry case for this yetOverfitted model!Singularity in backsolve at level %ld, block %ldToo many parameters for finite-difference Hessian; npar = %d, nTot = %g.Unable to form Cholesky decomposition: the leading minor of order %d is not pos.def.Unable to form eigenvalue-eigenvector decomposition [RS(.) ierr = %d]Unknown spatial correlation classanalytic gradient is not available with compound symmetryanalytic gradient is not available with matrix logarithmProject-Id-Version: nlme 3.1-138 Report-Msgid-Bugs-To: POT-Creation-Date: 2019-04-02 18:40+0200 PO-Revision-Date: 2019-04-02 18:40+0200 Last-Translator: Automatically generated Language-Team: none Language: en MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); All parameters must be less than 1 in absolute valueCoefficient matrix not invertibleFirst observation on an individual must have a doseHaven't written the compound symmetry case for this yetOverfitted model!Singularity in backsolve at level %ld, block %ldToo many parameters for finite-difference Hessian; npar = %d, nTot = %g.Unable to form Cholesky decomposition: the leading minor of order %d is not pos.def.Unable to form eigenvalue-eigenvector decomposition [RS(.) ierr = %d]Unknown spatial correlation classanalytic gradient is not available with compound symmetryanalytic gradient is not available with matrix logarithmnlme/inst/scripts/0000755000176200001440000000000013331020315013640 5ustar liggesusersnlme/inst/scripts/ch03.R0000644000176200001440000000746212454433071014545 0ustar liggesusers#-*- R -*- # initialization library(nlme) options(width = 65, digits = 5) options(contrasts = c(unordered = "contr.helmert", ordered = "contr.poly")) pdf(file = 'ch03.pdf') # Chapter 3 Describing the Structure of Grouped Data # 3.1 The Display Formula and Its Components formula( Rail ) formula( ergoStool ) formula( Machines ) formula( Orthodont ) formula( Pixel ) formula( Oats ) table( Oxboys$Subject ) table( getGroups( Oxboys ) ) unique( table( getGroups( Oxboys ) ) ) # a more concise result unique( table( getCovariate( Oxboys ), getGroups( Oxboys ) ) ) length( unique( getCovariate( Oxboys ) ) ) unique( getGroups(Pixel, level = 1) ) unique( getGroups(Pixel, level = 2) ) Pixel.groups <- getGroups( Pixel, level = 1:2 ) class( Pixel.groups ) names( Pixel.groups ) unique( Pixel.groups[["Side"]] ) formula( PBG ) PBG.log <- update( PBG, formula = deltaBP ~ log(dose) | Rabbit ) formula(PBG.log) unique( getCovariate(PBG.log) ) unique( getCovariate(PBG) ) # 3.2 Constructing groupedData Objects # The next line is not from the book. # It is added to ensure that the file is available write.table( Oxboys, "oxboys.dat" ) Oxboys.frm <- read.table( "oxboys.dat", header = TRUE ) class( Oxboys.frm ) # check the class of the result dim( Oxboys.frm ) # check the dimensions Oxboys <- groupedData( height ~ age | Subject, data = read.table("oxboys.dat", header = TRUE), labels = list(x = "Centered age", y = "Height"), units = list(y = "(cm)") ) Oxboys # display the object unique( getGroups( Oxboys ) ) plot( BodyWeight, outer = ~ Diet, aspect = 3 ) # Figure 3.3 plot( BodyWeight, outer = TRUE, aspect = 3 ) plot( Soybean, outer = ~ Year * Variety ) # Figure 6.10 plot( Soybean, outer = ~ Variety * Year ) gsummary( BodyWeight, invar = TRUE ) plot( PBG, inner = ~ Treatment, scales = list(x = list(log = 2))) ergoStool.mat <- asTable( ergoStool ) ergoStool.mat ergoStool.new <- balancedGrouped( effort ~ Type | Subject, data = ergoStool.mat ) ergoStool.new # 3.3 Controlling Trellis Graphics Presentations of Grouped Data plot(CO2, layout=c(6,2), between=list(x=c(0,0,0.5,0,0))) plot( Spruce, layout = c(7, 4, 3), skip = c(rep(FALSE, 27), TRUE, rep(FALSE, 27), TRUE, rep(FALSE, 12), rep(TRUE, 2), rep(FALSE,13)) ) plot( Spruce, layout = c(9, 3, 3), skip = c(rep(FALSE, 66), TRUE, TRUE, rep(FALSE, 13)) ) unique( getCovariate(DNase) ) log( unique(getCovariate(DNase)), 2 ) plot( DNase, layout=c(6,2), scales = list(x=list(log=2)) ) plot(Pixel, layout = c(4,5), between = list(x = c(0, 0.5, 0), y = 0.5)) plot( Pixel, displayLevel = 1 ) plot( Wafer, display = 1, collapse = 1 ) plot( Wafer, display = 1, collapse = 1, FUN = function(x) sqrt(var(x)), layout = c(10,1) ) # 3.4 Summaries sapply( ergoStool, data.class ) gsummary( Theoph, inv = TRUE ) gsummary( Theoph, omit = TRUE, inv = TRUE ) is.null(gsummary(Theoph, inv = TRUE, omit = TRUE)) # invariants present is.null(gsummary(Oxboys, inv = TRUE, omit = TRUE)) # no invariants gsummary( Theoph ) gsummary( Theoph, FUN = max, omit = TRUE ) Quin.sum <- gsummary( Quinidine, omit = TRUE, FUN = mean ) dim( Quin.sum ) Quin.sum[1:10, ] Quinidine[Quinidine[["Subject"]] == 3, 1:8] Quin.sum1 <- gsummary( Quinidine, omit = TRUE ) Quin.sum1[1:10, 1:7] summary( Quin.sum1 ) summary( Quinidine ) sum( ifelse(is.na(Quinidine[["conc"]]), 0, 1) ) sum( !is.na(Quinidine[["conc"]]) ) sum( !is.na(Quinidine[["dose"]]) ) gapply( Quinidine, "conc", function(x) sum(!is.na(x)) ) table( gapply(Quinidine, "conc", function(x) sum(!is.na(x))) ) changeRecords <- gapply( Quinidine, FUN = function(frm) any(is.na(frm[["conc"]]) & is.na(frm[["dose"]])) ) changeRecords sort( as.numeric( names(changeRecords)[changeRecords] ) ) Quinidine[29:31,] Quinidine[Quinidine[["Subject"]] == 4, ] # cleanup proc.time() nlme/inst/scripts/ch01.R0000644000176200001440000001111212454433071014526 0ustar liggesusers#-*- R -*- library(nlme) pdf(file = 'ch01.pdf') options( width = 65, digits = 5 ) options( contrasts = c(unordered = "contr.helmert", ordered = "contr.poly") ) # Chapter 1 Linear Mixed-Effects Models: Basic Concepts and Examples # 1.1 A Simple Example of Random Effects Rail fm1Rail.lm <- lm( travel ~ 1, data = Rail ) fm1Rail.lm fm2Rail.lm <- lm( travel ~ Rail - 1, data = Rail ) fm2Rail.lm fm1Rail.lme <- lme(travel ~ 1, data = Rail, random = ~ 1 | Rail) summary( fm1Rail.lme ) fm1Rail.lmeML <- update( fm1Rail.lme, method = "ML" ) summary( fm1Rail.lmeML ) plot( fm1Rail.lme ) # produces Figure 1.4 intervals( fm1Rail.lme ) anova( fm1Rail.lme ) # 1.2 A Randomized Block Design plot.design( ergoStool ) # produces Figure 1.6 contrasts( ergoStool$Type ) ergoStool1 <- ergoStool[ ergoStool$Subject == "1", ] model.matrix( effort ~ Type, ergoStool1 ) # X matrix for Subject 1 fm1Stool <- lme(effort ~ Type, data = ergoStool, random = ~ 1 | Subject) summary( fm1Stool ) anova( fm1Stool ) options( contrasts = c( factor = "contr.treatment", ordered = "contr.poly" ) ) contrasts( ergoStool$Type ) fm2Stool <- lme(effort ~ Type, data = ergoStool, random = ~ 1 | Subject) summary( fm2Stool ) anova( fm2Stool ) model.matrix( effort ~ Type - 1, ergoStool1 ) fm3Stool <- lme(effort ~ Type - 1, data = ergoStool, random = ~ 1 | Subject) summary( fm3Stool ) anova( fm3Stool ) intervals( fm1Stool ) plot( fm1Stool, # produces Figure 1.8 form = resid(., type = "p") ~ fitted(.) | Subject, abline = 0 ) # 1.3 Mixed-effects Models for Replicated, Blocked Designs with(Machines, interaction.plot( Machine, Worker, score, las = 1)) # Figure 1.10 fm1Machine <- lme( score ~ Machine, data = Machines, random = ~ 1 | Worker ) fm1Machine fm2Machine <- update( fm1Machine, random = ~ 1 | Worker/Machine ) fm2Machine anova( fm1Machine, fm2Machine ) ## delete selected rows from the Machines data MachinesUnbal <- Machines[ -c(2,3,6,8,9,12,19,20,27,33), ] ## check that the result is indeed unbalanced table(MachinesUnbal$Machine, MachinesUnbal$Worker) fm1MachinesU <- lme( score ~ Machine, data = MachinesUnbal, random = ~ 1 | Worker/Machine ) fm1MachinesU intervals( fm1MachinesU ) fm4Stool <- lme( effort ~ Type, ergoStool, ~ 1 | Subject/Type ) if (interactive()) intervals( fm4Stool ) (fm1Stool$sigma)^2 (fm4Stool$sigma)^2 + 0.79621^2 Machine1 <- Machines[ Machines$Worker == "1", ] model.matrix( score ~ Machine, Machine1 ) # fixed-effects X_i model.matrix( ~ Machine - 1, Machine1 ) # random-effects Z_i fm3Machine <- update( fm1Machine, random = ~Machine - 1 |Worker) summary( fm3Machine ) anova( fm1Machine, fm2Machine, fm3Machine ) # 1.4 An Analysis of Covariance Model names( Orthodont ) levels( Orthodont$Sex ) OrthoFem <- Orthodont[ Orthodont$Sex == "Female", ] fm1OrthF.lis <- lmList( distance ~ age, data = OrthoFem ) coef( fm1OrthF.lis ) intervals( fm1OrthF.lis ) plot( intervals ( fm1OrthF.lis ) ) # produces Figure 1.12 fm2OrthF.lis <- update( fm1OrthF.lis, distance ~ I( age - 11 ) ) plot( intervals( fm2OrthF.lis ) ) # produces Figure 1.13 fm1OrthF <- lme( distance ~ age, data = OrthoFem, random = ~ 1 | Subject ) summary( fm1OrthF ) fm1OrthFM <- update( fm1OrthF, method = "ML" ) summary( fm1OrthFM ) fm2OrthF <- update( fm1OrthF, random = ~ age | Subject ) anova( fm1OrthF, fm2OrthF ) random.effects( fm1OrthF ) ranef( fm1OrthFM ) coef( fm1OrthF ) plot( compareFits(coef(fm1OrthF), coef(fm1OrthFM))) # Figure 1.15 plot( augPred(fm1OrthF), aspect = "xy", grid = TRUE ) # Figure 1.16 # 1.5 Models for Nested Classification Factors fm1Pixel <- lme( pixel ~ day + I(day^2), data = Pixel, random = list( Dog = ~ day, Side = ~ 1 ) ) intervals( fm1Pixel ) plot( augPred( fm1Pixel ) ) # produces Figure 1.18 VarCorr( fm1Pixel ) summary( fm1Pixel ) fm2Pixel <- update( fm1Pixel, random = ~ day | Dog) anova( fm1Pixel, fm2Pixel ) fm3Pixel <- update( fm1Pixel, random = ~ 1 | Dog/Side ) anova( fm1Pixel, fm3Pixel ) fm4Pixel <- update( fm1Pixel, pixel ~ day + I(day^2) + Side ) summary( fm4Pixel ) # 1.6 A Split-Plot Experiment fm1Oats <- lme( yield ~ ordered(nitro) * Variety, data = Oats, random = ~ 1 | Block/Variety ) anova( fm1Oats ) fm2Oats <- update( fm1Oats, yield ~ ordered(nitro) + Variety ) anova( fm2Oats ) summary( fm2Oats ) fm3Oats <- update( fm1Oats, yield ~ ordered( nitro ) ) summary( fm3Oats ) fm4Oats <- lme( yield ~ nitro, data = Oats, random = ~ 1 | Block/Variety ) summary( fm4Oats ) VarCorr( fm4Oats ) intervals( fm4Oats ) plot(augPred(fm4Oats), aspect = 2.5, layout = c(6, 3), between = list(x = c(0, 0, 0.5, 0, 0))) # produces Figure 1.21 # cleanup proc.time() nlme/inst/scripts/runme.R0000644000176200001440000000035613245437022015130 0ustar liggesuserssdir <- system.file("scripts", package="nlme") for(f in list.files(sdir, pattern = "^ch[0-9]*[.]R$")) { cat("\n",f,":\n------\n", sep='') source(file.path(sdir, f), echo=TRUE) } ## runs through, taking ca 1.5 minutes (in BATCH) nlme/inst/scripts/ch04.R0000644000176200001440000001565212454433071014546 0ustar liggesusers#-*- R -*- # initialization library(nlme) library(lattice) options(width = 65, digits = 5) options(contrasts = c(unordered = "contr.helmert", ordered = "contr.poly")) pdf(file = 'ch04.pdf') # Chapter 4 Fitting Linear Mixed-Effects Models # 4.1 Fitting Linear Models in S with lm and lmList fm1Orth.lm <- lm(distance ~ age, Orthodont) fm1Orth.lm par(mfrow=c(2,2)) plot(fm1Orth.lm) # Figure 4.1 fm2Orth.lm <- update(fm1Orth.lm, formula = distance ~ Sex*age) summary(fm2Orth.lm) fm3Orth.lm <- update(fm2Orth.lm, formula = . ~ . - Sex) summary(fm3Orth.lm) bwplot(getGroups(Orthodont)~resid(fm2Orth.lm)) # Figure 4.2 fm1Orth.lis <- lmList(distance ~ age | Subject, Orthodont) getGroupsFormula(Orthodont) fm1Orth.lis <- lmList(distance ~ age, Orthodont) formula(Orthodont) fm1Orth.lis <- lmList(Orthodont) fm1Orth.lis summary(fm1Orth.lis) pairs(fm1Orth.lis, id = 0.01, adj = -0.5) # Figure 4.3 fm2Orth.lis <- update(fm1Orth.lis, distance ~ I(age-11)) intervals(fm2Orth.lis) plot(intervals(fm2Orth.lis)) # Figure 4.5 IGF plot(IGF) # Figure 4.6 fm1IGF.lis <- lmList(IGF) coef(fm1IGF.lis) plot(intervals(fm1IGF.lis)) # Figure 4.7 fm1IGF.lm <- lm(conc ~ age, data = IGF) summary(fm1IGF.lm) # 4.2 Fitting Linear Mixed-Effects Models with lme fm1Orth.lme <- lme(distance ~ I(age-11), data = Orthodont, random = ~ I(age-11) | Subject) fm1Orth.lme <- lme(distance ~ I(age-11), data = Orthodont) fm1Orth.lme <- lme(fm2Orth.lis) fm1Orth.lme fm2Orth.lme <- update(fm1Orth.lme, distance~Sex*I(age-11)) summary(fm2Orth.lme) fitted(fm2Orth.lme, level = 0:1) resid(fm2Orth.lme, level = 1) resid(fm2Orth.lme, level = 1, type = "pearson") newOrth <- data.frame(Subject = rep(c("M11","F03"), c(3, 3)), Sex = rep(c("Male", "Female"), c(3, 3)), age = rep(16:18, 2)) predict(fm2Orth.lme, newdata = newOrth) predict(fm2Orth.lme, newdata = newOrth, level = 0:1) fm2Orth.lmeM <- update(fm2Orth.lme, method = "ML") summary(fm2Orth.lmeM) compOrth <- compareFits(coef(fm2Orth.lis), coef(fm1Orth.lme)) compOrth plot(compOrth, mark = fixef(fm1Orth.lme)) # Figure 4.8 ## Figure 4.9 plot(comparePred(fm2Orth.lis, fm1Orth.lme, length.out = 2), layout = c(8,4), between = list(y = c(0, 0.5, 0))) plot(compareFits(ranef(fm2Orth.lme), ranef(fm2Orth.lmeM)), mark = c(0, 0)) fm4Orth.lm <- lm(distance ~ Sex * I(age-11), Orthodont) summary(fm4Orth.lm) anova(fm2Orth.lme, fm4Orth.lm) #fm1IGF.lme <- lme(fm1IGF.lis) #fm1IGF.lme #intervals(fm1IGF.lme) #summary(fm1IGF.lme) pd1 <- pdDiag(~ age) pd1 formula(pd1) #fm2IGF.lme <- update(fm1IGF.lme, random = pdDiag(~age)) (fm2IGF.lme <- lme(conc ~ age, IGF, random = pdDiag(~age))) #anova(fm1IGF.lme, fm2IGF.lme) anova(fm2IGF.lme) #update(fm1IGF.lme, random = list(Lot = pdDiag(~ age))) pd2 <- pdDiag(value = diag(2), form = ~ age) pd2 formula(pd2) lme(conc ~ age, IGF, pdDiag(diag(2), ~age)) fm4OatsB <- lme(yield ~ nitro, data = Oats, random =list(Block = pdCompSymm(~ Variety - 1))) summary(fm4OatsB) corMatrix(fm4OatsB$modelStruct$reStruct$Block)[1,2] fm4OatsC <- lme(yield ~ nitro, data = Oats, random=list(Block=pdBlocked(list(pdIdent(~ 1), pdIdent(~ Variety-1))))) summary(fm4OatsC) ## establishing the desired parameterization for contrasts options(contrasts = c("contr.treatment", "contr.poly")) fm1Assay <- lme(logDens ~ sample * dilut, Assay, random = pdBlocked(list(pdIdent(~ 1), pdIdent(~ sample - 1), pdIdent(~ dilut - 1)))) fm1Assay anova(fm1Assay) formula(Oxide) fm1Oxide <- lme(Thickness ~ 1, Oxide) fm1Oxide intervals(fm1Oxide, which = "var-cov") fm2Oxide <- update(fm1Oxide, random = ~ 1 | Lot) anova(fm1Oxide, fm2Oxide) coef(fm1Oxide, level = 1) coef(fm1Oxide, level = 2) ranef(fm1Oxide, level = 1:2) fm1Wafer <- lme(current ~ voltage + I(voltage^2), data = Wafer, random = list(Wafer = pdDiag(~voltage + I(voltage^2)), Site = pdDiag(~voltage + I(voltage^2)))) summary(fm1Wafer) fitted(fm1Wafer, level = 0) resid(fm1Wafer, level = 1:2) newWafer <- data.frame(Wafer = rep(1, 4), voltage = c(1, 1.5, 3, 3.5)) predict(fm1Wafer, newWafer, level = 0:1) newWafer2 <- data.frame(Wafer = rep(1, 4), Site = rep(3, 4), voltage = c(1, 1.5, 3, 3.5)) predict(fm1Wafer, newWafer2, level = 0:2) # 4.3 Examining a Fitted Model plot(fm2Orth.lme, Subject~resid(.), abline = 0) plot(fm2Orth.lme, resid(., type = "p") ~ fitted(.) | Sex, id = 0.05, adj = -0.3) fm3Orth.lme <- update(fm2Orth.lme, weights = varIdent(form = ~ 1 | Sex)) fm3Orth.lme plot(fm3Orth.lme, distance ~ fitted(.), id = 0.05, adj = -0.3) anova(fm2Orth.lme, fm3Orth.lme) qqnorm(fm3Orth.lme, ~resid(.) | Sex) plot(fm2IGF.lme, resid(., type = "p") ~ fitted(.) | Lot, layout = c(5,2)) qqnorm(fm2IGF.lme, ~ resid(.), id = 0.05, adj = -0.75) plot(fm1Oxide) qqnorm(fm1Oxide) plot(fm1Wafer, resid(.) ~ voltage | Wafer) plot(fm1Wafer, resid(.) ~ voltage | Wafer, panel = function(x, y, ...) { panel.grid() panel.xyplot(x, y) panel.loess(x, y, lty = 2) panel.abline(0, 0) }) with(Wafer, coef(lm(resid(fm1Wafer) ~ cos(4.19*voltage)+sin(4.19*voltage)-1))) nls(resid(fm1Wafer) ~ b3*cos(w*voltage) + b4*sin(w*voltage), Wafer, start = list(b3 = -0.0519, b4 = 0.1304, w = 4.19)) fm2Wafer <- update(fm1Wafer, . ~ . + cos(4.5679*voltage) + sin(4.5679*voltage), random = list(Wafer=pdDiag(~voltage+I(voltage^2)), Site=pdDiag(~voltage+I(voltage^2)))) summary(fm2Wafer) intervals(fm2Wafer) qqnorm(fm2Wafer) qqnorm(fm2Orth.lme, ~ranef(.), id = 0.10, cex = 0.7) pairs(fm2Orth.lme, ~ranef(.) | Sex, id = ~ Subject == "M13", adj = -0.3) fm2IGF.lme c(0.00031074, 0.0053722)/abs(fixef(fm2IGF.lme)) fm3IGF.lme <- update(fm2IGF.lme, random = ~ age - 1) anova(fm2IGF.lme, fm3IGF.lme) qqnorm(fm1Oxide, ~ranef(., level = 1), id=0.10) qqnorm(fm1Oxide, ~ranef(., level = 2), id=0.10) #fm3Wafer <- update(fm2Wafer, # random = list(Wafer = ~voltage+I(voltage^2), # Site = pdDiag(~voltage+I(voltage^2))), # control = list(msVerbose = TRUE, msMaxIter = 200) # ) #fm3Wafer #anova(fm2Wafer, fm3Wafer) #fm4Wafer <- update(fm2Wafer, # random = list(Wafer = ~ voltage + I(voltage^2), # Site = pdBlocked(list(~1, # ~voltage+I(voltage^2) - 1))), # control = list(msVerbose = TRUE, # msMaxIter = 200)) #fm4Wafer #anova(fm3Wafer, fm4Wafer) #qqnorm(fm4Wafer, ~ranef(., level = 2), id = 0.05, # cex = 0.7, layout = c(3, 1)) # The next line is not in the book but is needed to get fm1Machine fm1Machine <- lme(score ~ Machine, data = Machines, random = ~ 1 | Worker) (fm3Machine <- update(fm1Machine, random = ~Machine-1|Worker)) # cleanup proc.time() nlme/inst/scripts/ch05.R0000644000176200001440000001647312454433071014551 0ustar liggesusers#-*- R -*- # initialization library(nlme) options(width = 65, digits = 5) options(contrasts = c(unordered = "contr.helmert", ordered = "contr.poly")) pdf(file = "ch05.pdf") # Chapter 5 Extending the Basic Linear Mixed-Effects Models # 5.1 General Formulation of the Extended Model vf1Fixed <- varFixed(~ age) vf1Fixed <- Initialize(vf1Fixed, data = Orthodont) varWeights(vf1Fixed) vf1Ident <- varIdent(c(Female = 0.5), ~ 1 | Sex) vf1Ident <- Initialize(vf1Ident, Orthodont) varWeights(vf1Ident) vf2Ident <- varIdent(form = ~ 1 | Sex, fixed = c(Female = 0.5)) vf2Ident <- Initialize(vf2Ident, Orthodont) varWeights(vf2Ident) vf3Ident <- varIdent(form = ~ 1 | Sex * age) vf3Ident <- Initialize(vf3Ident, Orthodont) varWeights(vf3Ident) vf1Power <- varPower(1) formula(vf1Power) vf2Power <- varPower(fixed = 0.5) vf3Power <- varPower(form = ~ fitted(.) | Sex, fixed = list(Male = 0.5, Female = 0)) vf1Exp <- varExp(form = ~ age | Sex, fixed = c(Female = 0)) vf1ConstPower <- varConstPower(power = 0.5, fixed = list(const = 1)) vf1Comb <- varComb(varIdent(c(Female = 0.5), ~ 1 | Sex), varExp(1, ~ age)) vf1Comb <- Initialize(vf1Comb, Orthodont) varWeights(vf1Comb) fm1Dial.lme <- lme(rate ~(pressure + I(pressure^2) + I(pressure^3) + I(pressure^4))*QB, Dialyzer, ~ pressure + I(pressure^2)) fm1Dial.lme plot(fm1Dial.lme, resid(.) ~ pressure, abline = 0) fm2Dial.lme <- update(fm1Dial.lme, weights = varPower(form = ~ pressure)) fm2Dial.lme anova(fm1Dial.lme, fm2Dial.lme) plot(fm2Dial.lme, resid(., type = "p") ~ pressure, abline = 0) intervals(fm2Dial.lme) plot(fm2Dial.lme, resid(.) ~ pressure|QB, abline = 0) fm3Dial.lme <- update(fm2Dial.lme, weights=varPower(form = ~ pressure | QB)) fm3Dial.lme anova(fm2Dial.lme, fm3Dial.lme) fm4Dial.lme <- update(fm2Dial.lme, weights = varConstPower(form = ~ pressure)) anova(fm2Dial.lme, fm4Dial.lme) plot(augPred(fm2Dial.lme), grid = TRUE) anova(fm2Dial.lme) anova(fm2Dial.lme, Terms = 8:10) options(contrasts = c("contr.treatment", "contr.poly")) fm1BW.lme <- lme(weight ~ Time * Diet, BodyWeight, random = ~ Time) fm1BW.lme fm2BW.lme <- update(fm1BW.lme, weights = varPower()) fm2BW.lme anova(fm1BW.lme, fm2BW.lme) summary(fm2BW.lme) anova(fm2BW.lme, L = c("Time:Diet2" = 1, "Time:Diet3" = -1)) cs1CompSymm <- corCompSymm(value = 0.3, form = ~ 1 | Subject) cs2CompSymm <- corCompSymm(value = 0.3, form = ~ age | Subject) cs1CompSymm <- Initialize(cs1CompSymm, data = Orthodont) corMatrix(cs1CompSymm) cs1Symm <- corSymm(value = c(0.2, 0.1, -0.1, 0, 0.2, 0), form = ~ 1 | Subject) cs1Symm <- Initialize(cs1Symm, data = Orthodont) corMatrix(cs1Symm) cs1AR1 <- corAR1(0.8, form = ~ 1 | Subject) cs1AR1 <- Initialize(cs1AR1, data = Orthodont) corMatrix(cs1AR1) cs1ARMA <- corARMA(0.4, form = ~ 1 | Subject, q = 1) cs1ARMA <- Initialize(cs1ARMA, data = Orthodont) corMatrix(cs1ARMA) cs2ARMA <- corARMA(c(0.8, 0.4), form = ~ 1 | Subject, p=1, q=1) cs2ARMA <- Initialize(cs2ARMA, data = Orthodont) corMatrix(cs2ARMA) spatDat <- data.frame(x = (0:4)/4, y = (0:4)/4) cs1Exp <- corExp(1, form = ~ x + y) cs1Exp <- Initialize(cs1Exp, spatDat) corMatrix(cs1Exp) cs2Exp <- corExp(1, form = ~ x + y, metric = "man") cs2Exp <- Initialize(cs2Exp, spatDat) corMatrix(cs2Exp) cs3Exp <- corExp(c(1, 0.2), form = ~ x + y, nugget = TRUE) cs3Exp <- Initialize(cs3Exp, spatDat) corMatrix(cs3Exp) fm1Ovar.lme <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data = Ovary, random = pdDiag(~sin(2*pi*Time))) fm1Ovar.lme ACF(fm1Ovar.lme) plot(ACF(fm1Ovar.lme, maxLag = 10), alpha = 0.01) fm2Ovar.lme <- update(fm1Ovar.lme, correlation = corAR1()) anova(fm1Ovar.lme, fm2Ovar.lme) if (interactive()) intervals(fm2Ovar.lme) fm3Ovar.lme <- update(fm1Ovar.lme, correlation = corARMA(q = 2)) fm3Ovar.lme anova(fm2Ovar.lme, fm3Ovar.lme, test = F) fm4Ovar.lme <- update(fm1Ovar.lme, correlation = corCAR1(form = ~Time)) anova(fm2Ovar.lme, fm4Ovar.lme, test = F) (fm5Ovar.lme <- update(fm1Ovar.lme, corr = corARMA(p = 1, q = 1))) anova(fm2Ovar.lme, fm5Ovar.lme) plot(ACF(fm5Ovar.lme, maxLag = 10, resType = "n"), alpha = 0.01) Variogram(fm2BW.lme, form = ~ Time) plot(Variogram(fm2BW.lme, form = ~ Time, maxDist = 42)) fm3BW.lme <- update(fm2BW.lme, correlation = corExp(form = ~ Time)) intervals(fm3BW.lme) anova(fm2BW.lme, fm3BW.lme) fm4BW.lme <- update(fm3BW.lme, correlation = corExp(form = ~ Time, nugget = TRUE)) anova(fm3BW.lme, fm4BW.lme) plot(Variogram(fm3BW.lme, form = ~ Time, maxDist = 42)) plot(Variogram(fm3BW.lme, form = ~ Time, maxDist = 42, resType = "n", robust = TRUE)) fm5BW.lme <- update(fm3BW.lme, correlation = corRatio(form = ~ Time)) fm6BW.lme <- update(fm3BW.lme, correlation = corSpher(form = ~ Time)) fm7BW.lme <- update(fm3BW.lme, correlation = corLin(form = ~ Time)) fm8BW.lme <- update(fm3BW.lme, correlation = corGaus(form = ~ Time)) anova(fm3BW.lme, fm5BW.lme, fm6BW.lme, fm7BW.lme, fm8BW.lme) fm1Orth.gls <- gls(distance ~ Sex * I(age - 11), Orthodont, correlation = corSymm(form = ~ 1 | Subject), weights = varIdent(form = ~ 1 | age)) fm1Orth.gls intervals(fm1Orth.gls) fm2Orth.gls <- update(fm1Orth.gls, corr = corCompSymm(form = ~ 1 | Subject)) anova(fm1Orth.gls, fm2Orth.gls) intervals(fm2Orth.gls) fm3Orth.gls <- update(fm2Orth.gls, weights = NULL) anova(fm2Orth.gls, fm3Orth.gls) plot(fm3Orth.gls, resid(., type = "n") ~ age | Sex) fm4Orth.gls <- update(fm3Orth.gls, weights = varIdent(form = ~ 1 | Sex)) anova(fm3Orth.gls, fm4Orth.gls) qqnorm(fm4Orth.gls, ~resid(., type = "n")) # not in book but needed for the following command fm3Orth.lme <- lme(distance~Sex*I(age-11), data = Orthodont, random = ~ I(age-11) | Subject, weights = varIdent(form = ~ 1 | Sex)) anova(fm3Orth.lme, fm4Orth.gls, test = FALSE) fm1Dial.gls <- gls(rate ~(pressure + I(pressure^2) + I(pressure^3) + I(pressure^4))*QB, Dialyzer) plot(fm1Dial.gls, resid(.) ~ pressure, abline = 0) fm2Dial.gls <- update(fm1Dial.gls, weights = varPower(form = ~ pressure)) anova(fm1Dial.gls, fm2Dial.gls) ACF(fm2Dial.gls, form = ~ 1 | Subject) plot(ACF(fm2Dial.gls, form = ~ 1 | Subject), alpha = 0.01) (fm3Dial.gls <- update(fm2Dial.gls, corr = corAR1(0.771, form = ~ 1 | Subject))) intervals(fm3Dial.gls) anova(fm2Dial.gls, fm3Dial.gls) anova(fm3Dial.gls, fm2Dial.lme, test = FALSE) fm1Wheat2 <- gls(yield ~ variety - 1, Wheat2) Variogram(fm1Wheat2, form = ~ latitude + longitude) plot(Variogram(fm1Wheat2, form = ~ latitude + longitude, maxDist = 32), xlim = c(0,32)) fm2Wheat2 <- update(fm1Wheat2, corr = corSpher(c(28, 0.2), form = ~ latitude + longitude, nugget = TRUE)) fm2Wheat2 fm3Wheat2 <- update(fm1Wheat2, corr = corRatio(c(12.5, 0.2), form = ~ latitude + longitude, nugget = TRUE)) fm3Wheat2 anova(fm2Wheat2, fm3Wheat2) anova(fm1Wheat2, fm3Wheat2) plot(Variogram(fm3Wheat2, resType = "n")) plot(fm3Wheat2, resid(., type = "n") ~ fitted(.), abline = 0) qqnorm(fm3Wheat2, ~ resid(., type = "n")) fm4Wheat2 <- update(fm3Wheat2, model = yield ~ variety) anova(fm4Wheat2) anova(fm3Wheat2, L = c(-1, 0, 1)) # cleanup proc.time() nlme/inst/scripts/ch08.R0000644000176200001440000002700012710331473014536 0ustar liggesusers#-*- R -*- # initialization library(nlme) library(lattice) options(width = 65, digits = 5) options(contrasts = c(unordered = "contr.helmert", ordered = "contr.poly")) pdf(file = "ch08.pdf") # Chapter 8 Fitting Nonlinear Mixed-Effects Models # 8.1 Fitting Nonlinear Models in S with nls and nlsList ## outer = ~1 is used to display all five curves in one panel plot(Orange, outer = ~1) logist <- function(x, Asym, xmid, scal) Asym/(1 + exp(-(x - xmid)/scal)) logist <- deriv(~Asym/(1+exp(-(x-xmid)/scal)), c("Asym", "xmid", "scal"), function(x, Asym, xmid, scal){}) Asym <- 180; xmid <- 700; scal <- 300 logist(Orange$age[1:7], Asym, xmid, scal) fm1Oran.nls <- nls(circumference ~ logist(age, Asym, xmid, scal), data = Orange, start = c(Asym = 170, xmid = 700, scal = 500)) summary(fm1Oran.nls) plot(fm1Oran.nls) plot(fm1Oran.nls, Tree ~ resid(.), abline = 0) Orange.sortAvg <- sortedXyData("age", "circumference", Orange) Orange.sortAvg NLSstClosestX(Orange.sortAvg, 130) logistInit <- function(mCall, LHS, data) { xy <- sortedXyData(mCall[["x"]], LHS, data) if(nrow(xy) < 3) { stop("Too few distinct input values to fit a logistic") } Asym <- max(abs(xy[,"y"])) if (Asym != max(xy[,"y"])) Asym <- -Asym # negative asymptote xmid <- NLSstClosestX(xy, 0.5 * Asym) scal <- NLSstClosestX(xy, 0.75 * Asym) - xmid value <- c(Asym, xmid, scal) names(value) <- mCall[c("Asym", "xmid", "scal")] value } logist <- selfStart(logist, initial = logistInit) class(logist) logist <- selfStart(~ Asym/(1 + exp(-(x - xmid)/scal)), initial = logistInit, parameters = c("Asym", "xmid", "scal")) getInitial(circumference ~ logist(age, Asym, xmid, scal), Orange) nls(circumference ~ logist(age, Asym, xmid, scal), Orange) getInitial(circumference ~ SSlogis(age,Asym,xmid,scal), Orange) nls(circumference ~ SSlogis(age, Asym, xmid, scal), Orange) fm1Oran.lis <- nlsList(circumference ~ SSlogis(age, Asym, xmid, scal) | Tree, data = Orange) fm1Oran.lis <- nlsList(SSlogis, Orange) fm1Oran.lis.noSS <- nlsList(circumference ~ Asym/(1+exp(-(age-xmid)/scal)), data = Orange, start = c(Asym = 170, xmid = 700, scal = 500)) fm1Oran.lis summary(fm1Oran.lis) plot(intervals(fm1Oran.lis), layout = c(3,1)) plot(fm1Oran.lis, Tree ~ resid(.), abline = 0) Theoph[1:4,] fm1Theo.lis <- nlsList(conc ~ SSfol(Dose, Time, lKe, lKa, lCl), data = Theoph) fm1Theo.lis plot(intervals(fm1Theo.lis), layout = c(3,1)) pairs(fm1Theo.lis, id = 0.1) # 8.2 Fitting Nonlinear Mixed-Effects Models with nlme ## no need to specify groups, as Orange is a groupedData object ## random is omitted - by default it is equal to fixed (fm1Oran.nlme <- nlme(circumference ~ SSlogis(age, Asym, xmid, scal), data = Orange, fixed = Asym + xmid + scal ~ 1, start = fixef(fm1Oran.lis))) summary(fm1Oran.nlme) summary(fm1Oran.nls) pairs(fm1Oran.nlme) fm2Oran.nlme <- update(fm1Oran.nlme, random = Asym ~ 1) anova(fm1Oran.nlme, fm2Oran.nlme) plot(fm1Oran.nlme) ## level = 0:1 requests fixed (0) and within-group (1) predictions plot(augPred(fm2Oran.nlme, level = 0:1), layout = c(5,1)) qqnorm(fm2Oran.nlme, abline = c(0,1)) (fm1Theo.nlme <- nlme(fm1Theo.lis)) try( intervals(fm1Theo.nlme, which="var-cov") ) ## failing: Non-positive definite... (fm2Theo.nlme <- update(fm1Theo.nlme, random = pdDiag(lKe + lKa + lCl ~ 1))) fm3Theo.nlme <- update(fm2Theo.nlme, random = pdDiag(lKa + lCl ~ 1)) anova(fm1Theo.nlme, fm3Theo.nlme, fm2Theo.nlme) plot(fm3Theo.nlme) qqnorm(fm3Theo.nlme, ~ ranef(.)) CO2 plot(CO2, outer = ~Treatment*Type, layout = c(4,1)) (fm1CO2.lis <- nlsList(SSasympOff, CO2)) (fm1CO2.nlme <- nlme(fm1CO2.lis)) (fm2CO2.nlme <- update(fm1CO2.nlme, random = Asym + lrc ~ 1)) anova(fm1CO2.nlme, fm2CO2.nlme) plot(fm2CO2.nlme,id = 0.05,cex = 0.8,adj = -0.5) fm2CO2.nlmeRE <- ranef(fm2CO2.nlme, augFrame = TRUE) fm2CO2.nlmeRE class(fm2CO2.nlmeRE) plot(fm2CO2.nlmeRE, form = ~ Type * Treatment) contrasts(CO2$Type) contrasts(CO2$Treatment) fm3CO2.nlme <- update(fm2CO2.nlme, fixed = list(Asym ~ Type * Treatment, lrc + c0 ~ 1), start = c(32.412, 0, 0, 0, -4.5603, 49.344)) summary(fm3CO2.nlme) anova(fm3CO2.nlme, Terms = 2:4) fm3CO2.nlmeRE <- ranef(fm3CO2.nlme, aug = TRUE) plot(fm3CO2.nlmeRE, form = ~ Type * Treatment) fm3CO2.fix <- fixef(fm3CO2.nlme) fm4CO2.nlme <- update(fm3CO2.nlme, fixed = list(Asym + lrc ~ Type * Treatment, c0 ~ 1), start = c(fm3CO2.fix[1:5], 0, 0, 0, fm3CO2.fix[6])) summary(fm4CO2.nlme) fm5CO2.nlme <- update(fm4CO2.nlme, random = Asym ~ 1) anova(fm4CO2.nlme, fm5CO2.nlme) CO2$type <- 2 * (as.integer(CO2$Type) - 1.5) CO2$treatment <- 2 * (as.integer(CO2$Treatment) - 1.5) fm1CO2.nls <- nls(uptake ~ SSasympOff(conc, Asym.Intercept + Asym.Type * type + Asym.Treatment * treatment + Asym.TypeTreatment * type * treatment, lrc.Intercept + lrc.Type * type + lrc.Treatment * treatment + lrc.TypeTreatment * type * treatment, c0), data = CO2, start = c(Asym.Intercept = 32.371, Asym.Type = -8.0086, Asym.Treatment = -4.2001, Asym.TypeTreatment = -2.7253, lrc.Intercept = -4.5267, lrc.Type = 0.13112, lrc.Treatment = 0.093928, lrc.TypeTreatment = 0.17941, c0 = 50.126)) anova(fm5CO2.nlme, fm1CO2.nls) # plot(augPred(fm5CO2.nlme, level = 0:1), ## FIXME: problem with levels # layout = c(6,2)) ## Actually a problem with contrasts. ## This fit just ping-pongs. #fm1Quin.nlme <- # nlme(conc ~ quinModel(Subject, time, conc, dose, interval, # lV, lKa, lCl), # data = Quinidine, fixed = lV + lKa + lCl ~ 1, # random = pdDiag(lV + lCl ~ 1), groups = ~ Subject, # start = list(fixed = c(5, -0.3, 2)), # na.action = NULL, naPattern = ~ !is.na(conc), verbose = TRUE) #fm1Quin.nlme #fm1Quin.nlmeRE <- ranef(fm1Quin.nlme, aug = TRUE) #fm1Quin.nlmeRE[1:3,] # plot(fm1Quin.nlmeRE, form = lCl ~ Age + Smoke + Ethanol + ## FIXME: problem in max # Weight + Race + Height + glyco + Creatinine + Heart, # control = list(cex.axis = 0.7)) #fm1Quin.fix <- fixef(fm1Quin.nlme) #fm2Quin.nlme <- update(fm1Quin.nlme, # fixed = list(lCl ~ glyco, lKa + lV ~ 1), # start = c(fm1Quin.fix[3], 0, fm1Quin.fix[2:1])) fm2Quin.nlme <- nlme(conc ~ quinModel(Subject, time, conc, dose, interval, lV, lKa, lCl), data = Quinidine, fixed = list(lCl ~ glyco, lV + lKa ~ 1), random = pdDiag(diag(c(0.3,0.3)), form = lV + lCl ~ 1), groups = ~ Subject, start = list(fixed = c(2.5, 0, 5.4, -0.2)), na.action = NULL, naPattern = ~ !is.na(conc)) summary(fm2Quin.nlme) # wrong values options(contrasts = c("contr.treatment", "contr.poly")) fm2Quin.fix <- fixef(fm2Quin.nlme) ## subsequent fits don't work #fm3Quin.nlme <- update(fm2Quin.nlme, # fixed = list(lCl ~ glyco + Creatinine, lKa + lV ~ 1), # start = c(fm2Quin.fix[1:2], 0.2, fm2Quin.fix[3:4])) #summary(fm3Quin.nlme) #fm3Quin.fix <- fixef(fm3Quin.nlme) #fm4Quin.nlme <- update(fm3Quin.nlme, # fixed = list(lCl ~ glyco + Creatinine + Weight, lKa + lV ~ 1), # start = c(fm3Quin.fix[1:3], 0, fm3Quin.fix[4:5])) #summary(fm4Quin.nlme) ## This fit just ping-pongs ##fm1Wafer.nlmeR <- ## nlme(current ~ A + B * cos(4.5679 * voltage) + ## C * sin(4.5679 * voltage), data = Wafer, ## fixed = list(A ~ voltage + I(voltage^2), B + C ~ 1), ## random = list(Wafer = A ~ voltage + I(voltage^2), ## Site = pdBlocked(list(A~1, A~voltage+I(voltage^2)-1))), ### start = fixef(fm4Wafer), method = "REML", control = list(tolerance=1e-2)) ## start = c(-4.255, 5.622, 1.258, -0.09555, 0.10434), ## method = "REML", control = list(tolerance = 1e-2)) ##fm1Wafer.nlmeR ##fm1Wafer.nlme <- update(fm1Wafer.nlmeR, method = "ML") (fm2Wafer.nlme <- nlme(current ~ A + B * cos(w * voltage + pi/4), data = Wafer, fixed = list(A ~ voltage + I(voltage^2), B + w ~ 1), random = list(Wafer = pdDiag(list(A ~ voltage + I(voltage^2), B + w ~ 1)), Site = pdDiag(list(A ~ voltage+I(voltage^2), B ~ 1))), start = c(-4.255, 5.622, 1.258, -0.09555, 4.5679))) plot(fm2Wafer.nlme, resid(.) ~ voltage | Wafer, panel = function(x, y, ...) { panel.grid() panel.xyplot(x, y) panel.loess(x, y, lty = 2) panel.abline(0, 0) }) ## anova(fm1Wafer.nlme, fm2Wafer.nlme, test = FALSE) # intervals(fm2Wafer.nlme) # 8.3 Extending the Basic nlme Model #fm4Theo.nlme <- update(fm3Theo.nlme, # weights = varConstPower(power = 0.1)) # this fit is way off #fm4Theo.nlme #anova(fm3Theo.nlme, fm4Theo.nlme) #plot(fm4Theo.nlme) ## xlim used to hide an unusually high fitted value and enhance ## visualization of the heteroscedastic pattern # plot(fm4Quin.nlme, xlim = c(0, 6.2)) #fm5Quin.nlme <- update(fm4Quin.nlme, weights = varPower()) #summary(fm5Quin.nlme) #anova(fm4Quin.nlme, fm5Quin.nlme) #plot(fm5Quin.nlme, xlim = c(0, 6.2)) var.nlme <- nlme(follicles ~ A + B * sin(2 * pi * w * Time) + C * cos(2 * pi * w *Time), data = Ovary, fixed = A + B + C + w ~ 1, random = pdDiag(A + B + w ~ 1), # start = c(fixef(fm5Ovar.lme), 1)) start = c(12.18, -3.298, -0.862, 1)) ##fm1Ovar.nlme ##ACF(fm1Ovar.nlme) ##plot(ACF(fm1Ovar.nlme, maxLag = 10), alpha = 0.05) ##fm2Ovar.nlme <- update(fm1Ovar.nlme, correlation = corAR1(0.311)) ##fm3Ovar.nlme <- update(fm1Ovar.nlme, correlation = corARMA(p=0, q=2)) ##anova(fm2Ovar.nlme, fm3Ovar.nlme, test = FALSE) ##intervals(fm2Ovar.nlme) ##fm4Ovar.nlme <- update(fm2Ovar.nlme, random = A ~ 1) ##anova(fm2Ovar.nlme, fm4Ovar.nlme) ##if (interactive()) fm5Ovar.nlme <- update(fm4Ovar.nlme, correlation = corARMA(p=1, q=1)) # anova(fm4Ovar.nlme, fm5Ovar.nlme) # plot(ACF(fm5Ovar.nlme, maxLag = 10, resType = "n"), # alpha = 0.05) # fm5Ovar.lmeML <- update(fm5Ovar.lme, method = "ML") # intervals(fm5Ovar.lmeML) # fm6Ovar.lmeML <- update(fm5Ovar.lmeML, random = ~1) # anova(fm5Ovar.lmeML, fm6Ovar.lmeML) # anova(fm6Ovar.lmeML, fm5Ovar.nlme) # intervals(fm5Ovar.nlme, which = "fixed") fm1Dial.lis <- nlsList(rate ~ SSasympOff(pressure, Asym, lrc, c0) | QB, data = Dialyzer) fm1Dial.lis plot(intervals(fm1Dial.lis)) fm1Dial.gnls <- gnls(rate ~ SSasympOff(pressure, Asym, lrc, c0), data = Dialyzer, params = list(Asym + lrc ~ QB, c0 ~ 1), start = c(53.6, 8.6, 0.51, -0.26, 0.225)) fm1Dial.gnls Dialyzer$QBcontr <- 2 * (Dialyzer$QB == 300) - 1 fm1Dial.nls <- nls(rate ~ SSasympOff(pressure, Asym.Int + Asym.QB * QBcontr, lrc.Int + lrc.QB * QBcontr, c0), data = Dialyzer, start = c(Asym.Int = 53.6, Asym.QB = 8.6, lrc.Int = 0.51, lrc.QB = -0.26, c0 = 0.225)) summary(fm1Dial.nls) logLik(fm1Dial.nls) plot(fm1Dial.gnls, resid(.) ~ pressure, abline = 0) fm2Dial.gnls <- update(fm1Dial.gnls, weights = varPower(form = ~ pressure)) anova(fm1Dial.gnls, fm2Dial.gnls) ACF(fm2Dial.gnls, form = ~ 1 | Subject) plot(ACF(fm2Dial.gnls, form = ~ 1 | Subject), alpha = 0.05) fm3Dial.gnls <- update(fm2Dial.gnls, corr = corAR1(0.716, form = ~ 1 | Subject)) fm3Dial.gnls intervals(fm3Dial.gnls) anova(fm2Dial.gnls, fm3Dial.gnls) # restore two fitted models fm2Dial.lme <- lme(rate ~(pressure + I(pressure^2) + I(pressure^3) + I(pressure^4))*QB, Dialyzer, ~ pressure + I(pressure^2), weights = varPower(form = ~ pressure)) fm2Dial.lmeML <- update(fm2Dial.lme, method = "ML") fm3Dial.gls <- gls(rate ~(pressure + I(pressure^2) + I(pressure^3) + I(pressure^4))*QB, Dialyzer, weights = varPower(form = ~ pressure), corr = corAR1(0.771, form = ~ 1 | Subject)) fm3Dial.glsML <- update(fm3Dial.gls, method = "ML") anova( fm2Dial.lmeML, fm3Dial.glsML, fm3Dial.gnls, test = FALSE) # cleanup proc.time() nlme/inst/scripts/ch06.R0000644000176200001440000000702213331020315014524 0ustar liggesusers#-*- R -*- # initialization library(nlme) options(width = 65, digits = 5) options(contrasts = c(unordered = "contr.helmert", ordered = "contr.poly")) pdf(file = "ch06.pdf") # Chapter 6 Nonlinear Mixed-Effects Models: # Basic Concepts and Motivating Examples # 6.2 Indomethicin Kinetics plot(Indometh) fm1Indom.nls <- nls(conc ~ SSbiexp(time, A1, lrc1, A2, lrc2), data = Indometh) summary(fm1Indom.nls) plot(fm1Indom.nls, Subject ~ resid(.), abline = 0) (fm1Indom.lis <- nlsList(conc ~ SSbiexp(time, A1, lrc1, A2, lrc2), data = Indometh)) plot(intervals(fm1Indom.lis)) (fm1Indom.nlme <- nlme(fm1Indom.lis, random = pdDiag(A1 + lrc1 + A2 + lrc2 ~ 1), control = list(tolerance = 0.0001))) fm2Indom.nlme <- update(fm1Indom.nlme, random = pdDiag(A1 + lrc1 + A2 ~ 1)) anova(fm1Indom.nlme, fm2Indom.nlme) (fm3Indom.nlme <- update(fm2Indom.nlme, random = A1+lrc1+A2 ~ 1)) fm4Indom.nlme <- update(fm3Indom.nlme, random = pdBlocked(list(A1 + lrc1 ~ 1, A2 ~ 1))) anova(fm3Indom.nlme, fm4Indom.nlme) anova(fm2Indom.nlme, fm4Indom.nlme) plot(fm4Indom.nlme, id = 0.05, adj = -1) qqnorm(fm4Indom.nlme) plot(augPred(fm4Indom.nlme, level = 0:1)) summary(fm4Indom.nlme) # 6.3 Growth of Soybean Plants head(Soybean) plot(Soybean, outer = ~ Year * Variety) (fm1Soy.lis <- nlsList(weight ~ SSlogis(Time, Asym, xmid, scal), data = Soybean)) (fm1Soy.nlme <- nlme(fm1Soy.lis)) fm2Soy.nlme <- update(fm1Soy.nlme, weights = varPower()) anova(fm1Soy.nlme, fm2Soy.nlme) plot(ranef(fm2Soy.nlme, augFrame = TRUE), form = ~ Year * Variety, layout = c(3,1)) soyFix <- fixef(fm2Soy.nlme) options(contrasts = c("contr.treatment", "contr.poly")) (fm3Soy.nlme <- update(fm2Soy.nlme, fixed = Asym + xmid + scal ~ Year, start = c(soyFix[1], 0, 0, soyFix[2], 0, 0, soyFix[3], 0, 0))) anova(fm3Soy.nlme) # The following line is not in the book but needed to fit the model fm4Soy.nlme <- nlme(weight ~ SSlogis(Time, Asym, xmid, scal), data = Soybean, fixed = list(Asym ~ Year*Variety, xmid ~ Year + Variety, scal ~ Year), random = Asym ~ 1, start = c(17, 0, 0, 0, 0, 0, 52, 0, 0, 0, 7.5, 0, 0), weights = varPower(0.95), control = list(verbose = TRUE)) # FIXME: An update doesn't work for the fixed argument when fixed is a list ## p. 293-4 : summary(fm4Soy.nlme) plot(augPred(fm4Soy.nlme))# Fig 6.14, p. 295 # 6.4 Clinical Study of Phenobarbital Kinetics (fm1Pheno.nlme <- nlme(conc ~ phenoModel(Subject, time, dose, lCl, lV), data = Phenobarb, fixed = lCl + lV ~ 1, random = pdDiag(lCl + lV ~ 1), start = c(-5, 0), na.action = NULL, naPattern = ~ !is.na(conc))) fm1Pheno.ranef <- ranef(fm1Pheno.nlme, augFrame = TRUE) # (These plots used to encounter difficulties, now fine): plot(fm1Pheno.ranef, form = lCl ~ Wt + ApgarInd) plot(fm1Pheno.ranef, form = lV ~ Wt + ApgarInd) options(contrasts = c("contr.treatment", "contr.poly")) if(FALSE)## This fit just "ping-pongs" until max.iterations error fm2Pheno.nlme <- update(fm1Pheno.nlme, fixed = list(lCl ~ Wt, lV ~ Wt + ApgarInd), start = c(-5.0935, 0, 0.34259, 0, 0), control = list(pnlsTol = 1e-4, maxIter = 500, msVerbose = TRUE, opt = "nlm")) ##summary(fm2Pheno.nlme) ##fm3Pheno.nlme <- ## update(fm2Pheno.nlme, ## fixed = lCl + lV ~ Wt, ## start = fixef(fm2Pheno.nlme)[-5]) ##plot(fm3Pheno.nlme, conc ~ fitted(.), abline = c(0,1)) # cleanup proc.time() nlme/inst/scripts/ch02.R0000644000176200001440000000454712454433071014545 0ustar liggesusers#-*- R -*- library( nlme ) options( width = 65, digits = 5 ) options( contrasts = c(unordered = "contr.helmert", ordered = "contr.poly") ) pdf( file = 'ch02.pdf' ) # Chapter 2 Theory and Computational Methods for Linear Mixed-Effects Models # 2.2 Likelihood Estimation for LME Models Xmat <- matrix( c(1, 1, 1, 1, 8, 10, 12, 14), ncol = 2 ) Xmat Xqr <- qr( Xmat ) # creates a QR structure qr.R( Xqr ) # returns R qr.Q( Xqr ) # returns Q-truncated qr.Q( Xqr, complete = TRUE ) # returns the full Q fm1Rail.lme <- lme( travel ~ 1, data = Rail, random = ~ 1 | Rail, control = list( msVerbose = TRUE ) ) fm1Rail.lme <- lme( travel ~ 1, data = Rail, random = ~ 1 | Rail, control = list( msVerbose = TRUE, niterEM = 0 )) fm1Machine <- lme( score ~ Machine, data = Machines, random = ~ 1 | Worker ) fm2Machine <- update( fm1Machine, random = ~ 1 | Worker/Machine ) anova( fm1Machine, fm2Machine ) OrthoFem <- Orthodont[ Orthodont$Sex == "Female", ] fm1OrthF <- lme( distance ~ age, data = OrthoFem, random = ~ 1 | Subject ) fm2OrthF <- update( fm1OrthF, random = ~ age | Subject ) orthLRTsim <- simulate.lme( fm1OrthF, m2 = fm2OrthF, nsim = 1000 ) plot( orthLRTsim, df = c(1, 2) ) # produces Figure 2.3 machineLRTsim <- simulate.lme(fm1Machine, m2 = fm2Machine, nsim= 1000) plot( machineLRTsim, df = c(0, 1), # produces Figure 2.4 layout = c(4,1), between = list(x = c(0, 0.5, 0)) ) stoolLRTsim <- simulate.lme( list(fixed = effort ~ 1, data = ergoStool, random = ~ 1 | Subject), m2 = list(fixed = effort ~ Type), method = "ML", nsim = 1000 ) plot( stoolLRTsim, df = c(3, 4) ) # Figure 2.5 data( PBIB, package = 'SASmixed' ) pbibLRTsim <- simulate.lme(list( fixed = response ~ 1, data = PBIB, random = ~ 1 | Block ), m2 = list(fixed = response ~ Treatment, data = PBIB, random = ~ 1 | Block), method = "ML", nsim = 1000 ) plot( pbibLRTsim, df = c(14,16,18), weights = FALSE ) # Figure 2.6 summary( fm2Machine ) fm1PBIB <- lme(response ~ Treatment, data = PBIB, random = ~ 1 | Block) anova( fm1PBIB ) fm2PBIB <- update( fm1PBIB, method = "ML" ) fm3PBIB <- update( fm2PBIB, response ~ 1 ) anova( fm2PBIB, fm3PBIB ) anova( fm2Machine ) # cleanup proc.time() nlme/inst/scripts/sims.rda0000644000176200001440000031663310513125543015327 0ustar liggesusers_"""MVJR{ dHf!"IQd,!!E)Ysg?a_?|\:٫k877zӄNm44khhjT aGS؂@sa N ~ůhzzzzzzzzzzzzzzzps͋\$[BI*}$́gVi$n<,E֧u[.G[|63 %G,[Y\f=X ;Ŧ[b@8:_OP%{:$i3`L`vm4w7'fpG5"ל\Aq|pgWMTbnPYt`N:)u׀!yb 2>O!~V>ErDx؞E'~.׈s S xVS{tf^V{vNe, {\K ?3wՆ@ m=k][x1w:QX%?is髭D?X\x2#1v^u].`F`(Zr0nfVw3{:#&;$qG)~t++m]:3~b"(NH\rf`VƇ~22oK^F:eW|X wi=z˥0b㷇|*KwǍ~V %c`nJjnnso`_qv?K> 4f-LߜcgW]~һ&y !x4'>DY[ߴZGmK?tӌ$#0b+-پ.7"O+-)WF1,^-zxoγQ"dmL ٧.Zn7e]+4ݾ:FSC&`[F,[aV[epPJm2~>\a"P^_:. Xw{o 6 NŮn+Mn+d[F%]=ܦqˀv)7-֠Sq)n0oR-`(O<{kr|J?LfSTP,9;?b.N};ݵ)p?3)xnÂ&Voޞ1nM[zC%&9`b0(O]܃[ڋub9)u:y皼[+ 6XXFczF48`puŏ U^AOx't>苣>_=U"<ý&~ Q-;O3F26r >Dh~> Xֹ(ji\l|kٜ&O34m扶řLa9+N(j&Ujw >yK7e%t;% DOshDٺ>+lg<6'>̬y9o*@ !:sח ߣӮn9W L)^}`޿o +{s|vG]ϵl}bP9v&` M$}*;Ԡopoh<:j¥s+s>,4+`[D%m'/Bf,;|*۲< ;}:V+Y旃x77~+g,Cm]TUfؚy|Y9iK[njc7;Swo,uX7,z%^Ҷ)mN܈݁}s|ics^Ϟ]rK1>ٕh`܍s(b}YpΛ%:c^L9>wG< ͇ч:4+6 ŕ`<23_nv$!cG=%j]5krubNyJ֊^-Sc䉓^Si ?^Vs09_ AGڂ}zibd=f M,T͓ځ݈wn1P ۺ\ e5LA95>Ӽ(GFhwnlPgڷk8{j0O轌$GP"ެd6OnOuJ`򝷛̣͂=VU.0*M|: ؇Ƙq]^Xy~v~;Sq{{ ǩGn}֊o`}%:>|pR_N s 1:;gp^qtjIe V6ڦiQl*&Wh*pwђБ9ʰ<Ԧ= ee]v؎\3.U33OG]߰kzV\ߕ]-6|]<`1-D|Aφ_GK'k(&zx1R̿;(b_1_|\Nԩ_{0cZVS>.ss saOrAoᖰb7Ƚ=H{ F~|;c÷Z0摃5$~{ Cv :=CG7_TD{Qy6{}l-} ߨ$59=^nu4~*փ#n0Ç .> _ 28w9:SrIHN/P.mX {T3锱w`sp@}G23x6#pߚ;tϰJfVCa>tAÑPwP2wp쏒dNzјw|rKaC3p+<{ߵ8Og쭹B2'04P8<fZ3}gaYw1W_[cqs=ٕi逞xk8CT}s7Щ\d;#v ]̋U/zv?'_ oBp>JqYr%9!o{WG؇9'Uu/c*uԔܑz*0)o}Jc߾(+٥fCO[9i|[tvńzmfco>cci^9WQSueP䁶#|AV,yڞ9z4qFW x^UٶC&|?HE}❗Wp49q#j0Ϙ)9<Z/H9SїCCϑ<3xberk~1Cta3bis,K,Sƒ}c۰/S#g@uv; }-2r;eK7i cm+/+R 4]VşVN3q_]@xw x|9پ*u5_!:VZz=Of!la w&^_ ea20>}Vc|vd) 2ە<.eKM`C+y9i/gy#+x5GSsfnG&}uf"`w:5x7>9? 327b.lc4'_peYv??rtc[ZǍtĺ!~q``d>w@IQE=6&m߫}}Cхw;9 `cppy*^>ϡ FnֽOo>~;xΤ {nkucp uHP{|HWRp]]՘L֌u)-~`=r1 [!z$pyluM[`+~FK}Ls+O?E'n`4 {<"uQ`w ?:c-J`_ p7ج6bdAAƄm?Nl[ YљC޾jZ%Gg(>dWs0!sճuu^j. _uvK+Q8;1I5,PbƠX`%bw-ypݶ pbZ`(o͒] LԒԭaA1o=Ak pPvL7 (qxB=jnƺ׸[S]E޳<]co9ِ _FlNKMs/'ƺE`W꺥)cNMNfx3擊nΠT[VZVonuh/k \ˇnä=vvl sPxy.'0}k;~o}ve%ؗ]#83^9j:wHAЯ /y#bAq[lX| >+{m57[c}.1 ?CZΎz_ykʫGEBNg#Q@l([__rpgMKgt|ۮ`PBwqvnױtrs+J\]kxX~ i#c f6ٯ1 s%6/em3{QmC_ctvǻ=[adSVWu w>Z~1)H9E_~ZO6>W}n3d0`_ǔ~s-2TWuܔYK{wfe_O 8ț)X^[,ź2#/>6Vs|vBq}ǝ@(;WϜ>M(?uuSjo8/)EZ  y;_? C7<'2-ں_-?5{ }g!/aq \۪my#{<`B-+R_ot^GM}:|g O8ʎXjL_}pP/ /ڻyш#a7;549` @BL E'-:I@6Ӡ9n6gh1ݍkٴJh-ƺݚOc~ V.~?(]Hw٣|G:X-P0[v!Qê29vf-+ ߎ}^}0Fo5'lI\u'Y_>Sf=B/&>&uzyX9(s|aE1Ьp(x̹|d\:ǀe̾Y՟/eoº7*-D9[bYho*R[M` Lu[IA!ъ<(Z0ޯq8ڻt`_6e (}넷-oc>.=l) w{7]z6bړmSc:x=5<>nsh{'T i8} yȁl˜^9.90h!毸'=ڀ9W㮅#gҩ}=¼gU-`Ofß_5po։BsXy9lν"K y܂kZͱ.+ض'plAgn`s~0[+f{9oxL1v~z#^ґ@/<`v#wcX~$<2X41[+'ǼZP;pKfGis6)ݚ=;fx.n{_`24ژ`;͋ y$h5(Գdy_+ѝN6JMPOxTTO-wɌpaw;Ʉɽzb}N+*7ώ(?=3H=_W0?b 17h3۝5XW^y,՟S?c?U]z-sg̙]Kk77777777ߤjfT3j&P̈́H5fLSbT1xY'Kd ,%|O>Y'Kd ,%|O>Y'Kd ,%|O>Y'Kd ,%|O>Y'Kd ,%|O>Y'Kd ,%|O>Y'Kd ,%|O>Y'Kd ,%|O>Y'Kd ,%|O>Y'Kd ,%|O>Y'Kd ,%|O>Y'Kd ,%|O>Y'Kd,%D@Y" Kd,%D@Y" Kd,%D@Y" Kd,%D@Y" Kd,%D@Y" Kd,%D@Y" Kd,%D@Y" Kd,%D@Y" Kd,%D@Y" Kd,%D@Y" Kd,%D@Y" Kd,%D@Y" Kd,%D@!Y"$Kd,%BDH!Y"$Kd,%BDH!Y"$Kd,%BDH!Y"$Kd,%BDH!Y"$Kd,%BDH!Y"$Kd,%BDH!Y"$Kd,%BDH!Y"$Kd,%BDH!Y"$Kd,%BDH!Y"$Kd,%BDH!Y"$Kd,%BDH!Y"$Kd,%BDH!Y"$Kd,%"DDY""KDd,%"DDY""KDd,%"DDY""KDd,%"DDY""KDd,%"DDY""KDd,%"DDY""KDd,%"DDY""KDd,%"DDY""KDd,%"DDY""KDd,%"DDY""KDd,%"DDY""KDd,%"DDY""KDd,%"DD1Y"&Kd,%bDL1Y"&Kd,%bDL1Y"&Kd,%bDL1Y"&Kd,%bDL1Y"&Kd,%bDL1Y"&Kd,%bDL1Y"&Kd,%bDL1Y"&Kd,%bDL1Y"&Kd,%bDL1Y"&Kd,%bDL1Y"&Kd,%bDL1Y"&Kd,%bDL1Y"&Kd,%DBH Y"!K$d,%DBH Y"!K$d,%DBH Y"!K$d,%DBH Y"!K$d,%DBH Y"!K$d,%DBH Y"!K$d,%DBH Y"!K$d,%DBH Y"!K$d,%DBH Y"!K$d,%DBH Y"!K$d,%DBH Y"!K$d,%DBH Y"!K$d,%DBH)Y"%Kd,%RDJH)Y"%Kd,%RDJH)Y"%Kd,%RDJH)Y"%Kd,%RDJH)Y"%Kd,%RDJH)Y"%Kd,%RDJH)Y"%Kd,%RDJH)Y"%Kd,%RDJH)Y"%Kd,%RDJH)Y"%Kd,%RDJH)Y"%Kd,%RDJH)Y"%Kd,%RDJH)Y"%K*Klƿ}-hkx-L4]W`o y]Ei[́7&Ą `>i{XحBۧf7NjP`[_?;6~56v?JXIڙJHvK152`F-zrt`Nn=v\@`|$ٌ׮۳ԿZ Xò؀]9&μ (&9+x,us,\8 0/inz`M1=8Ⴌ>^noPzM|bp.0Rf \_iu/Fw0# ^ w`?tqV5_Y4jus檆KuYZ WnI\S٬``.ڳEϻ͠"?`VLvi-f{e(.Н l݊oSUh[*pgxGc_efC~=`9Yvv"C5W&Ps [4-`&113Vzq~L0mI (u=Ӯꚁ:uaKI]}־sv}g}\W^T7:*Pde /p߽cXxGGLsQ+edV;A~z%s, k){eKJg<!Kx lE&KzdQR#0so =mnq& fۭ]_t.F#?7jΎ*(&JZşx<ރCI;>Ve.\̀9`m`޳ה8AJ(Mz]Lr~bM޻ &ލ\e 1&W/ c˿bAWKOsjdȷ= 쏲H{8ȣ4vtU'x?,UX5>j;[A`OcoWYw9y[7ꟷ }_Mp?ȏ[1t9.c~q- 컬onއ/T=Oݘ[]>fw7u]g(j>d$p :ݿc^bp2q}vs=pf?t~Jn:CAi5tѻm y8kÒЛ:7z.m9 ZOZM[cqn^;#G/FM*WĒ ;;OllrѠz\ 7t8j>9 L'NgEbf/Hf_5; `\5]֘ U6L^o `r#";51h_ia-Pv~Ȫn,42֭p6Gx"Ow.WEh}}C,ܟՑAQ6WSF[s.xǸPG?N}~k??G# a d^&myKlݦpctAub'p=暑֝}xN׎lYmy-p{7TBC ܰ_|МH֛kZ\ z! M9pgΊfO+*ݣ XxAO I;0 N=붞P$uR\F굿uX:>S@DlzodO7oɹez[j[7`/=0ӇļsY 5VoWٻ3ry(>(d?vFfx6l#p;lљwہ_>&n>#"푒?C#m<1w20>sC;,1.n59}nԺ'W]̿wm̫˘wʳnM?(" -y34k 0W|d۝ۀSs&w8Sx6lte":`˗r+~=DG¿LMÇqR;D9*:<ݿ̋7:g] v?\QͼՕ$i^)vWw{0819o%<n4H;뜁7`îMwI%}_a":60ѓMxS`_⣟ZrЋ[w7;|ٵ\Y Sb:P:7/ҿWf88e gsȑ=S`u ׼4=o^ va';F];hhzm7hz=@]SSڮjD6p_Xeu~0NirEO`"S}`<3 K`]Em;c=}{prpu))x^osk}vl}KRq_/7n7G/.~{-Hl柃W:YZп *2 kl(}e|KfH#;4^axγ;z=j8p*J`޳Y.inxVOqxοg\9{DW#sCӽO1|T`is+(gGܪvn֚TOdOq(f?k5-9Y~l0gG1ȭY` (uc}_z+e5wseG]ty\mm[<~M7z󢡧7cEVv2p;0'sC;E7v&xb)yݞ;g١8C`E]w/V:4#6(d1A vp] a1 }!SNG8!*g;ȾY H:Sk8}!w3xmmKowvlXǺ0v .}xjw!:9/l҄G{XUIлS| \óۖI`Rj%y=@|rvy`~?>4']Б [ZƼQ6,~XG 9taP`^:_s߭~̳_SmYg >oB|n^,?pU&;~Lg{g}mѳ'o~5\ǼX?6<|ϣ ֭¾#o4#x?lo<*e'wgfIٷ[32?{OmUf61hb:G0zc }u,s8jΡ_}eW]ހ|W%D/EMٱRxk'{&_}I4>^M .r:C7<::ȧ+xyjkH>a%\ُf}~D8>Kz7o#,{ԏ@1zuӈx]9!_-.v:pI9@y2ύfhx󦅗\ĺ/n듉_Tm3Nl+z(C 28IΧ~`| ;{Us65uU /zaz;쳷? 탻.:eÏʦa葫<\ܗ熃Gdx 4;q_O9rn9+f7<DŽcnLkkOs6\ہ9cwXMpcmǟv8| cvw YP=eWcKClޔGG8}ݸSA9[, i%}ux\ (}p:tFmM1(%VìWc\_k[yMך 36G8Ao-2BicP9l**^_;T=``Z(|̉-@6sa؏->;xu0 ѽ;ͽݰ-ar}Z5ȵDe쀬[9?j6(ͮ6_RR +XnV}:(lltez'63tܬWk|b"o׌bwK c%ֽ-]cr;Yy6xj3?k Z^rzQ}72>WgL+_ǧMyaX?DZ/uXɸA"O[Y E⹵~e^̈?/{S1F ?ӌpfH0uTWcwU}@]`V}{=k=DuUbӕMx _zإC7)\qEo%Q.8V,."އd[uۊa˼gDm܀_럲rl T&A\ϋ  O17[76ppӇo:iA⸶ߕq (3Ϗ_V:zM"u]!UwwIPY9#p7o9{s6o"/V~A3D)R5;bhm2Kzy[`Law[6] JG˝||/pΝw~~ ?]|_t a^`c؃x>m62q. MT{ߊ0C7mF7<p)3.sw!_'?4 /U1}aK^؂vΣOd7ovv#9_Q7a97B>A>~~}:#HK#ו-d}cxnM/ V{Yu~xptU*j0z>Yr R數f싹 q-=_<(B)w}~ 3Yvt"(SGzfS2|a\#@.;\<TEgCfXC_0k?d2::PpPx,in?|:IA&x0dnR`O]vuE (AT]іX 'o`^v54 {8Tmk 5&xOȎf%au֯oۮ4?bL/?֓q}q yay:`о 5굙6ٸdz "Oc_!Zb(ٔPt{YA@ X7^uNgX6n :I99nS2j#fc߼SwXሠqT ( u>֖ S9ƻՏ@*tZI@.ܽƮnAmPD[ai-G{z#{|@>Qs~{-{3_`1#,'p}7_j >PUrab On^IXԙ*lL_#G5/HwƺڞP`I+ qݽW\CPrwgtVZe^ ߜ]pL7.Jg7!3p/`hp3wݺ[nUチX:,r~Θ1}}.͸.??ϝ v GbTZ y a7OͰoF?Gڗ QEcx>;/؟'FrϽ &`F+C3/ļ]i[Mp?]}4o|s} ٪۱5^O޳L}UE7~F }_|%t_6 <(}N$l;3OPxM~cƣy.ۙ@G=~~{{gI 0}!}31. f!噵.{C`DA77j?:Eηiw_-nނQ3)vjmg6f@ xLl}\ ئ ܎EX<0f.mt`asq kr;jKmZ5__~ҿ3ԯZRMկZw~ҿS_TW-;UjߩUKNկZT_TW-;UjSo~ҿS_TMկZUKNկZw~ҿS7UjW-;UjߩUKNկZg~S_T7*G' IJ霳>"K2dH$$cfQRHDdʔ$T~w>9+^5xΚKY+eZO4F-ͥZlll~2}ׄ+kR+X V`+X V`+X V`+X V@]瑤a~r |_.lpma@$Oo=qC@[7p=Fp~d41;Ļ4ŁTW4]Q ' Z l׼ Qͯ@||@#A|-Z[4fGW)qF5=,&@) ĻEEv4K mH +$@ok<NC4|ONyIe C݋@~@Mߒ%#׺ha'@x:-@ow̔5elwªd >~ZMJ6f e/=` tBf@}7QfgO*v糋_A9M@&q)PmݥxuZ/>'9^%y9-[ (#'2`@-:~Smy $M.> &\xxHV v[?Ӂsm//,'}Ţ>|!_E+^5GX֡iJ@/*owӂqIBl6--YDUm@;k'?yuK 6\u;C;GM"'wNtH+)vX .46z,)d'УWuϖAFdGX>]e"8W  Cz{I`)n 0foI4QTayD)n{--v;u,;@V-4ϋNkWOwO!Sa%n@^4 'Jm8jb ()؃b@\Ws:a J4I)t?@:=Y ҩ7V@FZAΎ1g iQ75/iQ }LS J BڹKffY"iy"5>ե`>Gŀl旌2"$h[ {}绸/gqVn`d]y^c>Jl< d@>g 3ݰ?W/]CeW"=)s=u<մB;SorB@/ ?`!Os|kNE#ⷴ{ tIK/^Njerc?WwuVj /jUΡ]@?^zJ{~S-F{q`r<ϴ#f`j\ j:Ra`]=Xp_L-?s2xNfks(3s粷jn>4g55! Qq Dn?dTN ľ|[{ Mb*j9sрTzѓyIσv$eb_ 6's,{h 8zTV]s- @|a(: d؂X7*b]@z mq̂j/J[`|^Zz*+w NTW+G7ϵ"׭AgܱW y,jNQ dVw1cXi{LQJSvO@,P,5}5AImwPk(w]^p=1:?-kD|4wKC?dIY@|}nW 5{,FgEBzjQSX7 g{?*P3?@M\cęBWm$Q 9>quZZ]{*`nR}0$K dBIڅrC U5 W-wn ~lCy #~_uqi .B@4vgsuͿC{.[ g$ۤ.w@eh|@6^,3'ez8U.G̀~5gtr~X({yH$KYk=ىְ/C;xo^1Z[:Ks-jݚo=Pe7=rka;KRׂ-Zz_=.@.9,pbH_Ezx}\30f.mmjŒ9\~cLS }@߰jW;PtۈIgYވP Қ: Ȳm7|(ΌC>zzaޮXeQ^"SO4@~|Oo 臛 .Q L:]>97-JqL=>5-ߞvǵf` sV}RfЌ|vi"G2j-yQN'-Tw@|6_=~ p#n4(ځ7ҙ&qdmvXp}zMN5ʼnؤ@n4*hO@h: \GC KgyJ ؛L?i>bְ;j=ycg;קAuVR}!Afċ;{?YVQ5…FCdw $d; gyn쪰XTόesʀZÞʻW'rYҚȋ%3@}j,?֩fqJ0}L~jV:wq2rDݻsG02-=::%JyrOlgO"%.←% ozmzэ@6܁:Kj09oߢu:oì PNc@[~_$wME=W*,uFı aՊ`I'A'M/pe/]pkPն>}!.+bOVuُA;8 d˨ x dٞ~mcͯnak[/|вԛx _, OcۿnOkO}Bv 0uuFs YW<7^J|Qt*yC!h<|}p8Pu6GJ.70]|V>&s"D`p=uFy@Y5=h\ove|oΆ9oq?dZ}˰/w@\?d n772qf]@$u:Gt2꫙U4no84ߗUq@53{\0e,xuly!g,Hƣ=9kezz P=rMgFZ8H%-AQ:xC:7`xgnV n'%RBwGF@ Y8izBi+/Pw MoW ׀\݂IC>9ɩ#n/VT;G|٣rN&EH0eJ7ʾ'9PJq`&.7B\7j}Mb^4WbY(j/twljg^m>ӟT+~Ǻ%uǜJDL&ԫ{W ~HUK/ BϠՁxNg Fm?y2C]܇gx6.0= Ul&Tәڠ-@bTG<*D_Pb ֕&]W޵O>xs۞k /w@9>A}ֿnQ)m[y ߲=~C({PvvE`_pKo[Io'z0ٻё'ny7Jj7?4E_\u (SGrJ w|Z+~bc?{ʕ^̭E:x /7dzo}#ER\!䊔c#7ZLn>z~{[ʿJדy!<ULR/|}2yg9 {L#͇ ~`s$ܡ }x7&P{bMj\jŢqL7m*f>02mMy:T1g Q/ZǪi^*[ hӪR "3x( Լ:e DI ΗUDeRS^ I4и2|Y+Ͳ.@<`|#EPcyj1.ōCԕ OWۗca @v[ uatWo gYطu5]r(u !.5Zlj~îD:N$9O]oqd>6 B\^j` C*r\ѿqq`ۈ"? .)".`; w; Xrk5y? ^k˅"@ZlTDhk R*W}S%wP'8QS)W2\ w9@́8U`ծM@<0s{v̦G}G._k#D5h꼿,QW`t۞@40BE4OyhV t0Q Şj4gưkPQ\z.æc,u!NYE:+:ޜ%zR&ub/>i!_'  '37_OzW:ac7WD}~!r94o -JMcPhNjͥM J'hcٻO{<_忉 ?.Jv9ms8RPv#0fU#|\X ־Nf%-6ѕ}1V.@Ջv?}o ¢b60#+xxtMG?/ !@> =2jSP迷n뽒ofa V +s7'=>cV7a5>xFmQZ$sU:S_=؁J/K%/I[ F\PHu/UulRo Ķ>@5PWҡsEu}r֡#?7Or # L׌+xcDl=5~x_5d|q<. .oGuuӧX7񮊆oJ Sz?\E]}{x 'a ‡_~ ~vxKEOzs")\8b9/Q+ޢv=q㧖w:yz W^@~܉a@[NNtgW2b[H6 P+rVNKšQ(,,>z&&xF-~-߆Ϗ~Xh26 FQϜb/խ.=^n5ط!Ukǀ(K}{}^P'ErϺh-o^uAoXO5GΌ5$CEK/^/ `ZKKZ5?=?e{/NEXD;2u i>m~|9B.{ed 5h%\jZ?L*?n[ig< )hZ=ׁEQ o3A?+s\y:5dIMIMIM&5ͥIMs)kR\ʚ4&5ͥIMs)kR\ʚ4&5ͥIMs)kR\ʚ4&5ͥIMs)kR\ʚ4&5ͥIMs)kR\ʚ4&5ͥIMs)kR\ʚ4&5ͥIMs)kR\ʚ4&5ͥIMs)kR\ʚ4&5ͥIMs)kR\ʚ4&5ͥLjbZb+X V`+X V`+X V`+X V7Yd ?cĠ@:f $W@ مIt$i=? .㸣[ .7B;2a=@rݙouR [ozg>UD|w!#`x(W-!@d0Vn *raݯt?N)*Z T؝b@*_DNP;qہк9OH:uZ k(U{Geyv}1@( 2f[x %'>~ipR#x3E(' @HGZz ɰ}赿l}[UV3P* .ܼ! 32V/[ z<@#; 7^p4SfN-nK66ѷ=e}g+PAUyT2n<f|x9 `Cƒ]lޜiͷ"f[fcf槸Pw(Td9ܥc@x?`ˢM@naz&}0G,:_܀1j깣@ܿdY̛i@'*|KhWKRּq|f . Wvmsv@y.z-.vl6Bg,_r"H)y^@~.gn_D" Ǧv=cZjF ,/b> ;}pȹ PD :k@-{PUTro xwڽqa1ܟC?'#kw24"P }w3\H#|.2<7ynxg跊}zJ_=h4[5c){@K>N~ tvat&僈|Fn+8v_3k-pN[ xhzn2jzբ@pr2ADP ?(q%uϸnjk 0\jS5ݙ@K-4~ $EN[E5quobZ~P2Mz\k{ {P+M[j@3q0vīZ;)KpscU@ ٱ(ïR~_]2P"_8CoD]?(2Oާ|yz8'ЅC0 0rJv&KΟAxڴy Pw؛CH3{Jy]Ĕe. wo)U9$CG wo Ü_;jc&;C@r>E<~O-芑cZ㔷$qdP% ?ƺ, #<Ο2y*qi2S.?XqsW0\sEsee:nN@yvzg۟upUTN*&0DmFu@T2W3"?yi@$hyQ=btkdT绣XJ9Ɨ^ɽl O@fܗe<^~3>y#5r@M zY%*#@KwKr-7a̧1R3i)aiJ ڛ]om|ίth U-ͧQ|KIq[{2D|"P|[LeP?YD?C q%y߉_l9tyΥ`Z jsq>)콺`'Pw]$#D\SE YLc&0#~ W_e$ [߰=}'0C(K34|&3'yrQ 0+}" E5@wlAC]U&SP" 4^"_OEvz#+|ifg2/7)x3σぢ*]K!7ӯ T_ѳA@1ɟz ܟҐ쮆 nj_thqíO|ʣ/{Vu핅+3@a#߈_ce/6W&@.jt]7ۂ}bcu'WqB}E=Y͋p☪/oqK4`_~ umȏYԽPk{k [#yP}pz>P=q}.9kZl2 V'u׭ESyq̛=@ޔR8$ wOuD#GBZ#Ig-}+8䇡Ñw~Y3a@~vy=(N5i?+9yzoQX{eqOEzi[8ʧ>H-V"XI>[ t5?Fɕ8'a!KB]خG q0b]&+'KCZGJ`X4u=e>y2`%lg^ZU3}_BH^;W?0RzZվ@sיB!t`-zTYÿ#_+W26@`1->pmjú7ښ́~3E7ϡD;0sUuƟ:C{+y\\ $-,o oL[zL]ԫRٯ ~rŒ@i/ [!z ew]zRMF UO|팀iAWEX@/( *;q穕6wFċ…%pͲV_s,yF/a)Zܪx.ix^jbC׻-|fWKkQrӸu2jmJ)SžvWܗ ̣|#~Հt6]~<-{Qݛ*6~( Sn* ꪿&C"k?Wi/ (jSgY+}#k< S]>+o@>ϱ1XgաH-F 0m5zgjéxr:y^/}6#ȣ^IY^|zv3YoTp76]B2yٵ#@\=s+!Zsq}i:65;sxkgŁ@v0b`Q_؋q>gV(L=ukPef}3B/[Kr;go;ݻ =ZD зy H~c_7^\' uox}|)ݽ[PG?;8$]j폼m%^NMW6 CfȹlnsgHu`Bt죿)J\٨?}xZB  y@?v)~ hyŧkV%a%r]>(&-}A޵)DB}hD6sEmG8tW=B3ĕC5%+j7#ߛ:ހjr0/o{m\PHz&@5׻z+q7yҵF]V 0vC_;GOu>uC8AO{ W[' Њ=e*>(je;uA_}I6=[ ]~迌.};z<'EKތӗ}CKPKe3 f?_%n SrVGյ@ 4KojSɇD_ճtC _R^O:,x|2/ <+c&j28|ڟ- 1y^n',wS69Lc_xBޕN'!T-<췇&[iv n ,j@z&>]:4V.ou9+m#3^.+5٠?s잽0̾@)=8$[WZiߚK,T`'K9Q?0,  ^eU@2<ݧIm^{NFÍNE~@?uq5u=WJ9|bz Q+Si`}&|zV.uB-|~_qNek7*5E|q}$[vn|_JAg9]=Zt] o952_lHpAR!ͭv Ԏ֡W3f=|@e/A5q)(ky&4{}{ƇWggSRzAPN #[or}K:ϓϑJϮF3rF!8n/S[q3ٱ+ځa{I kX-\1 oQ' nJp}%zfmFWKDb&!]4)仿KuWuU+^dOZyCoxpyd ]ݯ|?2֨%֨%֨NYR֨5ji.eZKYR֨5ji.eZKYR֨5ji.eZKYR֨5ji.eZKYR֨5ji.eZKYR֨5ji.eZKYR֨5ji.eZKYR֨5ji.eZKYR֨5ji.eZKYF-SVοjWpqR+93wlil tp7ww߮p_}AjJ~U T'fSVN.VlUTP^)uZ椅ƭaԮ3VF:dsWl=I…c\/w9ʹDJ]uןri u _:l-tm#fSkXG+"b-Q:|rk-A'I$%Qwe8cXڿu#j:kO6*Lg4,Y\qLlLlZgx2~ɚuCvuFxou>i3Y[))_%^x^T5}ظcE"3".(z; >w&0#׳2>_(SӧqaR:+wTmvCTEL.Ân^%7m1%ώt>[ͷ9 mYA0.n:缊l.jZrz+ 2n}0o4bD6eT1u~ }w!#/b r'yo80%EI]t5O0sN5F.{m\6w~Q~I~ ROetٰLK-Kuѻ=_!cgOP T|zǦ--ǃz@qRA5(,l:{IdrӸUzh::fL35o$V'l~-@?wb̢?\Z'\UsqJDž& Cə3'ÒfaO_|{hPUPHiCѩŵ#]7ݎޓ>Ȼ-x*/9]4pDXw/qgK=S&#J(yDomձ>V~sZ;V๽KGעuiFic搜&sS"W4DVDxMJ=+E WoH-(bmD0)?0ZV@¾V+'N{CQJ kCT(.^mڣR߹/%рZHgzOT[k-V.U6Q5o3˗W^dkQIWҎX#sCG^1ʋ(.r^#~ pO3L>b$rBgS<7+oϸ8ne2KChZ-jcы?N ϖӗuQX]i+xƳW! &YB ^# -$(̗2r@{É gk-SΘH/?u+g_]mΝc  _=}CmJ{̎(o^!v`;C\紓1\6<*eMo7򤼯uUˆX,4! H_wzO{Z^3'7UȦ ipT)%6|ܚQM\VͰk?`&^+'lۦEqsXyu=f|?kgU~FlU:^xt&XzCmҦGQe~ept\L3=yѺoĸO^y5][AMַi(yp~0,Iޣ޻G8p+} ʚVkmwoqOrzI)? ,ٻSB-iՙGVLvh,Ibߩ p JB25٨LB"eDe*UCʔ&C(X*uVsss]{b}Z8~%dnpPHk?eK/E6~Y1P(.&T.r Bs5ھ2;Z]HJ[xo:ѱŅ[zǵ8s<2l%ۗCq;4 ,GX㡆$N*9~HsM/oSzʕM>ڥ-[>0hQ=$6VԻv)b,mBh֫-R rt}gPSvLzZZyn@ٝu$ 8>)'9!q$}xu=xkR+l;)axˡ\*&%uC>̿N{ 4ٱµUyR[_gyȣ-,o /Υ z@jux^9"s^KqcIPv~@jbkvJHi.ot{S/ ZTk`:??n$6[ۀ8 Hoz\n1~`nz w^E@-~y@-$6wspHwoC"֛%rmж9)׫=vc^,Wi_K{ޏXΉO~l9# T/h8P囋.8׀0Cjϯ6S@zoj,}>=ϚƀX9tQSf`n/h?6D^7  oiԘ k> %{XtHZJ3@>],& |bi IR2ȳ=Sz⢁\m(يrs+V֝V\S]vj&av h]}%;% tϲ#|+&'/,?q>䴸hR}>1[`S;\O<dW btا9no%|'}g&[ `lG@9b}*\fh,2﷏Je ,~zwj2`ty υY \8v+`]pc00o8LHa<'B*>M 5`}sk cAKn]g[|8{HwX.Ϊrq>N3p]曯'yg]teOM@4O~xLwcpʰ*w1؝ ώv kg꯼s?P~%5@px=9i5+#c@-YEWP Ȣ#"wM|S hԁS@ M"n1F@􌃍79I,q;"dɉk?lۆF N<ê8eۮ SwGIЫ'U=R+Pꗟ[Oo׊U}zK5"( N,nċ?U@toˎ\Y Mۓfυx\,wD9 UI4j#\e|-ZQfnCzycb?mןS@o|M@?^'2>/w"yܷ9׷T|* vh=E@͘w %8g&R2.hI)]0˘]@:&ku_@nJVj2H@ -$)К~#U)o%[>/w{]@GԳLo)a]EV{s- gh -s4EGϴx:}rIm5 >׉٩ l?n"ĝ(w`} #ȷ /uN+O~< fi% b t]{d9 = \58oL@m . 8=1>Z*d̒O|U~߀x&3W0c[r:kt{!/*z9'Dx GB.G~@۪·_Įt)σnS~ݵGR+X!6Zw{;Xs$pv^U@9|~td0rij^FQo)6y4 qo #ٍ?'^#^7 ܗ(¹#3-z8D jJX90f׿Uy+V/@^PV؅x;xW>qt@\Xfu}`:2#ƜRǾXRY2K"߆z g@ؖXg&ZZ&zѦ!m@]wÁq8   g+sOړ8~gKR|R!Gsqnƻ'ܮ>~ yXNv ,%,@6^~~0$qCIxƃ74: \sB46 POɉƲ#?~? }ޤķ5_Ű/~3{̧~ x=?|BLBͨ'F2?G)&xr^ ȏ4M w@3akCf'Ϻ]K6I3_FH0=v BfF^jt)jͽvOj˚u올y2|dfVͧڠގ]U{Iu9S3Wrbe-}gp%g?")O^Pn jR[VmE\T⾅ewwY$^- dtP׍%BXlܮI>c5(@= 'We%o.Q/X"ʬ&gaO ^~ïLBܑ S8)W(V:pqGzs\9Ŋ gd;X+?Œ/v_VУk۶co^?nۗf8:_xPG+6ۈuq}@'o sx~i/>nV1PwՏe3)0VmxLσsH۷Uv JEgT*N`ϯ?}ٵW8J2/7:xy]-2ΎgucH'l` ?\G6ս>Nc>jjSyڦmw򒓿<;g9=yq7ⱵVQ6\36nB}s0t U%3Yjoɽ轛ݧCow[o} :㎹s5}~$Ob#ɝ]w E{F~یrٮ1moʫbWeP<~x9)~د'3H􆊪 ,]R -`z%=Rfˋ4Oc̽nicJ#dEs_yӫЇVF0__xOtgnYeɌ9́$Կ q<1Ii>{Vd~Up>=>C3贾 늋G{E _y̧3o} rp2.n䗣&nHp۵] }D%vZ;z*!&uA<_"5G|.˧*6D!nیML#F \GWtxs"&/i:yߕ8eW>ץjUODKƾZܭȇ'N*ZcsKCk7B\c":K^Ѳ} L3?Qx>މ.XtWL ߆>@ݷ~}9 O6D=gy}E]CN^c|U(}w׌~ ;2@h`lz5;y6M@JLR}W̱;/̻D QO3\墷,A<"?vyvR 7S_@w1nqF?{T C]y]G@'3oxeF7i.iEҖ5컁1ɗ4<8W ~La]y^'z>mY?n=_Esl=:[ v'Nb3 d>&e5MB6⯪|7yoh-`9ȳz>w 3<ݻ M}vmV`G| W;c?nUt'L|5'_,Aݽc+>7#[Tlq;+ؗs6!?H1QJ^!n|!0}̔l>J˃T3>IٿtqA{ty E̅=@{V&KȺu/dž s3;뇼dXl9ֿH.T(~ȃ_uYlğ=,rcNgP. Qhpy Xň~r*+v)`侾4sr ~{Q*glnþPhmʓtǼ-#7ek?Ke\Y'?j9P|*p+0f itsUy #Ml@ޙ-ugoaOyj'#Fe0F= !^c~z/j2'RE[E})G)2tW }ުZpNΞri;CP_^w)vb,q6A!$\=>o|wՓG.\ %ֈ P1": O O,_n?_jH]9LR{)_ bC@PrOMV<5Luvڍ ~$z"?zezX:}ľU>f$Ӆ"ST>`TXP dYxR(.C~CKϯ.s@[>/0ڝoBt3gE"ߛ~:(L7Vsɍ"J)é4kE-<p1\{nbAjKMt{ 1ޠR2ft`O9s'tmoI٬ jChi A6[M KOçd^BIwcߛceoJ;ĉ34Q+AڰM ^ھ'݇R~F!o4={ n`04e]F ɝw9}U7\}kd;Nœwye$ʶ"oȷ/[.-^֎h|>N]d<4DL`k=G,b:A]Oi,\ k$b[qo=L<'r>xl4/ Bet[ эk:i|<$δD⮞"dEpBJ<Ѱ`Y86E=Ql4 }`naS>V WOH.M #V'x|\yS}2];n i;>ُ |4$ >n>LqvI _  lSFaڱTb?8k,ߚ<=S-LcC]ܝ|h\;9[]lD.wҀHY}?P{b!P~?ŕcO}>dU[pwsҊ?-\|IkPآ }IhI?5  EݑEar ^=h@66_5#;bv9#Xi¦Ͻ!JXoOW;>-قo1vq sҚ&ȿ߿\¹ vR{`R 6mV},u_Є}'rR).` 5.yۻ&ǽ|iyfCOT7ۍsu.dp =aؿQB@$H[~S2qq_W9/y ߞXc~Fh|5Wv9)xިv <y-SSwg:y]@5 ;_Ezy60=jSP:~z 0)Z2u'<9pxUV@FgsL>z޹ ΋X OWZxZxZxߔt:e-珞½Q 'W.B^U'sVxeKvbu3GmHYڿojy9R!m.rV`BdR;.}꼺ЫnWcn:E Sժ;^HĦ\@-չ+ydt[9Lgc@C_,DuB) M^q5,]tUXPZ+d(@ekSʁ=e-|)С ut30%G:Ҁxya?L'䁮2ӡBp7\b)aV ާY@]||?2OLhk@n.x[R.)]5%9/Xx[ͽ\;y0w8p7~ wJǙ@moaPCPڍ@٭9!P%y@UΜ[ p@\7|}~+Jy'a7 R7rM -;%3dǿni0#'ms  D ?}cY vMؚBP|:,Z\"jt*n+G9+Tsm sxM20Ʈy ThUjY? \fd=֣4ZѾGj8v<+}ϊ9_:ZySgWzL}@TmFbZl$ߊU7g7:+24El~<シ)AEGcT.߬Ps i{jΧ@GFyuXI] 2SYd5 <"$#x>PQ:ֽv\ٜϡ\,9J0.ƤV _ ںBSko^jFlMlfv#γbЗ̻+ .Sġg9^ǾI ip3 >sܕT9q>hS֎N@8;U ̚rJO<9t* w N, 3n7saQжG^Zɏ=>>Mqi*q1;%QI$}\-r`pF1 ZPL@#!?(cSmx7`\jڎ}BYS&PFuo@la7A@e0&U@^lGqjGzLZus3-;=R~Hq{S~}M+ֈ#ukG{~X3fz]8~3PfL^'KOc%]UΓ p*kUc-@tם"{~*z!?dj`(F[A?7IS6\xˡQ;m'>]<~@D́zU4 -p9FeOh+Vn?;`~0£ugqgo1ڀxLv1?ZܵgqB^7fq;z^&۩Y9vtJ/< :dѭI@^2 X`!g8wwTfuSPbzsҀ\AK>f<73 @ ~_T@^ޝ@z`m3Ef٦Պ7n2pZa!x9s]~J&څ7Gv)XoyZpH`D35ȟlE@o%U9GG#?߾;"m۶Fb}ځƐw\rϾ܂KQy!^t;-TsNy?+`=C-k8q֐&ΛWPzj܋s-ڏkEq|{EerUv?.8+&}xKw D>\pqT>6 e^]RbjZ?ޖ1F'#>C=2OO؃9 ֛gSr(W}j6xٌuV#pR>0O=/tﶥ3ԂR p4͹.Y͈sҿ>=: cx{W?q;* _hxhruj5yYe)jϝ~2yWxnx#7I2&u rǰfȉS1#O\}_ʜ!,^f&yu~_:>X~Qj![];W:hgĺ@~4/?mR* 4y:-xFv@8)Vv_G]pWX?wt|֯e`1!Ђd=o/Γ?Mױ,i"䳫Y;udpFCJrH>|.0jےtj'*{/e}mkdNP6Oľy 09mrQOT=jƸ:,}.npf9ⰹC•rlpw+ a.3菇H!9xrw\Pԋ|nJ6ݞyypx50Md=2L`}LJznT ǯG#5+Lʥä1lq<3UKo./+yy躹 s/4cmSsz, []Z@AԃK.` i>>r},xجPljG܆zɽ8s fma<Դ2`w^X%Dbk8!%b3my{ RXu@ 3UT3B>kzm@yQ&ߺ/ S@:%|m#Ҷy5Y})1t¾}A:-܄>P=0ܗ_ Wn#88z0hvcUıS0[Mc6"//2Y}O9|?\gC7Mv؟eG^zjsR\*؃6AĨ odu$5b@.]8e倾fvxab۶lͯAv\$ָ4;YQ`䎖e[gnX'A7 qCEUG$5 vqġn5K4/S ydGo|oz& =ȟw-4s*VB_;itӟ=XM xPK2 puc$&:nm-\~鱒5)oW3DYux lyYjˌc1)G>*AϞuc`Mz wW Un_@o3 qPY+jlG['ο_ɯy`bY"ߍzQ#\m?O]gOs>fQ#@w$  ߯>3c>(g>7K:nA,X a|z5o`A6~ 9m:MM }t1O/)NۤblK`K5efC]oCߧ.fkh3ȟ xxH}7S@pDQ=EB/+oE"*xaG2)˱?M b6adwS~y~*ľ>M/ǃ.n_n~:%'ru.bة4/Dy-F_'u}pq~>8c.ӳ>]u #feO>2ob7)iF[E1ާka[WDtHMW\s3*dKzLұ_TN8Xa6O}qϯ<\F>.XK^Mi$v^kA\`Ր)Ǭ}_Sb8ξ!,";oIz}wd2 U/= ?S ֨/EG=Y]z0UiYfzosg󢁤UG}#ˁqw7S⷗>@_z8}[>ؿr+[J۾y[u=Pz ɜY֠N ٜ6靨3;sIg&uJX3 @6}9M.Ӓ#=W9`-8MlE.U^ͻ'^?00rv/{ }f)nz/Z C^@]yϥ W+^b?ޖq5&W#>5dY$ұ7s8žU:9GǍ8Wo?߫-eq)S'x >ޛQ[f#NԶ<ݦ'F~'҇s uE-EUuGf\8)M6V@>_q-o)/ z-zkQ.lisxJcq(Pl@ƽ- \#We~]/ LWڢVṯr#:xT+4]嫿> "_|@CS>y[wq8#_A,+81*5qXmeu6fgV[ZC'MXa '. n.d3Mc%z/CI3%77\6E;V=5x5q!em7-ǝp^?#$򹯳»;n#ngUM΋Q/D!;i|*Y6G3tY4sg<<け}Y쫫;3p;.Y9!"k+@e<QϓgCޯBא ypxŭȣ/Їp-@~hp4x!.P'uky'طÚuḰ|]]ۍ&YTqh?m}aEd[q3|\6Zv}Q/}.Հ<ohQEwa&Qɴ E]2ĉ&wPT%>O/r6nH;uaʫ @*>wz{tf#y^ٵ0E6ݻHf ېkۜ.yz΁"3ۑ݅,M 29j>d7w?;{ ³t?]z8goT>Fߨt|+msM],VJ}x(b~̆%A;s}Ӧl` z߁TD֑ 8;o_U}{`|k33DvIf!^9z|'.XI6W eԚ뤣Wb;љOH^o1@?}dRvh?jڴc'?^}I@ߡ=w\>|<|s/)91莙z> s]W*Ub"_;'ɗ"mc6W[^@&8>ùUM}La)Зc9/0Xvy`3BU/Ǫ<)w^ o~}? tV{2vNQc;N.E9ϼzbUk 0kEkݘ7aӏqqlEA8j2Eo>9&{+ y$*5w yy }PvXw4Ǚ:z^~| z60ZŕJ쿆`h~]fzm~e%'z\PKub[}G*|CQ7,{^p:`pbp Q+.^/e:Hmhԏ*3܀%nAo^ɇʛl3yso ~[ [TV*`)TEd8!OS=/N!O/E=%G 3,h0z^r=)ɺ0?|./uӗ-F{le8>φ̓وJKPO= S6Fvp;Q7{O %!Ԁ\f&uD᝵j?kkkS֪锵ji:eZNYS֪锵ji:eZNYS֪锵ji:eZNYS֪锵ji:eZNYS֪锵ji:eZNYS֪锵ji:eZNYS֪锵ji:eZNYS֪锵ji:eZNYS֪锵ji:eZNYS֪UK)+jఴOƹ_?23`+X V`+X V`+X V`+XzF*!qunU\MJMP>SD~3 Ƨ杹T7Vl GOu4WȽHj`zpfgЈ?#~s=;Lɹ8@_J=]#$fѐL0o:y<[2#cН{ˎ( tJx^[s}MuS'-w;Ri_+Hsz52\g@%ͫ}w"]W-jtN8ba>L`nlkĻ0YY*cJ.q@i-shw\{|o[I =leC@L9틃N'`KKw_zC@2fZ"A).[P7䞇@&"KU~w-l U_5k-2-ZwSj&R| 5@տ (^_z20U/D`ݗ>7R%S&o9*_sٶ"o6upe ΦwUy^P/dz ] +|^K 뱏s'*%f- ;lS5k,wq$8Q֏}edbwWQw/z7#לa@,֔%Wuz~{Iadľ:]Sh`kV?^g:<HCD<yyxέ]m@yrK/r}y;L3yVSIFӴx.7m9"_uskֳʀXY?OIL>,8>PjVa 4Se9vGP  'h a݀vsY}&b [<ʋOHWa03Ɠ8Ln آ~P]Qn|_nB=@Q3m{6K^+߬^*g9o,}ptg0yV#0| %_O#Pl ԠkՖ )/3 ?uܛ $5ǣp>?d%z6^&v?6T "2!N.v];] G|z^̕_Msb];~mpyzfTC6 G p.PՙYBxaieεJ~&0Y'/2t$7c<}cy:ώsFcYh2a h wpL9dKܜ:`9ڽ?Ow=ЛGʋc"6)-2.C|=^,Sf땁ў21S seuykjL}@s䝍 I}X}PyA 0IN~K`NIU[CZUsxGN< Z&fO_zۤ2E".XWn\RgDZ/ yWWU@˟Uʯ'/x!)uJ މ&)(MZ=4?tne:*a~j5ʸiZO8,_j@.y 4X8c3\-_Cv~m.MHF".c_X=`|x#qz-!׼5l'7Lt":F7֘qWZq8oVaw쇃a؉,fĚ4[#G"y7&i"j\{a(oѩ?jP t @zսð~A@ z?{o)B"$]|׺zֲ9纮_C=ϳ]\`(%|Y!NkJxn Gtm-H} ͽmYv {5}U7P-stX)筼E8NAQC3_a;c& $τd-QaW{B`;Pv;ˤXܓeHгO@>u/ĹR}y Uqsl.d^YsI+*ພNWs72VuŝST_#KJmn_3s\EqxW߳[}P/{'(77=a&eI%qvff oB|P>!YO &D 2 .l&`}>su"myk`A{|޽7H9!kO: 5d@?ewY\~\,{t '.r>0x{o8+mpM9ny>GEVW\O=.BobދDǡ3'lF<=P&3g΍v!UDީwTdHyY.'0UEYϫ]*"CDG3Z&t]ݜqIRyC3\SiP#A-;/%T~ľn= ]Ffy\׹lst;xL5"|P0XiZu"Pf|4ɌOW&S@՗7) WgKs,飿%[Ynve~'![~kld~5yWȪЯۢnn"ᙩ@ӾcY<ݹyɵDg7Q?3n88vy?:C~f{/z<˖JgjAXTمQql5yT~d|}}6;w_~~>5D>{ Y+Nba21m ҞT`WO<0VSJ"*+NؿW@W6"Ļ O ]'%+vg~L 6@: s;NCUTԃ;yIq|SJq9YǼɗTe=q{G^ȓpm|RC;uXoy7OuSsҝA?8fuJ^uE;9au̍?$| ߷#L-?`є N<ߵ +]yNO8Qo;CqS,^,|yK_A/Im@߿Э6Efo{~GQzxВ" Y:u֕-4u2cd'[{s ζ;Y+}p%~zxXdѾkhP/^u{<.-#Zq37u/⹸/RU,SZW7=uN,&-Ջ!t;wPgkv]"wv ʡgb[\/_`;D`_D&qh=ERjmϢNMVsߥo 733#7b*\N׀:#@P4Gn':G672=~~jNJ[> ^vrĕ/wLSY&cEF=Z)h_!'p U7eWu HW)s;T;-V0w %hY?f5Gs" w0+yΤl_ oO _p(ż}m @+zʧZqgf PG~P{T䅻İﲸQzWTh5!Q.8Y"0|}["0K k*cdO*p<@f-,s,A=RXh wLnr4(죕}bf1)Ovik \~4:fD_19m.}ҪoSFQ?Xs}KC6@/><+pf_#*U*v$6q&R4u֏S @?k~lX_ml ? ~|@5ME Jp {IEĻ >ni@D^r@ƈ V݂C+ފ`;n^<T;1ғOY耚`-a?j6SIO|+Jw֯JSnka߿4tD:k2>UCL/UFx"?눸>Q\\ @{'FL G_p7aOSmܸ/wO-_7ή n( >xpbij-Wbu}ˠf} ٨b?7ږB}Ny@&re>~jdMK< .;RxX*W1Y\ݣi]-1CQx[iC4KJyD!W|-Q+ϱ]3Is r;xfUwX]_]] lguo Dѿ &$ {`|5u"/KtW"2 Ś0r@1빴BrYY ;IVխ?GMTr\!Gg [x?c߷.wR= @ɟ0j #m uS{_vMwA^⾀}&K6R;$ŀ2sF2@-qȼ:>w{C*v~+RY~&8qР4-ܛJ=': ȧVhF . ^}͒X#}P7hR ǫFa\~8Y0AA\'!qi{ESտ}v+w5kO)Ye[uH{ A@<)K_}+1sH]f;oֿaBDXICpmyfS&/qo<}ZSӼȿi:m@ kFx- ęp&8>:T eɰڱǥ~+75]{!fyg R*!Dl(b⃗Q--^Eȿɯs'6.ݎCJQ |_y$Oؼ:4D#J|u6I~t)a,P7sjq6η)TA]!/Pz=ņ@e|~S? e7b3_Ϣut3{ T,⏦帇@~/pRd& uޢK"ڤdb(i fk@ƝJj`qp12^@LSD;&$}qTVPל%=S?RSUՁOHN ܜ}5P%y"Vj[mF {G)*b7:ipyh"D@v:f~=&MW35j;\>J3E=zeL79Nqm. Uwl5rqgRj$'ouVqo<*D+-|'*H nq|`Y{lw?u>N.;@/l ؘd "uVc<wrS4Ri=S OR7awfܧ6c?P:]!MY MՒ4t֑ކ/S:cɣÂ@rY: uOM&t|gB!ab s! l6l2vm ʦt }T粥4̌&U!ʗXʡc:܈uBMz)7YM@^e40tcH].xnϚ? Tf |I-qߎd-tI6BSڿֲ5E( 5ޑw\+@_.871[@YĐ3=P~a2u dƁsISX_Ϗz~ٻ6<*~B w5m҅Cb;ns }J}Ps$w֛3fώUirk:զ 3wJ.irU\,Q=Suv$53@35_|_zU>j:~cFd"Vv~/)^6au B2w9UgEA|/ e=G'eHtr v|{0t0 oւ/F`T7~MU@t +ߚR @`Ϻoy@<3] q'"qm?B-K[Y+d>~6>"Od(;U,ڍ 1cy$x:^^M@H{@ݨl[ـt7]h>y]^+缿7[m]+:ԐȬKy刿9'l>ӭ9"z@rRJ_`=ny?#\|*C"݋*3sҏŤnH)O8P5v a)v_O 'ިb©ty>) N|pL9Ɖetm0K)C(@tZ7;1um`;=-wD薩N,%y)f؂;yu?WJ+c~8:tK";/Q|NHC#>:Աԣ%m/dB A[ʻ/"o*nBφ!PnЮ9̌8qzji@\~+z: @,ݤźPNƓc5֏AAǀqKXD}F& }=Pω^EnjL?77b}_T9' ͣ/0eD\Z츴x4fֵXTI-P/乜]gޭ,@C<> qAN?s]s׃)" {_B7?gOu@WFklKk!b@K uEǸc拝8B@5Y!?tr@=9>)uȻ7gx>"eԝ V" vIuk5 dQK#y@關dp:6.}C_a8Tn$˨'C? 7Ƈ[y IV0=4 ǢXbv![Zy557`i-mX#Y9o%~6Տ8>u>% dLXߺ+ʸJdXVΪY,P|tD(楶ΖxŜ:;:ɇvs" Q_b+bݖx>x`77]g=yAv޵cP鄽0@"Ǎͮ 7Bgg߰ߔ14f Mrʱo!ߥSVF2q$tU+ (o]nGy7ȋ;$D68;[@Qsa䥳Tp]6AA^ \V)o79d<Տ qJ'aɯ;wfXoFxʞr(+>76pJ.ae R-K:k>'_AXPW<_ܷ(Ce?4K2f؊o}˩]PlߘA@~c+nm?)]Ӛyx./jp<\Z$+{aK{iZđf%2 ޙ0B1 Geq3ICXww uUzie*]{b-RQ"zk ^ѧuky ҏR |=_zKR" 5,7orvOT{k b)!ۜkk ŵg|JB3djP8~0OD u^' pY> (8h!sDh֗"nӲN:5OL?ϣ($|G'?#o͎)5|%gBOÝ'*V[K4Ma씵цx|w.~7{Lyc>pFAS"62b)eo *~| ߋgO,!/.4"߅kc5@O^J{{⧊'[Sy#ÏzoB^_㗁_..1"gvPo{ Z>4 D򛹸Uƥ̛j\,[7=SE޾{ ,!Y#^KI72f{P l,;[Qՙ 5=r3$:q#.A+^nf>}T>èǝ %xɧ+2p_@}XX1-Eps+TYӋȃߒَ8Ŝ+9 ɢ-@53F9ăo! /Ⴛ_Y>w[.ɍh{ 6_>A]!f:W|~*&(D][#K&LuIcqi:E_/%<Ө|KAa?ߔ|x?Oֻ-@Veoźx,1j '{Qwdu!6Ji__W?县y-(:ZSm@yU|[́ZN;7:x[[ u/Q9/:>W[a_@duĐϹ$5iYjxJ$}.\A%r|Rrk6P|чG(ۆf"z 긕\c?6y0s/DQ2&zٹǰ/Ӕ(A3?״YV;/󆆨ˎ ǺAy~Ҷ}@ƜZV􋯛n4E,ܹyW)iTJ *þxHG_ðq|{QOde:rMy\>Vi6֑z_)` gDU3=O߿u#֗ZQoTEߢ?zuqf0H0W{mv"*3+i_ޘVuE_|@, *p.sO>Jʨ%w ےi10O|~m"|wzL)ޟ#sp䝠?%xiw~A5VFq5lޖg&\ų^qq yq&뢎iϦ;^\4E.W|$ 4R|\.2~`~ܬw֣`81:7x]6;e.΂|2 v wGqoCօw+>? Tk]i/o9|~ Բ4I^[tVC09]URbG'PfH:m3BF!j:̦u<[ȅ6p}`#c z/x> wHX/~ft~B4⹥S6ǭ:8w`_ɎU TMW*V/!NrF]c!;I9^Fy]ʼnݥ'Qީ:'T򛶍m+Ui@LURBȯ.@ob R8G~b}5sV3ytUtp,Ǧq+uQ^|itkUXY W,4PuC+'&w"φKja_r~߂uy Uj׿MYN(a u ]lJOAc@y,NOr$MI@ZF\ȿ_R\G2{Bcjƅ?Lqi|*\F &ï_Kx%tAڳwkIK@\8H ׺gCG*Ԅ<(tƓ}+nNFwƨ+P>l>$#U927wv>D>qюw)+k|m8~ƾx#)[\ݾ1yuw-OC[v  5+>>uD>ԢC!n(cqPGӛ >މl4z k{أ,͹AŸ9qtmdQKQKQKMiSڨ6ji9ZZNiSڨ6ji9ZZNiSڨ6ji9ZZNiSڨ6ji9ZZNiSڨ6ji9ZZNiSڨ6ji9ZZNiSڨ6ji9ZZNiSڨ6ji9ZZNiSڨ6ji9ZZNiF-WYӼ>b2F]']Ν:8uvcLKn,-w|i}鄋ǻJw]'#yUwsW72$=c4E||iPmBא+_g\t^#!zqRfٓ~nϊXu .;q-Ugj3R3ώ}Ѥ>v9=wbm EgۼfT(tr:w>*ϺoOeYR~h;gq/ϖ<.Ô R0+3{YͩU~ZzM:-&c g[\iG݀St&yкuB'Ou嬙{N?S|(e͎l;z$j) u83߻`@֯*) zl\h!Ĥ~3J ;~TjPb]yw_W,2Y羖upr{jf۔ )Ew &vHr qXDŻ':|Pw/<Ǯ'&OE:]_{ gvSr:49͉ΙR7e:kx%"jc$k#M!Fp[KӾҤ+/-(9R7u.C-_s޼)yɆWXF:)+UsЈ_Օ^U?j= xvvK{!"j8#KJ^9n Hyy^!*Hvz\Gl^d{(,1-]!G|!ɭYs$4';ڜ~J@kO:_¥ֳ5 S[4K՗'y=`cڸt؊woÁ[띿=0/gI >Ƣ:]r9N|wgXOy[G}%o'jk[3`6ݟx?LOf\qO\=$OgYy|ˉ}1  L2Ov,YQFeXen 5:Wz MW7q.펽75PME{>ioV d59µz}ӏ|>7v\ v, . P_/5Õ|o-2^u0ή1st*V2cx6GwCY~U~-F=yc.W*zݾл]Eϧ잱pQ|/Cg:{uy֐stO1 oq;`fޮ=Zw^u`SV\|P$Uk$*+EnkΆjaּ[-z!1+]K[;b:Ыt,+}qLő!p:d%>1Y>)+m./$S)ejg@CvO^,xy--Z?+>7O?1W7mpꫯ:Q=ǙۚG]wg$U>@wZy-eYkU~y7g׾w S8$ʮ{E[X_D5z>rUQz~c_Tc Qk͕b}MnO1m|/vaS[ U[yXB2+)- +e;#o1zEz aZ-W+ 6UQy~`#7vJL:X},1G/ҵ9Byk:|9nQE?mM 1% %P]wC-CPPKt Tu\xԫ[ak^d r7 bK=J6]8ٸgKԴFk>58uVKJãX^ eN.ݟ Zp?3jf]v&601/e~>1EJ*I /KS~UoGTwXF+NvV2dRqsUa{t@-ۏ͹C_uKV=IF?w Gpf7Lg< ">OݓYwYJ]MEI6S1 o;6rrzԹ-8;h91P1WySIy %W6\T1'wWI}p`Tx3/I]=hAn׌<.]k]am3RY} ^l6O$]XҶM^Auڞv8{Lxڎgi" غYG~ J''F=mY22}b;8GMW{lj񿯭$]qSYGSW+t#O&1T/VYm(-hA ZЂ-hA ZЂ-hA ZЂ-hA ZЂ =bY2hnߠ3#.aj¥d(;>9 bQ ˤy͠VT}I-JJب7 *:v\(e>WҞ$[ö[՞ʀhTx*lanT9P3pxVno,AE^;hnyеq|܆i_['WNb˺2yruT.1v'mA%19KTg4Oʍ]bZ p5ѪgOhn+k"2PKT]j6J?3ʻtwoiq:1PeN3ʔ.`6=/F2ygE,(&r:1j^ +})՜X _Iw[xuSHWv ^ |7UW4v!()>!8M-u !w}(vȑ'4An*o~) Tlk6d*:*h 3ƒ&'.spZ=2% $(FR)I="P 9ijANJfsF;˾s)r>**i.PϚ?ؖ:odoRTeôʘ$Y/F)t1n=$o CmjO M#X@y|-7h|wf,-f=l}.hhoQF@j@;E?lxj w螮ӷm{ ZF]@ӐGBDIԂ>"lWO*o)g}'O _.AY.0sMM9X"ߣ.E0P7T3\W[灶V}eSP@^m=2@{&>PT!akcV,$(ٷ*ݹW7% x߆Jn{1P^cԫJ*>54/fƀ奰oȊ6=2 J1oX-@=U9tZ6SCNr8Pڥh3:wO'EA٨|Ц$~`"' z[_OT@E\E\r t߬|3f 'TpxXσ1NyOdZI"6_fm p QpuX^FTǰ";?uu o@gg Hjxƒs4z^~==`yT_|HͫiAc]!thpK8· oy4eY,FF:|en)P5| hxK TW_T֨ǁ.]ṻ 7*;njޏ.*YbLwPX}@s ;θ(Ǔ;Z@ub 'l2sVmFAie߼'lO 5}A ḨmKf#ʏmh-Lx6iJG_W @cE{#KP=v-#NgO@UsMk~UbUhn_Fikk7TnW[?S T&P\}P~z tݨe V)2I-vsL|swyP0 @lB7!g 4}L%ԂA;op7%_@y;; oA]peٜ)ޠT6j[l*~s$関k@fCtH m:ajAMYyR5Ш   Z +*|AA}ܾ8Y%V}'*i Nqaׄ\AlyP߲C>(s6.։l\$T77PHę7`dR(BHl d) ٣T$IB!E%>|?9s:yNu :刌'> ?@Wnk 3bX֤s (JiUIx^0Rsu>'J;QMh6t5}i^̄y0d Aj`rδl }U¨Wlˠf{n>.VGU# r]~D>4 1DGmvSdBH0h\B_{ #9KK'="4Ҳ# IiO+ ЧVlT@P!}FЌq_2y1A(w\%k,@7tf_$VeI6fߟ Ã@NҺEj&I= X ,..qLdNîx!C#H=]iq 83n2~Kʆ{t%(&◾$ދm5yEp׈ 'P;{J6Ȏ盪,SVW 0Am\lŽQdjMO- Wp{qd/5㦀{ Kmq6|XQ c\ a7 j//ֳ}LOgO@sDCtuQ +p~@,zg%š(5ԽYy(:&*R08/li`pj҆0> -w?ȺWh 5kۼZ{oW@|>f\ko3N].p&ҏ~"a~ -;md7A%BD2VZ8{g uAي$0\89c) h+ζȜ SZB~6Lt6y,T^/i*!C/BEćYF4!:w>8[- I73ϗ/iJbi[3*م3WOTZUFnKy0.@.m:]SSow\[{;Akuk(/|2xw|m o5\E4]:gU0@ỳ6W aA 0A' -BW%ݏB& c'}x_LZQ7`7'ic,ݽ5ZX`ЬyBP?PܸIF}x>k̏OP'G!~QnhOb1] \Y}/KRWGEYZ;E}nx&>!Ŕq)sc7J93"V]GddZ](J?T w. |U+ eP)r]}^+K }{/ G[az5O8@,$k?9X̽&A~mUg $5ud^W}Vys pm.&b'Pj XN]* A߼F| ?E O7E#/`4k2<w">8 A9GADgtɕpVVsvPEEKmtG6-evX|Z\ vtAѮJB6=kH!zr jr_+2Z OHduO MlM+ ۱Lf}XD?YT UabǏ|d>7Z5mf\':9D_=z0SџUYD.Ъ<$w NjJ 3 ]>Z `QO" %qaܝO@l)4Kbڞ rVۨAo-u+~(>_s5ً̲V@N^ʡO9Tn5 RAgЄi tf^I =im 8ڷ@Zt3'(9M& \n#]PryGń[?Ϸ*OmWVBE6) *v~d]g |JF}C?2gT<B+cs=h_6 8NL{ ~5RO!rp>ҏx Ȃv9{c*L\5^goϮlGUOl${uÇ^ތdӠ˧9 q0L䉰u|AMl cMڃ脏@l8=?V٭ C^-^āř U5w)&& 2A5h(<C7z@WmZAnp͠1#zx`[KHDW۝0/Dڰ ɼi kL&~aByًf |k%| D~Bٴݹ>@zS mnԵCEyȜ?~gg#>T^թL;)b%d`O܌ NaQQig/Mh06Nck4\pJ?SylzU2O, k*Ȕ<{,@;}xYh8nC̲A/mCG"ٞ=9.dZ9i7|QP2]zZYbE@Purz䫿Y4:#ًH;T4r (oRiB2L<1F^P ʄ6 DU ~6l,-_* T &;уQxfкˁuO~ͻv}wk{'^ybC"#?zݳAͫg%Ҡüy+;;M4 ;+2U>)@RKBK/RKKil@Tj5^$a-k(SL/o~ D8]xW OR@ej.<[Ɗ̣u6\3}}1>w670O#}nJStJ/x#ʡw}a[&9og%tut ;Fyr;<Jrh+EZ|))ɫM̚JȽBe5hʞzN'A#,+w/Vt|0׏4u/@'Aڦ27^)wYjR&Kg[%ߓxU Yh_b<@sq~s5p9?ӁRvnu )M/em=Ȿ: GzM1'p+D|S;አ>9tNHUJC({c`щOy"~!Jؽi Ake1Hiw'Q7 \J:?ї*Y(_3BY_#(KkUS9>N#i}"&DZFb_Kc,.µuD7%.Y<O6.<5< q(~erZ煏@ ]W$}R} ^8* 5ގ6;zm@Y5P&~jG,M= ی?A3& TGݙM,imEDf}>?Ӥ7 bv… 3}- k}⋝'Zno%VV son񺠟>;K,,NqCu ~+l@=Aӭ%D'.K9~*9q4ݏ'wGiw4j?/[E$$dmdz_d[R=mvv&&p280\-["ۋ@V:J<nyQ/V A@SdyVގFOk$oUejL<BA\@}qFK"sB$4|2XxDCtmz [Joˆcfh`C52'D69ղ34v"1\e嫵fѺh D/-o B_C33+ȺM-J )R~A*Rz+mT+-J::#6䇣q|X7GRKJz۳ݵ}[2Zq+…-wcQP4IFA QMaѕv]Y?`SS}=XT-#a,76A|W +AuCTKl΃ntLk` J5ҷTN!B=X Ad_Խ d wJV #H56G_&*y #/k.ZK/oqz;)#}ނ/AW^HsFI=x'Fhh;Ӏ|5T. )pvҫ^HGNEH_Ύ3n33 njcA h.JpJ>@'0Je9tv3KFtP̡BOR9QEtiU $ؿz,:sZ6c(|gg Ĝ#_&@8&@й_,o#]^&,{`0}Rx4+7B-RȐX,N(Ǧ8s](GDmjjlgG05'պ]AS#kнzH{>ΑrPYרGp2QV37'o2&CnPCKyTP^ew0ГGɣQz)=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=ytғG(=yt<')=:蠃:蠃:蠃:蠃:蠃:蠃:蠃:m:x@lGcPuC&1 :N{8@z\=){-w+f`smy7c@y2c]g8s;$-4כ" *?דzC5W?Zv0G%RunhUPS>S56k0~ h|J{؂H6;lw5'ߢi&oM\wxz+Ahĵx>viFV {ʟ7=Q* % N^D^nͦՍg2\\3v| -kn@aLؽ_@-_B?4?.tSxy̫m g aнzkO , q9mAX?4kPV(ԖUBa SX@+4P2,j1כ 秉b#G@aԼ\mɑ/ˑ[2x/.|*eqj ~34HR/.=mHi~U  Abvm&ik4Qæh/9wYxGLu[3"ru2mb hѓEP1qc;ZCāY+omrͦQuKC*TpL:3-j+ op 2j -}eEq}A>j ̽KHdRvʭB V. B363.к/'kMo   j'@#J+-FJTzUq{rNB6:־Wewjq9o$vU( u#OZkЮh2pNE wufI.PlU"xwcHK8vFs՘sdi^}c~NriR@YllB tٷK~u~^pX6־'Fͺ7ofXe*=OǏТI<)Jm-03Yel{i~_tb ?xgP#uZ&eBb`M C%UԱҠY$o6A;5a_*#*Í'i .Nr;.{PHxxT6-zR?@Z5-7i 7PwieZV~@= lYwnjNzӶP(ŒލHpK]ly&#0MI =tnc|vg> D YLچ@+[ ]Ιnq6sq]P <5 e>'Бnݻh_,='wZ^( XrRAI}UG$yA =di{krP8L og_̹+? P)P0p6Z=[7|@rmȖ]Um٧*u5 \,@3VM`Ox\ YVSA@T8?> ʱMy٠ؿdsi 2a I +?qϮorN55jNѠ5Э|8pm'A~Hf^JubίUġ|:a52J=`UlW[[;@P2]g2 i{Ł·\d\ڵk TF9u-{EjZEZt@+=̥y7]a,1 ¾r)?uy10"22l׺@^hஏFdA֋eVׄ^mY`hn=FWe _{W3`p;I4t1(d> %t_6zfnMk.Pj:FAAfl%J޶qR[d}e'㚬jad޳ 5y@ 0evr,"w)\ϱgg |O>$"UP^1YCowЀ*~``֌J J^TŲji5I?6@Rz P+ca* 9Caj@G,x;n(ӟ ,z1@u?>_WN4(ب\~", yk,ʝk.ciIORxG@hzf-@|P=v%z T#;`M¹cP Nh<ǂls}`]⑼ϢDžwǀ~aԫuTl?joc^[;}x9m FۥryC)@((LZ5A($?nպ Rv&NVVD`2G_(/.n8gmNZ!t_@VyB2 (|{WC %of􎩷€Jsů.;c+GaP#_Ϯ.OP a]߉{M~:yk9ʥ=8K176h`@)3Qrid]E~Xh.Z"ËMSH)*B 'w4(?Y *&æPΛr6R QqPnt2R3@#1DjlvP@K+`/RZ@@h-n``Ů8EPxYۖa;֩Y&2>حqT;C&óAFRZMC0f\r1 `>w?f,`ϗp1t'Y {3ōe+Vط vL`Nqր)]/E| ڀ#\Sbht0vzfXaHӄf~)b *WK_Kĵ.*_!,S oKMa4gKI *N͛9#uDk'ms( (H\he;a_ P8#K# 6wv tbn&1t?c*\6ޯ?Ar .D5"Wd)=bMFE7~P0l3`Vfn$rZyui1<{,wZlEY;@XyxRyAnxH0h:0 1ךj<& ^09}q k8xl;~Dcħ<o IDXaj;w؍2(xp?w LwL' ׊bngWဘ8:Գx#Mu#c&\bECtis`~̴ײFg(@=$w-T O.w?lM Pwt3u. X1A["` 'l-y?ěYW9j [Cqe%Hۮ{{B [*LG=4\$gʱ"SkܸKങm錘`7ЊUlTxF2?4}@-hw=}H_tf!(kOU!;g0"o ē7'Ҁ%; #~~gkOU0 0`i{F- g'ʇIhּ?4q a΁`}@%\#r|@YLn:u, _bcWu" %Bԁme9uyħ-KikVh"߆8Cnܷ5*`́K8(zyҕ{gm;ÜDL@ `#4+|ԺKZ''~rWgÀ޵_QPbyfY>x^5*y!Rj`MxhtW(BO`S[7txe5lgu=_5(F$)uGN7,ȎxǰEQ Rf_2-:yu[\%$&mE?XUXj ?n兹ס<6^=Q[C Uy|(́:ۯ*8*4מs>_-Yn?{Ͳe& [|zB e|j#AŪ$)"@{`X%SAgPdN+_+OFct>B@ 6fd|P~jeWc@NV?, rJ͏v' n*t @,aLx jl = *W6'@ ՠILDO35d5kA íG@lA53 9#~R+BKU K Luֶ҈[ `u@)qh2k|7s.+ܦsQY>B׻@@<ܲ[/Q٢8PksA=z5M<<*;/T'j0}į\ܻJ)GE&@3Ozh<Ā)^ 5AɦIN`?;d\خGѠ#xc"dEv\3j?@ɝM:ryd%P6lg 1 ?+:MuNCϲL|˳劮%c[P7/#N5w $Ԣ_( nYٙ\-؋#n{AY/;pĮ! PGZ@3H{4P.~M* ["Lq=9o:=.{Ra⯨xgZZU~с 11lR+?=ZA 2Pq]@2ǔǸk\fu,j364;~dL(,HQ^kh݈%b曹^ I] ѡ@*_{P߃[n>G\?~GT0R/2ng}ħHS}ms 02<#zw"\5@4=0 E<^Z}0T2_MĪA~GN4R>E w ~Fc=#~Kw}|RJ4|/:' yz`%Ps#k{>e\/r:ӑ~bKURv*hۧ -[v`ge[zj.;; CyN0xzl"]}j0av='-=@v< 8@_CR=p=;mP|anxJ.vwNŌl#6|'hwz lثo.BmË7A~Q9߽u2,a!K}YH ̹#s: 1`KIOfOMħ#uL`H-!,ݪ-̉&恤26 jֻ΃@&ͣߊb@UT:Uw_]T7+A@-N*+1 ȢZ].,Z=h+J%:mRO1S nP04}a oYF@+ eUgw>u"/X30S"Z{8b@-G/DWf闦r (5Pc6@s2l(&@=@y*Q4UE+ .1MEYif\N_0ws޿ml3ˇ#sSZ6`]02΃ץAܾ4| rO)8~{o<,#a]`@}YrKss A}v Q t;w`Ru" <goV\I)1 tWnb/(E.yB I@aF;o]%h"xa}q`a LV^\@\{ j |xO1Ȥe%RHh 8W 4 =?Dd2(=i(=i(=i(=i(=i(=i(=i(=i(=i(=i(=i(=i(=i(=i(=i(=i(=i(=iLS}/|?t0Nz9)oȿ{޾^u 魋 `c!^zm|fox=5i_ǰ<ui]FR? k5D66D^CCB}y7o7}Zf`+OOHE=Z[G/,F78 L/*%ƏQO _e9v0&]>?yZϠ[9gi%>2㞽¿*Ǫx7FcP /W& K]0b\p=6WU|=i3,>{N/nxt<H {{#E@#m؎G1Ot%f닫 a?{dmQW c=MHu1*: Ä)׮|_}v!T;Oxb;-en-Ύ\ 8x""zOl}_jDmJl{$Àwwf+6L즼 ~i3d`\/K|6F+<)A56R;d_vo_@~K>{ Y GvgTy6ޝQJ*W Jp3\ʍ.HXEdLzQ/SqΛc=ʑjIj\49>ٯYgjZnrD^uZ=a.@Aī(ʷ7#b >`k/>k[ J{83 rޫzqʣ|΀,~5o^>eDŽ 30i|TQ|lm=4bd^%!qjUv?;3U* pby`U !;=w-˴p A˕'u :Eb [7Zrߵf}}[f̩hBZiK˿9H7v㑏jxJ{pP˔#Kv{::vS"lC.WX mqJx7$ZM#3n?l8r5FdqMVΖ]ø]3~L"l' ߚu9?| iahŗlv?՘ 4x?c&oWtxqɾw梡zyhYpiɦOl9MP>kcl|W?XkBuwUM`*r7j}6Hx*?x?Fz@Ijș2 G_>/}6$~]a>RS׻w?SlbҔwt2 MX{muٮo/9o=W}O7=LVo_ر[˰^x.-v« N -Mgn!.Sq\;#;.uI#hm]d)D >e3p8_ u:|~hKZoY +N>ѥtQlY\mQFϤY Nzl7zYгaɿ%6>4$mTcSؑdC'DExw rkgxݹ~dzߧʊqWc9u4|QpSZOL}qhͽQ:+%ꔾet==r65_i'5MLb.nOHfl7v_{uY籅8+ѻ*RjbI= {=~l? 3:þJR|;]]CZG*ftHd᝭wf!ճV uf=oXYZFnzxs/V]lRí椲cU6,a2,x/#zJ4hʻW[~}KS+;3I餤NI7ܾ3 OX/eZ}"wjB[DW2jo'DRH:nV!/Z_DON*}O<M8̐mO҇딛*=7]o l`m(sȱ9?,uV|_&ֈyV|z@)q{jWy IŎ->s@2owales@_[XJ@A]zKC[R~o#Oo@P/mz옿#r/ tAtAtAtAtAtAtAt߀=yũmq0砶~bћ,|c4W,?Mրlg@88ʇd<y鹳X|߇{c+8j=*Ň;weݦ|qU@#8`N Y~h_UpP| 8<̴{p Ý>5pXl~,~߆Mn:8Vav_́l8<FB$$$2&3g}$$)2 i@!SBHQ)D$EfzY]߿^wusp ^Es;q(ӛtFj> Sz>w~8;=T,@J?a+]@{}mɖd+&M9Jn E lZxg@>WEt<H=c Zݺ?@zŁaPrI y7In@s HǙlՏwjD87PW2t*Tj@ jϮTV/@)EdzaW5X# vDrH([/3T4gS  (<P隭{䈔x-do@|:B8 !rΫj tW3P[>ެr2)d@uO9R-z\ɞ 7x_a_>8Lּ¸}$}tbbxT\5~짍m'@VTrqt"P+# də*$6Mm;_3nШ+P+fuYT g(z & ^ȧax _7; sKZx΍TeY7g3TKޥ}؈S2 <_*x %DŽ1PQ)+~K3F& n 0M2dŸAKg-m{m BC J+o3zRqv}Oz6P;7DH~Ξi , ؙ0/#NQÞvd#[cbFƒF嫾I0PSKdu{^vț-"}273x:#ν; 3-ol"N=:?ЪS@0id],ZNPQ}"Pf7gsr7+{0[gb?5ŹEb*=t|sF˄!oE.X@$J7^ a@:<'j\ͥ@ݞpxyn^_/:w{D@E3ř=˞hs39;kئr]R3{٬2}S$~Mn&X? !5z^V@~*m+lⅬ/@i: yʫӂ8W5nj"+)BcAЖki=@&g޷1R$0q!bԭJ%GaQa':Kw ڬoH9jumO'ǿL!.7~C R}q^<<5T~8Q '4[ޯ(?%@th ?\葏ςc#@Zry6I\2GY:J=fo@$uyq,>ɋu~ 2eW dxw ž&ȫ_>~D()5~mY] `WbGiAWkd*'O`"ZR@JIږ@7)\o&Mo%2Z۲mhώlڤ4UHqG+ӱNeSMԧW#{T3GO]gv_;%Ŀ`T}Q9yuJhExҹqv0Ds9_1t Hg44 ?` R b Uώz7UF]*"'zR E|dN>Y=d)êv'D2\ anhhSC-n6ExMCc:yݶꟶG~ slko -AqJNsL0A7# 9x\.Ujbvw"~A1]ȬD$#ZJf1Jrh-o52a^U^ΉfQ_=+kĘT-FWc? Z{%y_2^͆k`,^W@ݒpkdI_~ߋ.UǏ8W6 rb~lzԁtӃ yL#l1xt;R+y/#F?D͟zݵ;9 @=S}7y{݀'<>]Ԙ_7|̈́K& K[QA/ #(!LX h+ t?Fhw.Y)LH3%s@fMr=cT:N䑪 +{}E )[6ox'uIs՘eȧ;)|{8}y4qvwx@FL?E Zl8{Nq,61ϹY`:/^ ~l wɨ#jNw E8:BuSO+Z\Z:\ԏ>FFuB@yuYmcalhݏ@<(z&qgyFşZsF&cw;a0:kKzG>ȣ4^.{K_2^۝K +#~zqyY 9|&ɵR56OZvz@:6ņ`w8ꬭAK:T=q&}B) ΂~b\ܿ"0XYݹg-|c޲ ;{Kcz|9LŐSvɬzY缞^6:%zN=󷁨xt)ߧ!7ft k\ITQݖ@l̝ގ8' A~~r%"Ohu -;tϿ_.6~4P }n љ_VQ'.uJ +JP/%~:3|K|=m-79ji20ozBeuTo;p 6b*5o=&l:M8)-aX7^9>q"\,4m8o:R/' _ ԓ=؉ujכ Tq#kM{U'/ BXGgT"eO(ԩ]@/~~ ēWC}m|WHG>؟7d$#yD[y›E5&D*y]տ6yA2|5$ެ!0IHԅ9*W$g}?<ìYxB4C6#EgJ"3@qDru׭K*~q;腭&\u'5.8hN_ n pC^%fbE֖#G{mEin GY G䣆ʩFo0;*I+vI1Br4 uCW>v9Ŀo8#Gy<`O(-@Y D֗lC͵ymM3z`ElO޿oį?Zs<}^fÿa. H<{ 2WYWӎNc`Q~ue;@ l[Ȯm+Oj~L=ބ%)qwB>S+0ݠyig=i73kv,9ݢ8YMSex䦉0%2AfBo GBAM˵G[-󵟞yϺUvɱQ9?ZՋ樿}Lee]a_\e@ }x:/}ժ臇R  6E!?_WTީTϦvnÖJnz KnRDPg#.?btkpc]<]8ggw)V/ p C_=-qѫm#c[3mm"MěS}@'F_pF ⪚= xFf@ygƜDI=*zC~Ӟ;Ѻn#8{s?r"y;PRkQ>@ŞU)>T^ (Ts_L5Ju/DwH9r2u0=48=e Ԅi-> GOoӗJ=vj{9V|މ窀My^TrHuCgaDM403⚆\L&oj߱IE4|Q왨CτniD?z/2Ȫӏ>s*W `%oہK||Rnq{&Ѫܹϫi&㑃sL@+nJv09#N\I]QjgTokBz`|\}lϮ!!-<.[";ҲW(Zk>@V.WbǍ@U85(|SuOí!¦Dwk#وuP[)OǏ(3:?iGxS2C} ##Qk?dž(Mͳ[b?:S(G-,@8wp$ )|lJ6kD:_Rz!0CHYbo2%iYy&oc=ӈH*(rPp{5q_++4jy<΁_ϑ8ӮϢx0'r6ru~> FA4qbM+ve:N&19Q9YU)v8kϸ!n,]o\G9}UEݷ46I컯OnpJ5^ũ "k-8M _/F]{.j#ϻr+!pi؈ߗe%>zǫ&w$'*5Wk|F6#x_5G4Q Q={_KEo uJ q ơMu}V;פIwkfqYBѼ9/:egU_f[ Ύh}'|>/6k$} +Y<[s=葃s=ݧP[D.Ī8?oV.; EIo:Tpz{zɿE_!@}Lވ A?9|v߿Q-zéGw&>Kf`y^%PwfٲLaB ~NiF{S{ΡKۊz!Oa2&w{ȯLDž:W)YHf`$=˟lo{VyHf1ROE0}_[P?i7nަN;`?jNc=Ux[lsгr$dۡ$|wd!2 ݩ5mY@<l^\p? ouHHڶRX]?~Y譋+дpb)~S=̇s}UC>X U ϫlNu_qu# gKt /&{P̋&#K" ȷquƓIK8S;/(9­v!_h<ɍ[t Z2&ƆZZZ+dlh]ZBƆօu!dlh]ZBƆօu!dlh]ZBƆօu!dlh]ZBƆօu!dlh]ZBƆօu!dlh]ZBƆօu!dlh]ZBƆօu!dlh]ZBƆօu!dlh]ZBƆօu!dlh]X8`q08`q08`q08`q(sneL̨ b  vrڵ|*}K*wZJiQZh<3bYH s?ϭ-! (`!$ GsV7qB'_Go04.f;j݄sN`2]5^|fE Uʼ*3?OB2 !_%ʲr*K ^r k'><\SnVYDۮ4bћ'upAR$g5m db_d=y SI Gor=]ȑk\1Z@kNoA7[PE-b]ksٯ0&fa]frnUp "|ҋLj(S) Du~vo00f!&\ߎF/)ʙ4V@<\f bVc@hL[,e/-k呀<@;י?@-_kƆysS5<׭ Vq֢4ٚI*T+[]0K~=2h}W7}L=늽"N8:F~^-ތy;${aq\4Ix-s+e2<Й@[|{w_ my_نdk3zƕ~Ş\ҷ*v¼>%ȷ~olz^ VxЬ4PcMQaL@9~ Hai/MU<^{!Ħ(ض;+kbqζZ*qX}(Q UDruL;4`]@ֿoHdڴnM]g1pa~h[!] Fa:/ yƣY ^ t2Iė"o}xxw#3oD@_m81s@M5Of}D)<@͖O[6Hx -AYuI sz* O`?=hO&pNJ>[m/]V4 j.W"f,9Uyix]6tn9ߡqڗLYD!ÑanQg@س]X8V2no@>){*DOgxyePXXKW߶b@7}}rQ7r7i.?:`8ϑ_ u,`8/bJ@<+T Fn.I憤~a0/|׭e(^ͧLv[|$y&y_Ɔ#.Mn뛀R{8C}mR8קcƚGEҪ@D]( ~=*cy $_aSM~7bO3HAG5W> U>4Mw_ u|4W'{1%vQze/g!j0mB<6>vA\ PF\{>G@f_N*ϖ^ B^^Kz8t$AZc#Cاӱ =f#}u [uOj`-CvhU!ЄʀyyhKn,n{ZsF̗X~ldqn @<=هY"P0/[|yW#΋#wN.9v|7 ;U phͫsIǭzp]a>h._QO~da| /F%dt=?B՝@UN݂ujf_8r}X8KKM/ӚPDPetr>P#WŁ6S߲LQ7nb{8 sH{<2ȗ3y!ۨ|R#e?Ogo@n Ϙ( ;tAn8ؽI{ {0pPv)ucws293@~` S}Bf٢U8e1b{ -yb{6lXs.ZDYyuJ;\1 Vrtj4#Ul0?(Y~O}>]A1:)g98x" wJV=<:XZ+Y8kqIrQ3_W ò>!Cۛ#~Mq9 YɋS%/m;zNOMU>. g*n JK*g6e."rk10|ۆuLJׄzds&^1W,ՑWä2Lح̱:*^34)'v7_''JCϴqtf)\q/ȘHUcVjE/pN;j#%9;CZ 2 d*J@rSR.9O[MZg#r+)pږr?x?>ߞuQc)E/BYG-x,kqY2cy꾎f^@r/}ќ4j[=QF(i=>~v;(E{1G'P*~>A\ܮ}NM&0yfeΑgǮ1@+]U\yu}x7⟂i/  }@tS<9%?.c]Sc+bM[ĥʬI"u+¤-*T"s &85uW!>OCdxb)C3'mnQى5o.45Xw]3VAvRP]j|*K6}-m7nn]@'FAM5qxǥ$= >F>^":lt ]x'?.f;s5n™8_hb[J'@*lʋ_PSKj /c-m}ȇ[.-OU˯ħ@l6n~$̣W.q<@'xn8U]F=#/hz qcxhIJ̑>W?E^g6l ա7s@-^}fג၈8Pi;én s,GRZM`F |w0PKyRV-,&QK.ڔ}'n>]%prN$u/}1ƧL.^9:YwMQV)eUuL8g\n P_k!z[!^n-@_x@w<_mFiy~x+G:NI%rͽ_>X;.oZѧJK%{ݕykǽwq}NܻqwD6وyjD@/]'vLZf< (qЯ̈́ 4|7RT{Wk`="Խ:%*S*⧣k*<-7L1 jQf3P.Nq>a3?s~"+a+*mC%c! )yສJ%_-0>In#:Jb$2!(MZvlºxd^Ds} Cˀ\8?^g1mg<>_NkNˁx{v }Ye`N (곻`(?X觎>l]fe+ng Mne䵇Q{9Z'Q ߫ozBNrhЏ o(s#,<ηF}ѹ뚂-&<JbK'J "+׎z|Gpi(]йqd8km\G0' 6/\qNbuZN<)CGqPE\r1 k?;ew5,Z䦡X5M%ܨ3]ӌD\rܺK@J}D~!r[a_#v`+7O/Eպ`%'m 3Uuޞ.'_^_ݱ E=,Ex-+Í][^ڈ^ĹajZ:btuOԕ fW`㞉# ?Cf;--@5]>Qi;S:t«K1RҝLG~ԋz`]M#m/Lv]JGE?ԑˋzelUN`]&95sQb%U.=)6X 8QX *sT/e?iЎb(+Gr|7!/j bG]ՑL'~^x/x+M+CC7~Ԋ.R!OKG"K"VJ[tnHŎ.8"OǴsuCo 7O4=z~jv,2W^&,1-_zda0{e L=3ٔVj~Bq,lcyď7VǸdOnxλa]+VyzB:V#'y湃~%;BO[+ /ެO_gDڳgcmɾ5emm=Rv④{Lgs@f8щlAh&O:_uߓ_u`!cq$ w"cf b^Zh=wcܯl}ţtUQ~tԋMux=xZTmv6/nͥey9.6O -1S-@w7,Y/3|4ce@7q0Buow1 ܆+\/_ZuIe7d=9XQ_%WinpFl\'j~یWsfˈ]"-[e=I羞Ylrb D?@M=.E_=FHGk9O)@UM=*S>ey2JwJP, p@lI@N11\t}Jz'OOh"_>58Q&9X{8֖Kg"Y松 ynOdt$oCЪXv?}>I% Dr: <槑~!uCLƀzOZ}#OW# n3z_/Xlzx 9m8P,tI ϣ[ ȯ/w cS&B   +d,dZ BBi!d,dZ BBi!d,dZ BBi!d,dZ BBi!d,dZ BBi!d,dZ BBi!d,dZ BBi!d,dZ BBi!d,dZ BBi!d,dZ_wY='^twjky-wT}16'gg/cYh|c?7!|cy}M}j84;yuϿS.{yVNwӼ?1|u/=d$֍ky_Y>x?ZY"JVBjnʥzqYu\ThH8rhzɶ x6PS[Z2lI{^~G%_ډ0tJ`Ɋ[m&{Eq6ό.ubo}jP~p}ba꡸kϹ-7Dry{)b$Q@s"/lNUS=SGɏߤwrѽb=/7jNtY˕sqӗW}Z4y'LTߧEEuȯdB MOGi%J37.֞ͭT))rBlgO-`otU\kc$jh3Юy!xe$Y8]>u ]ozSE d?6Y,=O$rd(B{2N"kڒR^-ȕr])vq(sJ!eܻ^"*@Ⱦ7jr aw2LC,vO~\?GV{uϑ7ݺRycGiw Tj!+Vq9r!Wma#^|aVܗGy''IB][L[$Xff lY9lUm;\#Bk{|utIׁʻM>noyU}JOZvmf;72_Vg'J ==SRֈvgc[ѽkˣoQGR\tÀfq]2];9לּRzU;}uN$J~V8Eyjk'??.(<v/Cvwʷ'Vu[w_>41ܼՆ˴jKD鯸xl@/:\&_lZB|`k*"\ % /iGHoտDEkw42񨅅ֱc?/і~+2nM_gVj|γ}bfW~NQYk%db'=블]A_)Rݯh;\Bm1=52qh!q+{.]=7;󤧢ԢGI#!f!VMQLkl*(=me/F1Ƙ+(88ZV3?cuՋ+3HDD _Z!֋_#sZLȊ쟽cq/[lw՘t*>K=3?osE%lneOCKSh' Ki{-+95S&^vkq_iol\P&?Ĺs PY`|ڋ^rLCO0ȳ,#7}_TX+ЮSJ[;'U66/E3s|v&`pbRrCO( JjJן<\f2VX)cyJNϯַ9=W]}hB};ye[ܷy 8ߢ%$Kum*ܓg0:g3JRſw _ Zq-v3&㛺*8V[v>8Vc#^7of -I ]@-_u\/~tA%oyqǜd=[e?Y&c nlme/po/0000755000176200001440000000000013450712326011626 5ustar liggesusersnlme/po/R-nlme.pot0000644000176200001440000006036513450712326013516 0ustar liggesusersmsgid "" msgstr "" "Project-Id-Version: nlme 3.1-138\n" "POT-Creation-Date: 2019-04-02 18:40\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" msgid "not implemented for \"nlme\" objects" msgstr "" msgid "not implemented for multiple levels of nesting" msgstr "" msgid "individual %s was not used in the fit" msgstr "" msgid "do not know how to calculate correlation matrix of %s object" msgstr "" msgid "\"corStruct\" object must have a \"fixed\" attribute" msgstr "" msgid "do not know how to obtain parameters of %s object" msgstr "" msgid "cannot change the length of the parameter of a \"corStruct\" object" msgstr "" msgid "'sumLenSq := sum(table(groups)^2)' = %g is too large.\n Too large or no groups in your correlation structure?" msgstr "" msgid "cannot change 'form'" msgstr "" msgid "need data to calculate covariate of \"corStruct\" object" msgstr "" msgid "cannot change the length of the parameter of a \"corSymm\" object" msgstr "" msgid "covariate must have unique values within groups for \"corSymm\" objects" msgstr "" msgid "unique values of the covariate for \"corSymm\" objects must be a sequence of consecutive integers" msgstr "" msgid "initial value for \"corSymm\" parameters of wrong dimension" msgstr "" msgid "initial values for \"corSymm\" must be between -1 and 1" msgstr "" msgid "initial values for \"corSymm\" do not define a positive-definite correlation structure" msgstr "" msgid "cannot change the length of the parameter of a \"corNatural\" object" msgstr "" msgid "covariate must have unique values within groups for \"corNatural\" objects" msgstr "" msgid "unique values of the covariate for \"corNatural\" objects must be a sequence of consecutive integers" msgstr "" msgid "initial value for \"corNatural\" parameters of wrong dimension" msgstr "" msgid "initial values for \"corNatural\" must be between -1 and 1" msgstr "" msgid "initial values for \"corNatural\" do not define a positive-definite correlation structure" msgstr "" msgid "parameter in AR(1) structure must be between -1 and 1" msgstr "" msgid "'sumLenSq' = %g is too large (larger than maximal integer)" msgstr "" msgid "cannot change the length of the parameter of a \"corAR1\" object" msgstr "" msgid "covariate must have unique values within groups for \"corAR1\" objects" msgstr "" msgid "parameter in CAR(1) structure must be between 0 and 1" msgstr "" msgid "cannot change the length of the parameter of a \"corCAR1\" object" msgstr "" msgid "covariate must have unique values within groups for \"corCAR1\" objects" msgstr "" msgid "autoregressive order must be a non-negative integer" msgstr "" msgid "moving average order must be a non-negative integer" msgstr "" msgid "initial value for parameter of wrong length" msgstr "" msgid "parameters in ARMA structure must be < 1 in absolute value" msgstr "" msgid "'object' has not been Initialize()d" msgstr "" msgid "cannot change the length of the parameter of a \"corARMA\" object" msgstr "" msgid "covariate must have unique values within groups for \"corARMA\" objects" msgstr "" msgid "parameter in \"corCompSymm\" structure must be < 1 in absolute value" msgstr "" msgid "cannot change the length of the parameter of a \"corCompSymm\" object" msgstr "" msgid "initial value in \"corCompSymm\" must be greater than %s" msgstr "" msgid "cannot change the length of the parameter after initialization" msgstr "" msgid "need data to calculate covariate" msgstr "" msgid "cannot have zero distances in \"corSpatial\"" msgstr "" msgid "'range' must be > 0 in \"corSpatial\" initial value" msgstr "" msgid "initial value for \"corSpatial\" parameters of wrong dimension" msgstr "" msgid "initial value of nugget ratio must be between 0 and 1" msgstr "" msgid "'range' must be > 0 in \"corLin\" initial value" msgstr "" msgid "initial value for 'range' less than minimum distance. Setting it to 1.1 * min(distance)" msgstr "" msgid "initial value for \"corLin\" parameters of wrong dimension" msgstr "" msgid "range must be > 0 in \"corSpher\" initial value" msgstr "" msgid "initial value for \"corSpher\" parameters of wrong dimension" msgstr "" msgid "model must be a formula of the form \"resp ~ pred\"" msgstr "" msgid "no coefficients to fit" msgstr "" msgid "maximum number of iterations reached without convergence" msgstr "" msgid "computed \"gls\" fit is singular, rank %s" msgstr "" msgid "object must inherit from class \"gls\"" msgstr "" msgid "'Terms' must be between 1 and %d" msgstr "" msgid "terms can only be integers or characters" msgstr "" msgid "data in %s call must evaluate to a data frame" msgstr "" msgid "%s without \"primary\" can only be used with fits of \"groupedData\" objects" msgstr "" msgid "only one level allowed for predictions" msgstr "" msgid "%s and %s must have the same group levels" msgstr "" msgid "wrong group levels" msgstr "" msgid "cannot get confidence intervals on var-cov components: %s" msgstr "" msgid "need an object with call component" msgstr "" msgid "'nint' is not consistent with 'breaks'" msgstr "" msgid "Within-group std. dev. must be a positive numeric value" msgstr "" msgid "'object' must be a formula" msgstr "" msgid "object formula must be of the form \"resp ~ pred\"" msgstr "" msgid "'data' must be given explicitly to use 'nls' to get initial estimates" msgstr "" msgid "no initial values for model parameters" msgstr "" msgid "starting estimates must have names when 'params' is missing" msgstr "" msgid "'params' must be a formula or list of formulae" msgstr "" msgid "formulae in 'params' must be of the form \"parameter ~ expr\"" msgstr "" msgid "starting values for parameters are not of the correct length" msgstr "" msgid "cannot calculate REML log-likelihood for \"gnls\" objects" msgstr "" msgid "first argument to 'groupedData' must be a two-sided formula" msgstr "" msgid "right-hand side of first argument must be a conditional expression" msgstr "" msgid "first argument to 'nfGroupedData' must be a two-sided formula" msgstr "" msgid "only one level of grouping allowed" msgstr "" msgid "second argument to 'groupedData' must inherit from data.frame" msgstr "" msgid "first argument to 'nmGroupedData' must be a two-sided formula" msgstr "" msgid "single group not supported -- use groupedData()" msgstr "" msgid "'subset' ignored with single grouping factor" msgstr "" msgid "'subset' must be a list" msgstr "" msgid "undefined group declared in 'subset'" msgstr "" msgid "only one display level allowed" msgstr "" msgid "undefined display level %s for %s" msgstr "" msgid "undefined collapsing level %s for %s" msgstr "" msgid "collapsing level cannot be smaller than display level; setting it to the display level" msgstr "" msgid "'preserve' must be a two-sided formula" msgstr "" msgid "'asTable' cannot be used with multilevel grouped data" msgstr "" msgid "'asTable' can only be used with balanced 'groupedData' objects" msgstr "" msgid "%d errors caught in %s. The error messages and their frequencies are" msgstr "" msgid "'data' argument not used, but taken from groupedData object" msgstr "" msgid "multiple levels not allowed" msgstr "" msgid "'data' must be a \"groupedData\" object if 'groups' argument is missing" msgstr "" msgid "'data' in %s call must evaluate to a data frame" msgstr "" msgid "nonexistent groups requested in 'subset'" msgstr "" msgid "'subset' can only be character or integer" msgstr "" msgid "log-likelihood not available with NULL fits" msgstr "" msgid "'form' must be a formula" msgstr "" msgid "'form' must be a one-sided formula" msgstr "" msgid "covariate must be a data frame" msgstr "" msgid "cannot do pairs of just one variable" msgstr "" msgid "'id' must be between 0 and 1" msgstr "" msgid "'id' can only be a formula or numeric" msgstr "" msgid "'idLabels' of incorrect length" msgstr "" msgid "'idLabels' can only be a formula or a vector" msgstr "" msgid "covariate must be numeric" msgstr "" msgid "nonexistent group in 'newdata'" msgstr "" msgid "nonexistent group requested in 'subset'" msgstr "" msgid "only residuals and random effects allowed" msgstr "" msgid "can only fit \"lmList\" objects with single grouping variable" msgstr "" msgid "'lme.lmList' will redefine 'data'" msgstr "" msgid "initial value for \"reStruct\" overwritten in 'lme.lmList'" msgstr "" msgid "fixed-effects model must be a formula of the form \"resp ~ pred\"" msgstr "" msgid "incompatible lengths for 'random' and grouping factors" msgstr "" msgid "incompatible formulas for groups in 'random' and 'correlation'" msgstr "" msgid "cannot use smaller level of grouping for 'correlation' than for 'random'. Replacing the former with the latter." msgstr "" msgid "fewer observations than random effects in all level %s groups" msgstr "" msgid "%s problem, convergence error code = %s\n message = %s" msgstr "" msgid "maximum number of iterations (lmeControl(maxIter)) reached without convergence" msgstr "" msgid "object must inherit from class \"lme\"" msgstr "" msgid "terms must all have the same denominator DF" msgstr "" msgid "L may only involve fixed effects with the same denominator DF" msgstr "" msgid "objects must inherit from classes %s, or %s" msgstr "" msgid "some fitted objects deleted because response differs from the first model" msgstr "" msgid "first model has a different response from the rest" msgstr "" msgid "all fitted objects must have the same estimation method" msgstr "" msgid "fitted objects with different fixed effects. REML comparisons are not meaningful." msgstr "" msgid "objects must have a \"call\" component or attribute" msgstr "" msgid "all fitted objects must use the same number of observations" msgstr "" msgid "only single level allowed" msgstr "" msgid "cannot get confidence intervals on var-cov components: %s\n Consider '%s'" msgstr "" msgid "covariate must have a level attribute when groups are present" msgstr "" msgid "covariate must have a level attribute when 'id' is a formula" msgstr "" msgid "covariate must have a level attribute when 'idLabels' is a formula" msgstr "" msgid "'form' must be a formula when not NULL" msgstr "" msgid "only single effects allowed in left side of 'form'" msgstr "" msgid "%s is not a valid effect name" msgstr "" msgid "no effects allowed in right side of formula" msgstr "" msgid "cannot evaluate groups for desired levels on 'newdata'" msgstr "" msgid "'Id' must be between 0 and 1" msgstr "" msgid "augmentation of random effects only available for single level" msgstr "" msgid "no condensed linear model" msgstr "" msgid "no fitted \"lme\" object" msgstr "" msgid "objects must have coefficients with same row names" msgstr "" msgid "object must inherit from \"data.frame\"" msgstr "" msgid "only one level allowed in 'gapply'" msgstr "" msgid "'which' must be between 1 and %d" msgstr "" msgid "'which' can only be character or integer" msgstr "" msgid "formula(object) must return a formula" msgstr "" msgid "'form' must be a two-sided formula" msgstr "" msgid "only one level allowed in 'gsummary'" msgstr "" msgid "'FUN' can only be a function or a list of functions" msgstr "" msgid "cannot omit grouping factor without 'form'" msgstr "" msgid "object must inherit from class \"lmList\"" msgstr "" msgid "no degrees of freedom for estimating std. dev." msgstr "" msgid "data argument to \"data.frame\" method for 'getGroups' does not make sense" msgstr "" msgid "invalid formula for groups" msgstr "" msgid "'form' must have all components as formulas" msgstr "" msgid "'form' can only be a formula, or a list of formulas" msgstr "" msgid "level of %s does not match formula %s" msgstr "" msgid "'form' argument must be a formula" msgstr "" msgid "at least two coefficients are needed" msgstr "" msgid "no model variogram available with 'showModel = TRUE'" msgstr "" msgid "only residuals allowed" msgstr "" msgid "'distance' and 'object' have incompatible lengths" msgstr "" msgid "'nlme.nlsList' will redefine 'fixed', 'data', and 'start'" msgstr "" msgid "can only fit \"nlsList\" objects with single grouping variable" msgstr "" msgid "initial value for 'reStruct' overwritten in 'nlme.nlsList'" msgstr "" msgid "'model' must be a formula" msgstr "" msgid "model formula must be of the form \"resp ~ pred\"" msgstr "" msgid "'data' must be given explicitly to use 'nlsList'" msgstr "" msgid "'fixed' must be a formula or list of formulae" msgstr "" msgid "formulae in 'fixed' must be of the form \"parameter ~ expr\"" msgstr "" msgid "'random' must be a formula or list of formulae" msgstr "" msgid "formulae in 'random' must be of the form \"parameter ~ expr\"" msgstr "" msgid "incompatible formulas for groups in \"random\" and \"correlation\"" msgstr "" msgid "cannot use smaller level of grouping for \"correlation\" than for \"random\". Replacing the former with the latter." msgstr "" msgid "'start' must have a component called 'fixed'" msgstr "" msgid "starting values for the 'fixed' component are not the correct length" msgstr "" msgid "starting values for random effects should be a list, or a matrix" msgstr "" msgid "list with starting values for random effects must have names or be of length %d" msgstr "" msgid "starting values for the random components should be a list of matrices" msgstr "" msgid "number of rows in starting values for random component at level %s should be %d" msgstr "" msgid "number of columns in starting values for random component at level %s should be %d" msgstr "" msgid "starting values for random effects must include group levels" msgstr "" msgid "groups levels mismatch in 'random' and starting values for 'random' at level %s" msgstr "" msgid "names mismatch in 'random' and starting values for 'random' at level %s" msgstr "" msgid "Iteration %d, LME step: nlminb() did not converge (code = %d)." msgstr "" msgid "Do increase 'msMaxIter'!" msgstr "" msgid "PORT message:" msgstr "" msgid "Iteration %d, LME step: nlm() did not converge (code = %d)." msgstr "" msgid "maximum number of iterations (maxIter = %d) reached without convergence" msgstr "" msgid "second argument must be a groupedData object" msgstr "" msgid "cannot use an anonymous function for the model" msgstr "" msgid "'data' must be a \"groupedData\" object if 'formula' does not include groups" msgstr "" msgid "old-style self-starting model functions\nare no longer supported.\nNew selfStart functions are available.\nUse\n SSfpl instead of fpl,\n SSfol instead of first.order.log,\n SSbiexp instead of biexp,\n SSlogis instead of logistic.\nIf writing your own selfStart model, see\n \"help(selfStart)\"\nfor the new form of the \"initial\" attribute." msgstr "" msgid "missing call attribute in \"nlsList\" object" msgstr "" msgid "cannot access the matrix of uninitialized objects" msgstr "" msgid "ignoring argument 'form'" msgstr "" msgid "ignoring argument 'nam'" msgstr "" msgid "'value' must be a square matrix" msgstr "" msgid "dimnames of 'value' must match or be NULL" msgstr "" msgid "names of 'value' are not consistent with 'nam' argument" msgstr "" msgid "%s is not a valid object for \"pdMat\"" msgstr "" msgid "all elements of 'form' list must be two-sided formulas" msgstr "" msgid "'form' can only be a formula or a list of formulae" msgstr "" msgid "'form' not consistent with 'nam'" msgstr "" msgid "length of 'nam' not consistent with dimensions of initial value" msgstr "" msgid "no default method for extracting the square root of a \"pdMat\" object" msgstr "" msgid "do not know how to obtain constrained coefficients" msgstr "" msgid "cannot access the number of columns of uninitialized objects without names" msgstr "" msgid "cannot extract the log of the determinant from an uninitialized object" msgstr "" msgid "cannot change dimensions on an initialized \"pdMat\" object" msgstr "" msgid "Length of names should be %d" msgstr "" msgid "names being assigned do not correspond to a permutation of previous names" msgstr "" msgid "x-y data to splom got botched somehow" msgstr "" msgid "cannot get the inverse of an uninitialized object" msgstr "" msgid "an object of length %d does not match the required parameter size" msgstr "" msgid "cannot extract matrix from an uninitialized object" msgstr "" msgid "cannot extract the inverse from an uninitialized object" msgstr "" msgid "an object of length %d does not match a Cholesky factor" msgstr "" msgid "cannot extract the matrix from an uninitialized object" msgstr "" msgid "cannot extract the matrix from an uninitialized \"pdIdent\" object" msgstr "" msgid "cannot extract the matrix with uninitialized dimensions" msgstr "" msgid "must give names when initializing \"pdIdent\" from parameter without a formula" msgstr "" msgid "cannot extract the dimensions" msgstr "" msgid "cannot extract the matrix from an uninitialized \"pdCompSymm\" object" msgstr "" msgid "initializing \"pdCompSymm\" object is not positive definite" msgstr "" msgid "must give names when initializing \"pdCompSymm\" from parameter without a formula" msgstr "" msgid "cannot obtain constrained coefficients with uninitialized dimensions" msgstr "" msgid "cannot access the matrix of object without names" msgstr "" msgid "'form' must be a list" msgstr "" msgid "'nam' must be a list" msgstr "" msgid "'form' and 'nam' have incompatible lengths" msgstr "" msgid "'pdClass' must be a character vector" msgstr "" msgid "'form' and 'pdClass' have incompatible lengths" msgstr "" msgid "'nam' and 'pdClass' have incompatible lengths" msgstr "" msgid "LNone of the arguments specify more than one block" msgstr "" msgid "'object' must be a list when not missing, not a matrix, and not numeric" msgstr "" msgid "arguments imply different number of blocks" msgstr "" msgid "all elements in the argument must generate \"pdMat\" objects" msgstr "" msgid "cannot have duplicated column names in a \"pdMat\" object" msgstr "" msgid "must have formula when no names are given" msgstr "" msgid "must give names when initializing from matrix or parameter" msgstr "" msgid "all elements must have names when any has names" msgstr "" msgid "all elements must have a non-zero size" msgstr "" msgid "cannot change the parameter when length of parameters is undefined" msgstr "" msgid "cannot change parameter length of initialized \"pdMat\" object" msgstr "" msgid "all elements must have formulas when any has a formula" msgstr "" msgid "all elements of formula must be list of two-sided formulae or two-sided formulae" msgstr "" msgid "cannot change the number of columns on an initialized object" msgstr "" msgid "names of object and value must match" msgstr "" msgid "\"pdMat\" element must have a formula" msgstr "" msgid "'object' must be a list or a formula" msgstr "" msgid "\"pdMat\" elements must have a formula" msgstr "" msgid "elements in 'object' must be formulas or \"pdMat\" objects" msgstr "" msgid "cannot change the parameter when ength of parameters is undefined" msgstr "" msgid "cannot change parameter length of initialized objects" msgstr "" msgid "cannot extract groups formula without a formula" msgstr "" msgid "all elements of a \"reStruct\" object must have a non-zero size" msgstr "" msgid "cannot change the length of 'object'" msgstr "" msgid "cannot extract model matrix without formula" msgstr "" msgid "incompatible lengths for object names" msgstr "" msgid "'data' must inherit from \"groupedData\" class if 'random' does not define groups" msgstr "" msgid "models with \"corStruct\" and/or \"varFunc\" objects not allowed" msgstr "" msgid "no degrees of freedom specified" msgstr "" msgid "plot method only implemented for comparing models" msgstr "" msgid "degrees of freedom and weights must have the same length" msgstr "" msgid "negative degrees of freedom not allowed" msgstr "" msgid "more than one degree of freedom is needed when one them is zero." msgstr "" msgid "can only construct \"varFunc\" object from another \"varFunc\" object, a formula, or a character string" msgstr "" msgid "cannot extract parameters of uninitialized object" msgstr "" msgid "do not know how to get coefficients for %s object" msgstr "" msgid "cannot change the length of covariate in \"varFunc\" object" msgstr "" msgid "'value' must be a one sided formula" msgstr "" msgid "'form' must have a covariate" msgstr "" msgid "ignoring 'group' in \"varFixed\" formula" msgstr "" msgid "all variables used in 'formula' must be in 'data'" msgstr "" msgid "initial values must have group names in 'varIdent'" msgstr "" msgid "initial values for 'varIdent' must be > 0" msgstr "" msgid "fixed parameters must have names in 'varIdent'" msgstr "" msgid "cannot change the length of the \"varIdent\" parameter after initialization" msgstr "" msgid "fixed parameter names in 'varIdent' must be a subset of group names" msgstr "" msgid "cannot fix variances in all groups" msgstr "" msgid "initial value for \"varIdent\" should be of length %d" msgstr "" msgid "names of starting value for \"varIdent\" object must contain all but one of the stratum levels" msgstr "" msgid "nonexistent group names for initial values in 'varIdent'" msgstr "" msgid "initial values must have group names in 'varPower'" msgstr "" msgid "fixed parameters must have group names in 'varPower'" msgstr "" msgid "cannot change the length of the \"varStruct\" parameter after initialization" msgstr "" msgid "cannot change coefficients before initialization or when all parameters are fixed" msgstr "" msgid "fixed parameters must have group names" msgstr "" msgid "mismatch between group names and fixed values names" msgstr "" msgid "initial value for \"varPower\" should be of length %d" msgstr "" msgid "nonexistent group names for initial values in \"varPower\"" msgstr "" msgid "initial value for \"varPower\" should be of length 1" msgstr "" msgid "initial values must have group names in 'varExp'" msgstr "" msgid "fixed parameters must have group names in 'varExp'" msgstr "" msgid "cannot change the length of the \"varExp\" parameter after initialization" msgstr "" msgid "initial value for \"varExp\" should be of length %d" msgstr "" msgid "nonexistent group names for initial values in \"varExp\"" msgstr "" msgid "initial value for \"varExp\" should be of length 1" msgstr "" msgid "%s can have at most two components" msgstr "" msgid "%s can only have names \"const\" and \"power\"" msgstr "" msgid "%s can only be a list or numeric" msgstr "" msgid "%s must have group names in 'varConstPower'" msgstr "" msgid "constant in \"varConstPower\" structure must be > 0" msgstr "" msgid "initial value should be of length %d" msgstr "" msgid "nonexistent group names for initial values" msgstr "" msgid "all arguments to 'varComb' must be of class \"varFunc\"." msgstr "" msgid "cannot change parameter length of initialized \"varComb\" object" msgstr "" msgid "Package" msgstr "" msgid "installed with old R version" msgstr "" msgid "should not be used with R version" msgstr "" msgid "Rather re-install it with this version of R." msgstr "" msgid "deviance undefined for REML fit" msgstr "" msgid "AIC undefined for REML fit" msgstr "" msgid "not (yet) implemented. Contributions are welcome; use intervals() instead (for now)" msgstr "" msgid "term %s not matched" msgid_plural "terms %s not matched" msgstr[0] "" msgstr[1] "" msgid "'L' must have at most %d column" msgid_plural "'L' must have at most %d columns" msgstr[0] "" msgstr[1] "" msgid "effect %s not matched" msgid_plural "effects %s not matched" msgstr[0] "" msgstr[1] "" msgid "level %s not allowed for %s" msgid_plural "levels %s not allowed for %s" msgstr[0] "" msgstr[1] "" msgid "%d error caught in %s: %s" msgid_plural "%d times caught the same error in %s: %s" msgstr[0] "" msgstr[1] "" msgid "%s not found in data" msgid_plural "%s not found in data" msgstr[0] "" msgstr[1] "" msgid "nonexistent level %s" msgid_plural "nonexistent levels %s" msgstr[0] "" msgstr[1] "" msgid "%s not available for plotting" msgid_plural "%s not available for plotting" msgstr[0] "" msgstr[1] "" msgid "%s not matched" msgid_plural "%s not matched" msgstr[0] "" msgstr[1] "" msgid "group name not matched in starting values for random effects: %s" msgid_plural "group names not matched in starting values for random effects: %s" msgstr[0] "" msgstr[1] "" nlme/po/nlme.pot0000644000176200001440000000335213450712326013310 0ustar liggesusers# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the nlme package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: nlme 3.1-138\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-04-02 18:40+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: corStruct.c:423 msgid "All parameters must be less than 1 in absolute value" msgstr "" #: corStruct.c:533 msgid "Coefficient matrix not invertible" msgstr "" #: corStruct.c:870 corStruct.c:925 corStruct.c:985 corStruct.c:1027 msgid "Unknown spatial correlation class" msgstr "" #: nlme.c:464 msgid "First observation on an individual must have a dose" msgstr "" #: nlmefit.c:413 #, c-format msgid "Singularity in backsolve at level %ld, block %ld" msgstr "" #: nlmefit.c:453 #, c-format msgid "" "Too many parameters for finite-difference Hessian; npar = %d, nTot = %g." msgstr "" #: nlmefit.c:564 nlmefit.c:745 msgid "Overfitted model!" msgstr "" #: nlmefit.c:590 msgid "analytic gradient is not available with matrix logarithm" msgstr "" #: nlmefit.c:613 msgid "analytic gradient is not available with compound symmetry" msgstr "" #: nlmefit.c:906 #, c-format msgid "Unable to form eigenvalue-eigenvector decomposition [RS(.) ierr = %d]" msgstr "" #: nlmefit.c:938 #, c-format msgid "" "Unable to form Cholesky decomposition: the leading minor of order %d is not " "pos.def." msgstr "" #: nlmefit.c:970 msgid "Haven't written the compound symmetry case for this yet" msgstr "" nlme/po/R-ko.po0000644000176200001440000006627013450712326013011 0ustar liggesusers# Korean translation for R nlme package # Recommended/nlme/po/R-ko.po # Maintainer: R Core Team # Sent to Brian Ripley # Copyright (C) 1995-2013 The R Core Team # This file is distributed under the same license as the R nlme package. # R Development Translation Team - Korean # Chel Hee Lee , 2013. # Chel Hee Lee , 2013. # msgid "" msgstr "" "Project-Id-Version: nlme 3.1-105\n" "POT-Creation-Date: 2019-04-02 18:40\n" "PO-Revision-Date: 2013-08-16 18:52-0600\n" "Last-Translator: Chel Hee Lee \n" "Language-Team: R Development Translation Teams (Korean) \n" "Language: ko\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Poedit-SourceCharset: utf-8\n" "X-Generator: Poedit 1.5.4\n" msgid "not implemented for \"nlme\" objects" msgstr "\"nlme\" 객체들에 대하여 구현되지 않았습니다" msgid "not implemented for multiple levels of nesting" msgstr "" msgid "individual %s was not used in the fit" msgstr "" msgid "do not know how to calculate correlation matrix of %s object" msgstr "%s 객체의 상관행렬을 어떻게 계산해야 할 지 알 수 없습니다" msgid "\"corStruct\" object must have a \"fixed\" attribute" msgstr "\"corStruct\" 객체는 반드시 \"fixed\" 속성을 가지고 있어야 합니다" msgid "do not know how to obtain parameters of %s object" msgstr "%s 객체의 파라미터들을 어떻게 얻어야 할지 알 수 없습니다" msgid "cannot change the length of the parameter of a \"corStruct\" object" msgstr "\"corStruct\" 객체의 파라미터의 길이를 변경할 수 없습니다" msgid "" "'sumLenSq := sum(table(groups)^2)' = %g is too large.\n" " Too large or no groups in your correlation structure?" msgstr "" msgid "cannot change 'form'" msgstr "'form'를 변경할 수 없습니다" msgid "need data to calculate covariate of \"corStruct\" object" msgstr "\"corStruct\" 객체의 공변량을 계산하기 위한 데이터가 필요합니다" msgid "cannot change the length of the parameter of a \"corSymm\" object" msgstr "\"corSymm\" 객체의 파라미터의 길이를 변경할 수 없습니다" msgid "covariate must have unique values within groups for \"corSymm\" objects" msgstr "" msgid "" "unique values of the covariate for \"corSymm\" objects must be a sequence " "of consecutive integers" msgstr "" msgid "initial value for \"corSymm\" parameters of wrong dimension" msgstr "" msgid "initial values for \"corSymm\" must be between -1 and 1" msgstr "" msgid "" "initial values for \"corSymm\" do not define a positive-definite correlation " "structure" msgstr "" msgid "cannot change the length of the parameter of a \"corNatural\" object" msgstr "\"corNatural\" 객체의 파라미터의 길이를 변경할 수 없습니다" msgid "" "covariate must have unique values within groups for \"corNatural\" objects" msgstr "" msgid "" "unique values of the covariate for \"corNatural\" objects must be a sequence " "of consecutive integers" msgstr "" msgid "initial value for \"corNatural\" parameters of wrong dimension" msgstr "" msgid "initial values for \"corNatural\" must be between -1 and 1" msgstr "" msgid "" "initial values for \"corNatural\" do not define a positive-definite " "correlation structure" msgstr "" msgid "parameter in AR(1) structure must be between -1 and 1" msgstr "" msgid "'sumLenSq' = %g is too large (larger than maximal integer)" msgstr "" msgid "cannot change the length of the parameter of a \"corAR1\" object" msgstr "\"corAR1\" 객체의 파라미터의 길이를 변경할 수 없습니다" msgid "covariate must have unique values within groups for \"corAR1\" objects" msgstr "" msgid "parameter in CAR(1) structure must be between 0 and 1" msgstr "" msgid "cannot change the length of the parameter of a \"corCAR1\" object" msgstr "" msgid "covariate must have unique values within groups for \"corCAR1\" objects" msgstr "" msgid "autoregressive order must be a non-negative integer" msgstr "" msgid "moving average order must be a non-negative integer" msgstr "" msgid "initial value for parameter of wrong length" msgstr "" msgid "parameters in ARMA structure must be < 1 in absolute value" msgstr "" msgid "'object' has not been Initialize()d" msgstr "'object'가 초기화 되지 않았습니다" msgid "cannot change the length of the parameter of a \"corARMA\" object" msgstr "" msgid "covariate must have unique values within groups for \"corARMA\" objects" msgstr "" msgid "parameter in \"corCompSymm\" structure must be < 1 in absolute value" msgstr "" msgid "cannot change the length of the parameter of a \"corCompSymm\" object" msgstr "\"corCompSymm\" 객체의 파라미터의 길이를 변경할 수 없습니다" msgid "initial value in \"corCompSymm\" must be greater than %s" msgstr "\"corCompSymm\" 내의 초기값은 반드시 %s 보다 커야 합니다" msgid "cannot change the length of the parameter after initialization" msgstr "초기화 이후에는 파라미터의 길이를 변경할 수 없습니다" msgid "need data to calculate covariate" msgstr "공변량을 계산할 데이터가 필요합니다" msgid "cannot have zero distances in \"corSpatial\"" msgstr "" msgid "'range' must be > 0 in \"corSpatial\" initial value" msgstr "" msgid "initial value for \"corSpatial\" parameters of wrong dimension" msgstr "" msgid "initial value of nugget ratio must be between 0 and 1" msgstr "nugget ratio의 초기값은 반드시 0과 1 사이에 있어야 합니다" msgid "'range' must be > 0 in \"corLin\" initial value" msgstr "" msgid "" "initial value for 'range' less than minimum distance. Setting it to 1.1 * " "min(distance)" msgstr "" msgid "initial value for \"corLin\" parameters of wrong dimension" msgstr "" msgid "range must be > 0 in \"corSpher\" initial value" msgstr "" msgid "initial value for \"corSpher\" parameters of wrong dimension" msgstr "" msgid "model must be a formula of the form \"resp ~ pred\"" msgstr "" msgid "no coefficients to fit" msgstr "적합할 계수가 없습니다" msgid "maximum number of iterations reached without convergence" msgstr "수렴하지 않고 지정된 최대 반복수에 도달하였습니다" msgid "computed \"gls\" fit is singular, rank %s" msgstr "" msgid "object must inherit from class \"gls\"" msgstr "" msgid "'Terms' must be between 1 and %d" msgstr "'Terms'는 반드시 1과 %d 사이에 있어야 합니다" msgid "terms can only be integers or characters" msgstr "" msgid "data in %s call must evaluate to a data frame" msgstr "" msgid "" "%s without \"primary\" can only be used with fits of \"groupedData\" objects" msgstr "" msgid "only one level allowed for predictions" msgstr "" msgid "%s and %s must have the same group levels" msgstr "%s와 %s은 반드시 같은 그룹 수준들을 가져야 합니다" msgid "wrong group levels" msgstr "" msgid "cannot get confidence intervals on var-cov components: %s" msgstr "" msgid "need an object with call component" msgstr "" msgid "'nint' is not consistent with 'breaks'" msgstr "" msgid "Within-group std. dev. must be a positive numeric value" msgstr "" msgid "'object' must be a formula" msgstr "'object'는 반드시 formula이어야 합니다" msgid "object formula must be of the form \"resp ~ pred\"" msgstr "" msgid "'data' must be given explicitly to use 'nls' to get initial estimates" msgstr "" msgid "no initial values for model parameters" msgstr "" msgid "starting estimates must have names when 'params' is missing" msgstr "" msgid "'params' must be a formula or list of formulae" msgstr "" msgid "formulae in 'params' must be of the form \"parameter ~ expr\"" msgstr "" msgid "starting values for parameters are not of the correct length" msgstr "파라미터들에 대한 시작값들에 대한 길이가 올바르지 않습니다" msgid "cannot calculate REML log-likelihood for \"gnls\" objects" msgstr "" msgid "first argument to 'groupedData' must be a two-sided formula" msgstr "" msgid "right-hand side of first argument must be a conditional expression" msgstr "" msgid "first argument to 'nfGroupedData' must be a two-sided formula" msgstr "" msgid "only one level of grouping allowed" msgstr "" msgid "second argument to 'groupedData' must inherit from data.frame" msgstr "" msgid "first argument to 'nmGroupedData' must be a two-sided formula" msgstr "" msgid "single group not supported -- use groupedData()" msgstr "" msgid "'subset' ignored with single grouping factor" msgstr "" msgid "'subset' must be a list" msgstr "'subset'은 반드시 리스트이어야 합니다" msgid "undefined group declared in 'subset'" msgstr "" msgid "only one display level allowed" msgstr "" msgid "undefined display level %s for %s" msgstr "" msgid "undefined collapsing level %s for %s" msgstr "" msgid "" "collapsing level cannot be smaller than display level; setting it to the " "display level" msgstr "" msgid "'preserve' must be a two-sided formula" msgstr "" msgid "'asTable' cannot be used with multilevel grouped data" msgstr "" msgid "'asTable' can only be used with balanced 'groupedData' objects" msgstr "" msgid "%d errors caught in %s. The error messages and their frequencies are" msgstr "" msgid "'data' argument not used, but taken from groupedData object" msgstr "" msgid "multiple levels not allowed" msgstr "" msgid "'data' must be a \"groupedData\" object if 'groups' argument is missing" msgstr "" msgid "'data' in %s call must evaluate to a data frame" msgstr "" msgid "nonexistent groups requested in 'subset'" msgstr "" msgid "'subset' can only be character or integer" msgstr "" msgid "log-likelihood not available with NULL fits" msgstr "" msgid "'form' must be a formula" msgstr "'form'은 반드시 formula 이어야 합니다" msgid "'form' must be a one-sided formula" msgstr "" msgid "covariate must be a data frame" msgstr "공변량은 반드시 데이터프레임이어야 합니다" msgid "cannot do pairs of just one variable" msgstr "" msgid "'id' must be between 0 and 1" msgstr "'id'는 반드시 0과 1 사이에 있어야 합니다" msgid "'id' can only be a formula or numeric" msgstr "" msgid "'idLabels' of incorrect length" msgstr "" msgid "'idLabels' can only be a formula or a vector" msgstr "" msgid "covariate must be numeric" msgstr "" msgid "nonexistent group in 'newdata'" msgstr "" msgid "nonexistent group requested in 'subset'" msgstr "" msgid "only residuals and random effects allowed" msgstr "" msgid "can only fit \"lmList\" objects with single grouping variable" msgstr "" msgid "'lme.lmList' will redefine 'data'" msgstr "" msgid "initial value for \"reStruct\" overwritten in 'lme.lmList'" msgstr "" msgid "fixed-effects model must be a formula of the form \"resp ~ pred\"" msgstr "" msgid "incompatible lengths for 'random' and grouping factors" msgstr "" msgid "incompatible formulas for groups in 'random' and 'correlation'" msgstr "" msgid "" "cannot use smaller level of grouping for 'correlation' than for 'random'. " "Replacing the former with the latter." msgstr "" msgid "fewer observations than random effects in all level %s groups" msgstr "" msgid "" "%s problem, convergence error code = %s\n" " message = %s" msgstr "" #, fuzzy msgid "" "maximum number of iterations (lmeControl(maxIter)) reached without " "convergence" msgstr "수렴하지 않고 지정된 최대 반복수에 도달하였습니다" msgid "object must inherit from class \"lme\"" msgstr "" msgid "terms must all have the same denominator DF" msgstr "" msgid "L may only involve fixed effects with the same denominator DF" msgstr "" msgid "objects must inherit from classes %s, or %s" msgstr "" msgid "" "some fitted objects deleted because response differs from the first model" msgstr "" msgid "first model has a different response from the rest" msgstr "" msgid "all fitted objects must have the same estimation method" msgstr "모든 객체들이 같은 추정방법을 이용하여 적합되어야 합니다" msgid "" "fitted objects with different fixed effects. REML comparisons are not " "meaningful." msgstr "" msgid "objects must have a \"call\" component or attribute" msgstr "" msgid "all fitted objects must use the same number of observations" msgstr "" msgid "only single level allowed" msgstr "" msgid "" "cannot get confidence intervals on var-cov components: %s\n" " Consider '%s'" msgstr "" msgid "covariate must have a level attribute when groups are present" msgstr "" msgid "covariate must have a level attribute when 'id' is a formula" msgstr "" msgid "covariate must have a level attribute when 'idLabels' is a formula" msgstr "" msgid "'form' must be a formula when not NULL" msgstr "" msgid "only single effects allowed in left side of 'form'" msgstr "" msgid "%s is not a valid effect name" msgstr "" msgid "no effects allowed in right side of formula" msgstr "" msgid "cannot evaluate groups for desired levels on 'newdata'" msgstr "" msgid "'Id' must be between 0 and 1" msgstr "'Id'는 반드시 0과 1 사이에 있어야 합니다" msgid "augmentation of random effects only available for single level" msgstr "" msgid "no condensed linear model" msgstr "" msgid "no fitted \"lme\" object" msgstr "적합된 \"lme\" 객체가 없습니다" msgid "objects must have coefficients with same row names" msgstr "" msgid "object must inherit from \"data.frame\"" msgstr "" msgid "only one level allowed in 'gapply'" msgstr "" msgid "'which' must be between 1 and %d" msgstr "'which'는 반드시 1과 %d 사이에 있어야 합니다" msgid "'which' can only be character or integer" msgstr "" msgid "formula(object) must return a formula" msgstr "" msgid "'form' must be a two-sided formula" msgstr "" msgid "only one level allowed in 'gsummary'" msgstr "" msgid "'FUN' can only be a function or a list of functions" msgstr "" msgid "cannot omit grouping factor without 'form'" msgstr "" msgid "object must inherit from class \"lmList\"" msgstr "" msgid "no degrees of freedom for estimating std. dev." msgstr "" msgid "" "data argument to \"data.frame\" method for 'getGroups' does not make sense" msgstr "" msgid "invalid formula for groups" msgstr "" msgid "'form' must have all components as formulas" msgstr "" msgid "'form' can only be a formula, or a list of formulas" msgstr "" msgid "level of %s does not match formula %s" msgstr "" msgid "'form' argument must be a formula" msgstr "" msgid "at least two coefficients are needed" msgstr "" msgid "no model variogram available with 'showModel = TRUE'" msgstr "" msgid "only residuals allowed" msgstr "" msgid "'distance' and 'object' have incompatible lengths" msgstr "" msgid "'nlme.nlsList' will redefine 'fixed', 'data', and 'start'" msgstr "" msgid "can only fit \"nlsList\" objects with single grouping variable" msgstr "" msgid "initial value for 'reStruct' overwritten in 'nlme.nlsList'" msgstr "" msgid "'model' must be a formula" msgstr "" msgid "model formula must be of the form \"resp ~ pred\"" msgstr "" msgid "'data' must be given explicitly to use 'nlsList'" msgstr "" msgid "'fixed' must be a formula or list of formulae" msgstr "" msgid "formulae in 'fixed' must be of the form \"parameter ~ expr\"" msgstr "" msgid "'random' must be a formula or list of formulae" msgstr "" msgid "formulae in 'random' must be of the form \"parameter ~ expr\"" msgstr "" msgid "incompatible formulas for groups in \"random\" and \"correlation\"" msgstr "" msgid "" "cannot use smaller level of grouping for \"correlation\" than for \"random" "\". Replacing the former with the latter." msgstr "" msgid "'start' must have a component called 'fixed'" msgstr "" msgid "starting values for the 'fixed' component are not the correct length" msgstr "" msgid "starting values for random effects should be a list, or a matrix" msgstr "" msgid "" "list with starting values for random effects must have names or be of length " "%d" msgstr "" msgid "starting values for the random components should be a list of matrices" msgstr "" msgid "" "number of rows in starting values for random component at level %s should be " "%d" msgstr "" msgid "" "number of columns in starting values for random component at level %s should " "be %d" msgstr "" msgid "starting values for random effects must include group levels" msgstr "" msgid "" "groups levels mismatch in 'random' and starting values for 'random' at level " "%s" msgstr "" msgid "" "names mismatch in 'random' and starting values for 'random' at level %s" msgstr "" msgid "Iteration %d, LME step: nlminb() did not converge (code = %d)." msgstr "" msgid "Do increase 'msMaxIter'!" msgstr "" msgid "PORT message:" msgstr "" msgid "Iteration %d, LME step: nlm() did not converge (code = %d)." msgstr "" #, fuzzy msgid "maximum number of iterations (maxIter = %d) reached without convergence" msgstr "수렴하지 않고 지정된 최대 반복수에 도달하였습니다" msgid "second argument must be a groupedData object" msgstr "" msgid "cannot use an anonymous function for the model" msgstr "" msgid "" "'data' must be a \"groupedData\" object if 'formula' does not include groups" msgstr "" msgid "" "old-style self-starting model functions\n" "are no longer supported.\n" "New selfStart functions are available.\n" "Use\n" " SSfpl instead of fpl,\n" " SSfol instead of first.order.log,\n" " SSbiexp instead of biexp,\n" " SSlogis instead of logistic.\n" "If writing your own selfStart model, see\n" " \"help(selfStart)\"\n" "for the new form of the \"initial\" attribute." msgstr "" msgid "missing call attribute in \"nlsList\" object" msgstr "" msgid "cannot access the matrix of uninitialized objects" msgstr "" msgid "ignoring argument 'form'" msgstr "" msgid "ignoring argument 'nam'" msgstr "" msgid "'value' must be a square matrix" msgstr "" msgid "dimnames of 'value' must match or be NULL" msgstr "" msgid "names of 'value' are not consistent with 'nam' argument" msgstr "" msgid "%s is not a valid object for \"pdMat\"" msgstr "" msgid "all elements of 'form' list must be two-sided formulas" msgstr "" msgid "'form' can only be a formula or a list of formulae" msgstr "" msgid "'form' not consistent with 'nam'" msgstr "" msgid "length of 'nam' not consistent with dimensions of initial value" msgstr "" msgid "no default method for extracting the square root of a \"pdMat\" object" msgstr "" msgid "do not know how to obtain constrained coefficients" msgstr "" msgid "" "cannot access the number of columns of uninitialized objects without names" msgstr "" msgid "cannot extract the log of the determinant from an uninitialized object" msgstr "" msgid "cannot change dimensions on an initialized \"pdMat\" object" msgstr "초기화된 \"pdMat\" 객체의 차원정보를 변경할 수 없습니다" msgid "Length of names should be %d" msgstr "" msgid "" "names being assigned do not correspond to a permutation of previous names" msgstr "" msgid "x-y data to splom got botched somehow" msgstr "" msgid "cannot get the inverse of an uninitialized object" msgstr "" msgid "an object of length %d does not match the required parameter size" msgstr "" msgid "cannot extract matrix from an uninitialized object" msgstr "" msgid "cannot extract the inverse from an uninitialized object" msgstr "" msgid "an object of length %d does not match a Cholesky factor" msgstr "" msgid "cannot extract the matrix from an uninitialized object" msgstr "" msgid "cannot extract the matrix from an uninitialized \"pdIdent\" object" msgstr "" msgid "cannot extract the matrix with uninitialized dimensions" msgstr "" msgid "" "must give names when initializing \"pdIdent\" from parameter without a " "formula" msgstr "" msgid "cannot extract the dimensions" msgstr "" msgid "cannot extract the matrix from an uninitialized \"pdCompSymm\" object" msgstr "" msgid "initializing \"pdCompSymm\" object is not positive definite" msgstr "" msgid "" "must give names when initializing \"pdCompSymm\" from parameter without a " "formula" msgstr "" msgid "cannot obtain constrained coefficients with uninitialized dimensions" msgstr "" msgid "cannot access the matrix of object without names" msgstr "" msgid "'form' must be a list" msgstr "'form'은 반드시 리스트이어야 합니다" msgid "'nam' must be a list" msgstr "'nam'은 반드시 리스트이어야 합니다" msgid "'form' and 'nam' have incompatible lengths" msgstr "" msgid "'pdClass' must be a character vector" msgstr "'pdClass'는 반드시 문자형 벡터이어야 합니다" msgid "'form' and 'pdClass' have incompatible lengths" msgstr "" msgid "'nam' and 'pdClass' have incompatible lengths" msgstr "" msgid "LNone of the arguments specify more than one block" msgstr "" msgid "'object' must be a list when not missing, not a matrix, and not numeric" msgstr "" msgid "arguments imply different number of blocks" msgstr "" msgid "all elements in the argument must generate \"pdMat\" objects" msgstr "" msgid "cannot have duplicated column names in a \"pdMat\" object" msgstr "" msgid "must have formula when no names are given" msgstr "" msgid "must give names when initializing from matrix or parameter" msgstr "" msgid "all elements must have names when any has names" msgstr "" msgid "all elements must have a non-zero size" msgstr "" msgid "cannot change the parameter when length of parameters is undefined" msgstr "" msgid "cannot change parameter length of initialized \"pdMat\" object" msgstr "" msgid "all elements must have formulas when any has a formula" msgstr "" msgid "" "all elements of formula must be list of two-sided formulae or two-sided " "formulae" msgstr "" msgid "cannot change the number of columns on an initialized object" msgstr "" msgid "names of object and value must match" msgstr "" msgid "\"pdMat\" element must have a formula" msgstr "" msgid "'object' must be a list or a formula" msgstr "" msgid "\"pdMat\" elements must have a formula" msgstr "" msgid "elements in 'object' must be formulas or \"pdMat\" objects" msgstr "" msgid "cannot change the parameter when ength of parameters is undefined" msgstr "" msgid "cannot change parameter length of initialized objects" msgstr "" msgid "cannot extract groups formula without a formula" msgstr "" msgid "all elements of a \"reStruct\" object must have a non-zero size" msgstr "" msgid "cannot change the length of 'object'" msgstr "" msgid "cannot extract model matrix without formula" msgstr "" msgid "incompatible lengths for object names" msgstr "" msgid "" "'data' must inherit from \"groupedData\" class if 'random' does not define " "groups" msgstr "" msgid "models with \"corStruct\" and/or \"varFunc\" objects not allowed" msgstr "" msgid "no degrees of freedom specified" msgstr "" msgid "plot method only implemented for comparing models" msgstr "" msgid "degrees of freedom and weights must have the same length" msgstr "" msgid "negative degrees of freedom not allowed" msgstr "" msgid "more than one degree of freedom is needed when one them is zero." msgstr "" msgid "" "can only construct \"varFunc\" object from another \"varFunc\" object, a " "formula, or a character string" msgstr "" msgid "cannot extract parameters of uninitialized object" msgstr "" msgid "do not know how to get coefficients for %s object" msgstr "" msgid "cannot change the length of covariate in \"varFunc\" object" msgstr "" msgid "'value' must be a one sided formula" msgstr "" msgid "'form' must have a covariate" msgstr "" msgid "ignoring 'group' in \"varFixed\" formula" msgstr "" msgid "all variables used in 'formula' must be in 'data'" msgstr "" msgid "initial values must have group names in 'varIdent'" msgstr "" msgid "initial values for 'varIdent' must be > 0" msgstr "" msgid "fixed parameters must have names in 'varIdent'" msgstr "" msgid "" "cannot change the length of the \"varIdent\" parameter after initialization" msgstr "" msgid "fixed parameter names in 'varIdent' must be a subset of group names" msgstr "" msgid "cannot fix variances in all groups" msgstr "" msgid "initial value for \"varIdent\" should be of length %d" msgstr "" msgid "" "names of starting value for \"varIdent\" object must contain all but one of " "the stratum levels" msgstr "" msgid "nonexistent group names for initial values in 'varIdent'" msgstr "" msgid "initial values must have group names in 'varPower'" msgstr "" msgid "fixed parameters must have group names in 'varPower'" msgstr "" msgid "" "cannot change the length of the \"varStruct\" parameter after initialization" msgstr "" msgid "" "cannot change coefficients before initialization or when all parameters are " "fixed" msgstr "" msgid "fixed parameters must have group names" msgstr "" msgid "mismatch between group names and fixed values names" msgstr "" msgid "initial value for \"varPower\" should be of length %d" msgstr "" msgid "nonexistent group names for initial values in \"varPower\"" msgstr "" msgid "initial value for \"varPower\" should be of length 1" msgstr "" msgid "initial values must have group names in 'varExp'" msgstr "" msgid "fixed parameters must have group names in 'varExp'" msgstr "" msgid "" "cannot change the length of the \"varExp\" parameter after initialization" msgstr "" msgid "initial value for \"varExp\" should be of length %d" msgstr "" msgid "nonexistent group names for initial values in \"varExp\"" msgstr "" msgid "initial value for \"varExp\" should be of length 1" msgstr "" msgid "%s can have at most two components" msgstr "" msgid "%s can only have names \"const\" and \"power\"" msgstr "" msgid "%s can only be a list or numeric" msgstr "" msgid "%s must have group names in 'varConstPower'" msgstr "" msgid "constant in \"varConstPower\" structure must be > 0" msgstr "" msgid "initial value should be of length %d" msgstr "" msgid "nonexistent group names for initial values" msgstr "" msgid "all arguments to 'varComb' must be of class \"varFunc\"." msgstr "" msgid "cannot change parameter length of initialized \"varComb\" object" msgstr "" msgid "Package" msgstr "" msgid "installed with old R version" msgstr "" msgid "should not be used with R version" msgstr "" msgid "Rather re-install it with this version of R." msgstr "" msgid "deviance undefined for REML fit" msgstr "" msgid "AIC undefined for REML fit" msgstr "" msgid "" "not (yet) implemented. Contributions are welcome; use intervals() instead " "(for now)" msgstr "" msgid "term %s not matched" msgid_plural "terms %s not matched" msgstr[0] "" msgstr[1] "" msgid "'L' must have at most %d column" msgid_plural "'L' must have at most %d columns" msgstr[0] "" msgstr[1] "" msgid "effect %s not matched" msgid_plural "effects %s not matched" msgstr[0] "" msgstr[1] "" msgid "level %s not allowed for %s" msgid_plural "levels %s not allowed for %s" msgstr[0] "" msgstr[1] "" msgid "%d error caught in %s: %s" msgid_plural "%d times caught the same error in %s: %s" msgstr[0] "" msgid "%s not found in data" msgid_plural "%s not found in data" msgstr[0] "데이터로부터 %s를 찾을 수 없습니다" msgid "nonexistent level %s" msgid_plural "nonexistent levels %s" msgstr[0] "" msgstr[1] "" msgid "%s not available for plotting" msgid_plural "%s not available for plotting" msgstr[0] "" msgstr[1] "" msgid "%s not matched" msgid_plural "%s not matched" msgstr[0] "" msgstr[1] "" msgid "group name not matched in starting values for random effects: %s" msgid_plural "" "group names not matched in starting values for random effects: %s" msgstr[0] "" msgstr[1] "" nlme/po/pl.po0000644000176200001440000000674613450712326012616 0ustar liggesusersmsgid "" msgstr "" "Project-Id-Version: nlme 3.1-115\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-04-02 18:40+0200\n" "PO-Revision-Date: \n" "Last-Translator: Łukasz Daniel \n" "Language-Team: Łukasz Daniel \n" "Language: pl_PL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "na-Revision-Date: 2012-05-29 07:55+0100\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" "X-Poedit-SourceCharset: iso-8859-1\n" "X-Generator: Poedit 1.5.4\n" # nlme/src/corStruct.c: 445 # error(_("All parameters must be less than 1 in absolute value")) #: corStruct.c:423 msgid "All parameters must be less than 1 in absolute value" msgstr "Wszystkie parametry muszą być na moduł mniejsze niż 1" # nlme/src/corStruct.c: 556 # error(_("Coefficient matrix not invertible")) #: corStruct.c:533 msgid "Coefficient matrix not invertible" msgstr "Macierz współczynników nie jest odwracalna" # nlme/src/corStruct.c: 908 # error(_("Unknown spatial correlation class")) # nlme/src/corStruct.c: 963 # error(_("Unknown spatial correlation class")) # nlme/src/corStruct.c: 1030 # error(_("Unknown spatial correlation class")) # nlme/src/corStruct.c: 1072 # error(_("Unknown spatial correlation class")) #: corStruct.c:870 corStruct.c:925 corStruct.c:985 corStruct.c:1027 msgid "Unknown spatial correlation class" msgstr "Nieznana klasa przestrzennej korelacji" # nlme/src/nlme.c: 499 # error(_("First observation on an individual must have a dose")) #: nlme.c:464 msgid "First observation on an individual must have a dose" msgstr "Pierwsza obserwacja jednostki musi mieć zamknięcie" # nlme/src/nlmefit.c: 401 # error(_("Singularity in backsolve at level %ld, block %ld"), # (long int) (i - (dd->Q)), j + 1L) #: nlmefit.c:413 #, c-format msgid "Singularity in backsolve at level %ld, block %ld" msgstr "Osobliwość w 'backsolve' na poziomie %ld, blok %ld" #: nlmefit.c:453 #, c-format msgid "" "Too many parameters for finite-difference Hessian; npar = %d, nTot = %g." msgstr "" #: nlmefit.c:564 nlmefit.c:745 msgid "Overfitted model!" msgstr "" # nlme/src/nlmefit.c: 558 # error(_("analytic gradient is not available with matrix logarithm")) #: nlmefit.c:590 msgid "analytic gradient is not available with matrix logarithm" msgstr "gradient analityczny nie jest dostępny z algorytmem macierzowym" # nlme/src/nlmefit.c: 581 # error(_("analytic gradient is not available with compound symmetry")) #: nlmefit.c:613 msgid "analytic gradient is not available with compound symmetry" msgstr "gradient analityczny nie jest dostępny dla złożonej symetrii" # nlme/src/nlmefit.c: 861 # error(_("Unable to form eigenvalue-eigenvector decomposition")) #: nlmefit.c:906 #, c-format msgid "Unable to form eigenvalue-eigenvector decomposition [RS(.) ierr = %d]" msgstr "" "Nie można uformować dekompozycji wartość własna-wektor własny [RS(.) ierr = " "%d]" # nlme/src/nlmefit.c: 893 # error(_("Unable to form Cholesky decomposition")) #: nlmefit.c:938 #, fuzzy, c-format msgid "" "Unable to form Cholesky decomposition: the leading minor of order %d is not " "pos.def." msgstr "Nie można uformować dekompozycji Cholesky'ego" # nlme/src/nlmefit.c: 924 # error(_("Haven't written the compound symmetry case for this yet")) #: nlmefit.c:970 msgid "Haven't written the compound symmetry case for this yet" msgstr "Jak na razie nie została napisany przypadek dla tej złożonej symetrii" nlme/po/ko.po0000644000176200001440000000525313450712326012604 0ustar liggesusers# Korean translation for R nlme package # Recommended/nlme/po/ko.po # Maintainer: R Core Team # Sent to Brian Ripley # Copyright (C) 1995-2013 The R Core Team # This file is distributed under the same license as the R nlme package. # R Development Translation Team - Korean # Chel Hee Lee , 2013. # Chel Hee Lee , 2013. # msgid "" msgstr "" "Project-Id-Version: nlme 3.1-105\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-04-02 18:40+0200\n" "PO-Revision-Date: 2013-08-16 18:27-0600\n" "Last-Translator: Chel Hee Lee \n" "Language-Team: R Development Translation Teams (Korean) \n" "Language: ko\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Poedit-SourceCharset: utf-8\n" "X-Generator: Poedit 1.5.4\n" #: corStruct.c:423 msgid "All parameters must be less than 1 in absolute value" msgstr "모든 파라미터들의 절대값이 반드시 1 보다 작아야 합니다" #: corStruct.c:533 msgid "Coefficient matrix not invertible" msgstr "가역적이지 않은 계수행렬입니다" #: corStruct.c:870 corStruct.c:925 corStruct.c:985 corStruct.c:1027 msgid "Unknown spatial correlation class" msgstr "알 수 없는 spatial correlation 클래스입니다" #: nlme.c:464 msgid "First observation on an individual must have a dose" msgstr "개인의 첫번째 관측값은 반드시 dose 이어야 합니다" #: nlmefit.c:413 #, c-format msgid "Singularity in backsolve at level %ld, block %ld" msgstr "" #: nlmefit.c:453 #, c-format msgid "" "Too many parameters for finite-difference Hessian; npar = %d, nTot = %g." msgstr "" #: nlmefit.c:564 nlmefit.c:745 msgid "Overfitted model!" msgstr "" #: nlmefit.c:590 msgid "analytic gradient is not available with matrix logarithm" msgstr "analytic gradient는 matrix logarithm과 함께 사용할 수 없습니다" #: nlmefit.c:613 msgid "analytic gradient is not available with compound symmetry" msgstr "analytic gradient는 compound symmetry와 함께 사용할 수 없습니다" #: nlmefit.c:906 #, fuzzy, c-format msgid "Unable to form eigenvalue-eigenvector decomposition [RS(.) ierr = %d]" msgstr "고유값-고유벡터 분해를 할 수 없습니다" #: nlmefit.c:938 #, fuzzy, c-format msgid "" "Unable to form Cholesky decomposition: the leading minor of order %d is not " "pos.def." msgstr "콜레스키 분해를 할 수 없습니다" #: nlmefit.c:970 msgid "Haven't written the compound symmetry case for this yet" msgstr "이것에 대하여 compound symmetry의 경우는 아직 작성되지 않았습니다" nlme/po/R-pl.po0000644000176200001440000040543413450712326013012 0ustar liggesusersmsgid "" msgstr "" "Project-Id-Version: nlme 3.1-115\n" "Report-Msgid-Bugs-To: bugs@r-project.org\n" "POT-Creation-Date: 2019-04-02 18:40\n" "PO-Revision-Date: 2014-03-25 17:00+0100\n" "Last-Translator: Łukasz Daniel \n" "Language-Team: Łukasz Daniel \n" "Language: pl_PL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" "X-Poedit-SourceCharset: iso-8859-1\n" "X-Generator: Poedit 1.5.4\n" "X-Poedit-Bookmarks: -1,-1,-1,72,-1,-1,-1,-1,-1,-1\n" msgid "not implemented for \"nlme\" objects" msgstr "" "funkcja 'getVarCov.lme()' nie jest zaimplementowana dla obiektów klasy " "\"nlme\"" # nlme/R/VarCov.R: 28 # stop("'getVarCov.lme()' is not implemented for multiple levels of nesting") msgid "not implemented for multiple levels of nesting" msgstr "" "funkcja 'getVarCov.lme()' nie jest zaimplementowana dla wielu poziomów " "zagnieżdżenia" # nlme/R/VarCov.R: 47 # stop(gettextf("individual %s was not used in the fit", sQuote(individ)), domain = "R-nlme") # nlme/R/VarCov.R: 49 # stop(gettextf("individual %s was not used in the fit", sQuote(individ)), domain = "R-nlme") msgid "individual %s was not used in the fit" msgstr "jednostka %s nie została użyta w dopasowaniu" # nlme/R/corStruct.R: 60 # stop(gettextf("do not know how to calculate correlation matrix of %s object", dQuote(class(object)[1])), domain = "R-nlme") msgid "do not know how to calculate correlation matrix of %s object" msgstr "nie wiadomo jak policzyć macierz korelacji obiektu %s" # nlme/R/corStruct.R: 107 # stop("\"corStruct\" object must have a \"fixed\" attribute") msgid "\"corStruct\" object must have a \"fixed\" attribute" msgstr "obiekt \"corStruct\" musi posiadać atrybut \"fixed\"." # nlme/R/corStruct.R: 115 # stop(gettextf("do not know how to obtain parameters of %s object", dQuote(class(object)[1])), domain = "R-nlme") msgid "do not know how to obtain parameters of %s object" msgstr "nie wiadomo jak uzyskać parametry obiektu %s" msgid "cannot change the length of the parameter of a \"corStruct\" object" msgstr "nie można zmienić długości parametru obiektu klasy \"corStruct\"" msgid "" "'sumLenSq := sum(table(groups)^2)' = %g is too large.\n" " Too large or no groups in your correlation structure?" msgstr "" # nlme/R/corStruct.R: 160 # warning("cannot change 'form' argument") msgid "cannot change 'form'" msgstr "nie można zmienić argumentu 'form'" msgid "need data to calculate covariate of \"corStruct\" object" msgstr "" "argument 'data' jest wymagany aby wyliczyć zmienną wyjaśniającą obiektu " "klasy \"corStruct\"" msgid "cannot change the length of the parameter of a \"corSymm\" object" msgstr "nie można zmienić długości parametru obiektu klasy \"corSymm\"" msgid "covariate must have unique values within groups for \"corSymm\" objects" msgstr "" "zmienna wyjaśniająca musi mieć unikalne wartości w obrębie grup dla obiektów " "klasy \"corSymm\"" msgid "" "unique values of the covariate for \"corSymm\" objects must be a sequence " "of consecutive integers" msgstr "" "unikalne wartości zmiennej wyjaśniającej dla obiektów klasy \"corSymm\" " "muszą być ciągiem kolejnych liczb całkowitych" # nlme/R/corStruct.R: 465 # stop("initial value for \"corSymm\" parameters are of wrong dimension") msgid "initial value for \"corSymm\" parameters of wrong dimension" msgstr "" "początkowe wartości dla parametrów \"corSymm\" posiadają niepoprawne wymiary" msgid "initial values for \"corSymm\" must be between -1 and 1" msgstr "początkowe wartości dla \"corNatural\" muszą być pomiędzy -1 a 1" # nlme/R/corStruct.R: 475 # stop("initial values for \"corSymm\" do not define a positive-definite correlation structure") msgid "" "initial values for \"corSymm\" do not define a positive-definite correlation " "structure" msgstr "" "początkowe wartości dla \"corSymm\" nie definiują dodatnio określonej " "struktury korelacji" msgid "cannot change the length of the parameter of a \"corNatural\" object" msgstr "nie można zmienić długości parametru obiektu klasy \"corNatural\"" msgid "" "covariate must have unique values within groups for \"corNatural\" objects" msgstr "" "zmienna wyjaśniająca musi mieć unikalne wartości w obrębie grup dla obiektów " "klasy \"corNatural\"" msgid "" "unique values of the covariate for \"corNatural\" objects must be a sequence " "of consecutive integers" msgstr "" "unikalne wartości zmiennej wyjaśniającej dla obiektów klasy \"corNatural\" " "muszą być ciągiem kolejnych liczb całkowitych" # nlme/R/corStruct.R: 705 # stop("initial value for \"corNatural\" parameters of wrong dimension") msgid "initial value for \"corNatural\" parameters of wrong dimension" msgstr "" "początkowe wartości dla parametrów \"corNatural\" posiadają niepoprawne " "wymiary" msgid "initial values for \"corNatural\" must be between -1 and 1" msgstr "początkowe wartości dla \"corNatural\" muszą być pomiędzy -1 a 1" # nlme/R/corStruct.R: 715 # stop("initial values for \"corNatural\" do not define a positive-definite correlation structure") msgid "" "initial values for \"corNatural\" do not define a positive-definite " "correlation structure" msgstr "" "początkowe wartości dla \"corNatural\" nie definiują dodatnio określonej " "strukture korelacji" msgid "parameter in AR(1) structure must be between -1 and 1" msgstr "parametr w strukturze AR(1) musi być pomiędzy -1 a 1" msgid "'sumLenSq' = %g is too large (larger than maximal integer)" msgstr "" msgid "cannot change the length of the parameter of a \"corAR1\" object" msgstr "nie można zmienić długości parametru obiektu klasy \"corCAR1\"" msgid "covariate must have unique values within groups for \"corAR1\" objects" msgstr "" "zmienna wyjaśniająca musi mieć unikalne wartości w obrębie grup dla obiektów " "klasy \"corCAR1\"" msgid "parameter in CAR(1) structure must be between 0 and 1" msgstr "parametr w strukturze AR(1) musi być pomiędzy 0 a 1" msgid "cannot change the length of the parameter of a \"corCAR1\" object" msgstr "nie można zmienić długości parametru obiektu klasy \"corCAR1\"" msgid "covariate must have unique values within groups for \"corCAR1\" objects" msgstr "" "zmienna wyjaśniająca musi mieć unikalne wartości w obrębie grup dla obiektów " "klasy \"corCAR1\"" # nlme/R/corStruct.R: 1177 # stop("autoregressive order must be a non-negative integer") msgid "autoregressive order must be a non-negative integer" msgstr "rząd autoregresji musi być nieujemną liczbą całkowitą" # nlme/R/corStruct.R: 1180 # stop("moving average order must be a non-negative integer") msgid "moving average order must be a non-negative integer" msgstr "rząd średniej ruchomej musi być nieujemną liczbą całkowitą" # nlme/R/corStruct.R: 1186 # stop("initial value for parameter of wrong length") msgid "initial value for parameter of wrong length" msgstr "początkowa wartość parametru posiada niepoprawną długość" msgid "parameters in ARMA structure must be < 1 in absolute value" msgstr "parametry w strukturze ARMA muszą być pomiędzy -1 a 1" # nlme/R/corStruct.R: 1208 # stop("'object' argument has not been initialized with 'Initialize()' function") # nlme/R/corStruct.R: 1241 # stop("'object' argument has not been initialized with 'Initialize()' function") # nlme/R/corStruct.R: 1311 # stop("'object' argument has not been initialized with 'Initialize()' function") # nlme/R/corStruct.R: 1364 # stop("'object' argument has not been initialized with 'Initialize()' function") msgid "'object' has not been Initialize()d" msgstr "argument 'object' nie został zainicjalizowany metodą 'Initialize()'" msgid "cannot change the length of the parameter of a \"corARMA\" object" msgstr "nie można zmienić długości parametru obiektu klasy \"corARMA\"" msgid "covariate must have unique values within groups for \"corARMA\" objects" msgstr "" "zmienna wyjaśniająca musi mieć unikalne wartości w obrębie grup dla obiektów " "klasy \"corARMA\"" msgid "parameter in \"corCompSymm\" structure must be < 1 in absolute value" msgstr "parametr w strukturze \"corCompSymm\" musi być pomiędzy -1 a 1" msgid "cannot change the length of the parameter of a \"corCompSymm\" object" msgstr "nie można zmienić długości parametru obiektu klasy \"corCompSymm\"" # nlme/R/corStruct.R: 1516 # stop(sprintf(gettext("initial value in \"corCompSymm\" must be greater than %s", domain = "R-nlme"), attr(object, "inf")), domain = NA) msgid "initial value in \"corCompSymm\" must be greater than %s" msgstr "początkowa wartość w \"corCompSymm\" musi być większa niż %s" # nlme/R/corStruct.R: 1851 # stop("cannot change the length of the parameter after initialization") # nlme/R/varFunc.R: 998 # stop("cannot change the length of the parameter after initialization") # nlme/R/pdMat.R: 256 # stop("cannot change the length of the parameter after initialization") msgid "cannot change the length of the parameter after initialization" msgstr "nie można zmienić długości parametru po jego zainicjowaniu" msgid "need data to calculate covariate" msgstr "" "argument 'data' jest wymagany aby wyliczyć zmienną wyjaśniającą obiektu " "klasy \"corSpatial\"" # nlme/R/corStruct.R: 1930 # stop("cannot have zero distances in \"corSpatial\"") msgid "cannot have zero distances in \"corSpatial\"" msgstr "nie można mieć zerowych odległości w \"corSpatial\"" # nlme/R/corStruct.R: 1948 # stop("'range' must be > 0 in \"corSpatial\" initial value") msgid "'range' must be > 0 in \"corSpatial\" initial value" msgstr "argument 'range' musi być > 0 w początkowej wartości \"corSpatial\"" # nlme/R/corStruct.R: 1955 # stop("initial value for \"corSpatial\" parameters of wrong dimension") # nlme/R/corStruct.R: 1963 # stop("initial value for \"corSpatial\" parameters of wrong dimension") msgid "initial value for \"corSpatial\" parameters of wrong dimension" msgstr "początkowa wartość parametrów \"corSpatial\" ma niepoprawny wymiar" # nlme/R/corStruct.R: 1959 # stop("initial value of nugget ratio must be between 0 and 1") # nlme/R/corStruct.R: 2133 # stop("initial value of nugget ratio must be between 0 and 1") # nlme/R/corStruct.R: 2254 # stop("initial value of nugget ratio must be between 0 and 1") msgid "initial value of nugget ratio must be between 0 and 1" msgstr "początkowa wartość proporcji samorodka musi być pomiędzy 0 a 1" # nlme/R/corStruct.R: 1948 # stop("'range' must be > 0 in \"corSpatial\" initial value") msgid "'range' must be > 0 in \"corLin\" initial value" msgstr "argument 'range' musi być > 0 w początkowej wartości \"corLin\"" # nlme/R/corStruct.R: 2121 # warning("initial value for 'range' less than minimum distance. Setting it to 1.1 * min(distance)") # nlme/R/corStruct.R: 2242 # warning("initial value for 'range' less than minimum distance. Setting it to 1.1 * min(distance)") msgid "" "initial value for 'range' less than minimum distance. Setting it to 1.1 * " "min(distance)" msgstr "" "początkowa wartość 'range' mniejsza niż minimalna odległość. Ustawianie jej " "na '1.1 * min(distance)'" # nlme/R/corStruct.R: 2129 # stop("initial value for \"corLin\" parameters of wrong dimension") # nlme/R/corStruct.R: 2137 # stop("initial value for \"corLin\" parameters of wrong dimension") msgid "initial value for \"corLin\" parameters of wrong dimension" msgstr "początkowa wartość parametrów \"corLin\" ma niepoprawny wymiar" # nlme/R/corStruct.R: 2239 # stop("range must be > 0 in \"corSpher\" initial value") msgid "range must be > 0 in \"corSpher\" initial value" msgstr "zakres musi być > 0 w początkowej wartości \"corShere\"" # nlme/R/corStruct.R: 2250 # stop("initial value for \"corSpher\" parameters of wrong dimension") # nlme/R/corStruct.R: 2258 # stop("initial value for \"corSpher\" parameters of wrong dimension") msgid "initial value for \"corSpher\" parameters of wrong dimension" msgstr "początkowa wartość parametrów \"corSpher\" ma niepoprawny wymiar" # nlme/R/gls.R: 48 # stop("'model' argument must be a formula of the form \"resp ~ pred\"") msgid "model must be a formula of the form \"resp ~ pred\"" msgstr "" "argument 'model' musi być formułą o formie \"zmienna zależna ~ zmienna " "niezależna\"" # nlme/R/gls.R: 93 # stop("no coefficients to fit") msgid "no coefficients to fit" msgstr "brak współczynników do dopasowania" # nlme/R/gls.R: 173 # stop("maximum number of iterations reached without convergence") # nlme/R/gnls.R: 466 # warning("maximum number of iterations reached without convergence") # nlme/R/gnls.R: 469 # stop("maximum number of iterations reached without convergence") # nlme/R/nlme.R: 948 # warning("maximum number of iterations reached without convergence") # nlme/R/nlme.R: 951 # stop("maximum number of iterations reached without convergence") msgid "maximum number of iterations reached without convergence" msgstr "maksymalna liczba iteracji została osiągnięta bez uzyskania zbieżności" # nlme/R/gls.R: 322 # stop(gettextf("computed \"gls\" fit is singular, rank %s", rnk), domain = "R-nlme") msgid "computed \"gls\" fit is singular, rank %s" msgstr "obliczone dopasowanie \"gls\" jest osobliwe, ranga %s" msgid "object must inherit from class \"gls\"" msgstr "argument 'object' nie jest obiektem klasy \"gls\"" msgid "'Terms' must be between 1 and %d" msgstr "argument 'Terms' musi być pomiędzy 1 a %d" # nlme/R/gls.R: 466 # stop("terms can only be integers or characters") # nlme/R/lme.R: 902 # stop("terms can only be integers or characters") msgid "terms can only be integers or characters" msgstr "człony mogą być tylko liczbami całkowitymi lub tekstami" # nlme/R/gls.R: 541 # stop(gettextf("data in %s call must evaluate to a data frame", sQuote(substitute(object))), domain = "R-nlme") # nlme/R/lme.R: 1084 # stop(gettextf("data in %s call must evaluate to a data frame", sQuote(substitute(object))), domain = "R-nlme") msgid "data in %s call must evaluate to a data frame" msgstr "dane w wywołaniu %s muszą wyliczać się do ramki danych" # nlme/R/gls.R: 545 # stop(gettextf("%s without \"primary\" can only be used with fits of \"groupedData\" objects", sys.call()[[1L]]), domain = "R-nlme") # nlme/R/lme.R: 1088 # stop(gettextf("%s without \"primary\" can only be used with fits of \"groupedData\" objects", sys.call()[[1L]]), domain = "R-nlme") # nlme/R/lmList.R: 117 # stop(gettextf("%s without \"primary\" can only be used with fits of \"groupedData\" objects", sys.call()[[1]]), domain = "R-nlme") msgid "" "%s without \"primary\" can only be used with fits of \"groupedData\" objects" msgstr "" "%s bez \"primary\" może być użyte jedynie z dopasowaniami obiektów " "\"groupedData\"" # nlme/R/gls.R: 628 # stop("only one level allowed for predictions") msgid "only one level allowed for predictions" msgstr "tylko jeden poziom jest dozwolony dla przewidywań" # nlme/R/gls.R: 657 # stop(gettextf("%s and %s must have the same group levels", sQuote(c1), sQuote(c2)), domain = "R-nlme") msgid "%s and %s must have the same group levels" msgstr "%s oraz %s muszą mieć te same poziomy grup" # nlme/R/gls.R: 670 # stop("wrong group levels") # nlme/R/gls.R: 684 # stop("wrong group levels") msgid "wrong group levels" msgstr "błędne poziomy grupy" # nlme/R/gls.R: 772 # stop(gettextf("cannot get confidence intervals on var-cov components: %s", aV), domain = "R-nlme") # nlme/R/lme.R: 1302 # stop(gettextf("cannot get confidence intervals on var-cov components: %s", aV), domain = "R-nlme") msgid "cannot get confidence intervals on var-cov components: %s" msgstr "nie można uzyskać przedziałów ufności na komponentach var-cov: %s" # nlme/R/lmList.R: 1443 # stop("need an object with call component") msgid "need an object with call component" msgstr "wymagany jest obiekt z komponentem 'call'" # nlme/R/gls.R: 1217 # stop("'nint' is not consistent with 'breaks'") # nlme/R/lme.R: 2761 # stop("'nint' is not consistent with 'breaks'") msgid "'nint' is not consistent with 'breaks'" msgstr "'nint' jest niespójne z 'breaks'" msgid "Within-group std. dev. must be a positive numeric value" msgstr "" msgid "'object' must be a formula" msgstr "argument 'model' nie jest obiektem klasy \"formula\"" msgid "object formula must be of the form \"resp ~ pred\"" msgstr "" "formuła modelu musi mieć formę \"zmienna zależna ~ zmienna niezależna\"" # nlme/R/gnls.R: 85 # stop("'data' must be given explicitly to use 'nls' to get initial estimates") msgid "'data' must be given explicitly to use 'nls' to get initial estimates" msgstr "" "argument 'data' musi być podany bezpośrednio aby użyć 'nls()' w celu " "uzyskania początkowych oszacowań" # nlme/R/gnls.R: 89 # stop("no initial values for model parameters") msgid "no initial values for model parameters" msgstr "brak początkowych wartości dla parametrów modelu" # nlme/R/gnls.R: 102 # stop("starting estimates must have names when 'params' is missing") msgid "starting estimates must have names when 'params' is missing" msgstr "początkowe oszacowania muszą mieć nazwy gdy brakuje 'params'" msgid "'params' must be a formula or list of formulae" msgstr "argument 'params' musi być formułą lub listą formuł" msgid "formulae in 'params' must be of the form \"parameter ~ expr\"" msgstr "formuły w argumencie 'param' muszą mieć formę \"parametr ~ wyrażenie\"" # nlme/R/gnls.R: 273 # stop ("starting values for parameters are not of the correct length") msgid "starting values for parameters are not of the correct length" msgstr "wartości początkowe parametrów nie mają poprawnej długości" # nlme/R/gnls.R: 654 # stop("cannot calculate REML log-likelihood for \"gnls\" objects") msgid "cannot calculate REML log-likelihood for \"gnls\" objects" msgstr "" "nie można obliczyć REML logarytmu funkcji wiarygodności dla obiektów klasy " "\"gnls\"" msgid "first argument to 'groupedData' must be a two-sided formula" msgstr "" "pierwszy argument przekazywany do funkcji 'groupedData()' musi być " "dwustronną formułą" # nlme/R/groupedData.R: 34 # stop("right-hand side of first argument must be a conditional expression") # nlme/R/groupedData.R: 54 # stop("right-hand side of first argument must be a conditional expression") # nlme/R/groupedData.R: 154 # stop("right-hand side of first argument must be a conditional expression") msgid "right-hand side of first argument must be a conditional expression" msgstr "prawa strona pierwszego argumentu musi być wyrażeniem warunkowym" msgid "first argument to 'nfGroupedData' must be a two-sided formula" msgstr "" "pierwszy argument przekazywany do funkcji 'nmGroupedData()' musi być " "dwustronną formułą" # nlme/R/groupedData.R: 57 # stop("only one level of grouping allowed") msgid "only one level of grouping allowed" msgstr "tylko jeden poziom grupowania jest dozwolony" # nlme/R/groupedData.R: 67 # stop("second argument passed to 'groupedData()' function must inherit from \"data.frame\"") # nlme/R/groupedData.R: 176 # stop("second argument passed to 'groupedData()' function must inherit from \"data.frame\"") msgid "second argument to 'groupedData' must inherit from data.frame" msgstr "" "drugi argument przekazywany do funkcji 'groupedData()' musi dziedziczyć z " "klasy \"data.frame\"" msgid "first argument to 'nmGroupedData' must be a two-sided formula" msgstr "" "pierwszy argument przekazywany do funkcji 'nmGroupedData()' musi być " "dwustronną formułą" msgid "single group not supported -- use groupedData()" msgstr "" # nlme/R/groupedData.R: 219 # warning("'subset' ignored with single grouping factor") msgid "'subset' ignored with single grouping factor" msgstr "argument 'subset' został zignorowany z jednym czynnikem grupującym" msgid "'subset' must be a list" msgstr "argument 'subset' musi być listą" # nlme/R/groupedData.R: 234 # stop("undefined group declared in 'subset'") msgid "undefined group declared in 'subset'" msgstr "niezdefiniowana grupa zadeklarowana w argumencie 'subset'" # nlme/R/groupedData.R: 245 # stop("only one display level allowed") msgid "only one display level allowed" msgstr "tylko jeden poziom wyświetlenia jest dozwolony" # nlme/R/groupedData.R: 248 # stop(gettextf("undefined display level %s for %s", displayLevel, sQuote(substitute(object))), domain = "R-nlme") msgid "undefined display level %s for %s" msgstr "niezdefiniowany poziom %s wyświetlenia dla %s" # nlme/R/groupedData.R: 273 # stop(gettextf("undefined collapsing level %s for %s", collapseLevel, sQuote(substitute(object))), domain = "R-nlme") msgid "undefined collapsing level %s for %s" msgstr "niezdefiniowany poziom %s zapadania dla %s" # nlme/R/groupedData.R: 282 # warning("collapsing level cannot be smaller than display level; setting it to the display level") msgid "" "collapsing level cannot be smaller than display level; setting it to the " "display level" msgstr "" "poziom zapadania nie może być mniejszy niż poziom wyświetlania; ustawianie " "go do poziomu wyświetlania" msgid "'preserve' must be a two-sided formula" msgstr "argument 'preserve' musi być dwustronną formułą" # nlme/R/groupedData.R: 626 # stop("'asTable()' cannot be used with multilevel grouped data") msgid "'asTable' cannot be used with multilevel grouped data" msgstr "" "funkcja 'asTable()' nie może być użyta z wielopoziomowymi zgrupowanymi danymi" # nlme/R/groupedData.R: 630 # stop("'asTable()' can only be used with balanced 'groupedData' objects") msgid "'asTable' can only be used with balanced 'groupedData' objects" msgstr "" "funkcja 'asTable()' może być użyta jedynie ze zbalansowanymi obiektami klasy " "\"groupedData\"" msgid "%d errors caught in %s. The error messages and their frequencies are" msgstr "" # nlme/R/nlsList.R: 31 # stop("second argument must be a groupedData object") #, fuzzy msgid "'data' argument not used, but taken from groupedData object" msgstr "drugi argument musi być obiektem \"groupedData\"" # nlme/R/lmList.R: 56 # stop("multiple levels not allowed") # nlme/R/lmList.R: 71 # stop("multiple levels not allowed") # nlme/R/nlsList.R: 63 # stop("multiple levels not allowed") # nlme/R/nlsList.R: 74 # stop("multiple levels not allowed") msgid "multiple levels not allowed" msgstr "wielokrotne poziomy nie są dozwolone" # nlme/R/lmList.R: 65 # stop ("'data' must be a \"groupedData\" object if 'groups' argument is missing") msgid "'data' must be a \"groupedData\" object if 'groups' argument is missing" msgstr "" "argument 'data' musi być obiektem klasy \"groupedData\" jeśli brakuje " "argumentu 'groups' " # nlme/R/lmList.R: 113 # stop(gettextf("'data' in %s call must evaluate to a data frame", sQuote(substitute(object))), domain = "R-nlme") msgid "'data' in %s call must evaluate to a data frame" msgstr "argument 'data' w wywołaniu %s musi wyliczać się do ramki danych" # nlme/R/lmList.R: 232 # stop("nonexistent groups requested in 'subset'") # nlme/R/lmList.R: 237 # stop("nonexistent groups requested in 'subset'") # nlme/R/lmList.R: 1264 # stop("nonexistent groups requested in 'subset'") # nlme/R/lmList.R: 1269 # stop("nonexistent groups requested in 'subset'") msgid "nonexistent groups requested in 'subset'" msgstr "zażądano nieistniejących grup w argumencie 'subset'" # nlme/R/lmList.R: 240 # stop("'subset' can only be character or integer") # nlme/R/lmList.R: 1272 # stop("'subset' can only be character or integer") msgid "'subset' can only be character or integer" msgstr "argument 'subset' może być jedynie znakiem lub liczbą całkowitą" # nlme/R/lmList.R: 345 # stop("log-likelihood not available with NULL fits") msgid "log-likelihood not available with NULL fits" msgstr "logarytm funkcji wiarygodności nie jest dostępny z dopasowaniami NULL" msgid "'form' must be a formula" msgstr "argument 'form' nie jest obiektem klasy \"formula\"" msgid "'form' must be a one-sided formula" msgstr "argument 'form' musi być jednostronną formułą" # nlme/R/lme.R: 1462 # stop("covariate must be a data frame") # nlme/R/lmList.R: 422 # stop("covariate must be a data frame") msgid "covariate must be a data frame" msgstr "zmienna niezależna musi być ramką danych" # nlme/R/lme.R: 1473 # stop("cannot do pairs of just one variable") # nlme/R/lmList.R: 432 # stop("cannot do pairs of just one variable") msgid "cannot do pairs of just one variable" msgstr "nie można zrobić par tylko jednej zmiennej" msgid "'id' must be between 0 and 1" msgstr "argument 'id' musi być pomiędzy 0 a 1" msgid "'id' can only be a formula or numeric" msgstr "argument 'id' może być jedynie formułą lub liczbą" msgid "'idLabels' of incorrect length" msgstr "argument 'IdLabels' ma niepoprawną długość" msgid "'idLabels' can only be a formula or a vector" msgstr "argument 'IdLabels' może być jedynie formułą lub wektorem" # nlme/R/newMethods.R: 317 # stop("covariate must be numeric") # nlme/R/lmList.R: 696 # stop("covariate must be numeric") msgid "covariate must be numeric" msgstr "zmienna niezależna musi być liczbą" # nlme/R/lmList.R: 861 # stop("nonexistent group in 'newdata'") msgid "nonexistent group in 'newdata'" msgstr "nieistniejąca grupa w 'newdata'" # nlme/R/lmList.R: 870 # stop("nonexistent group requested in 'subset'") msgid "nonexistent group requested in 'subset'" msgstr "zażądano nieistniejącej grupy w 'subset'." # nlme/R/lme.R: 2279 # stop("only residuals and random effects allowed") # nlme/R/lmList.R: 1072 # stop("only residuals and random effects allowed") msgid "only residuals and random effects allowed" msgstr "tylko reszty oraz efekty losowe są dozwolone" # nlme/R/nlme.R: 90 # stop("can only fit \"nlsList\" objects with single grouping variable") msgid "can only fit \"lmList\" objects with single grouping variable" msgstr "" "można dopasować jedynie obiekty klasy \"lmList\" z pojedynczą zmienną " "grupującą" # nlme/R/lme.R: 72 # warning("'lme.lmList()' will redefine 'data' argument") msgid "'lme.lmList' will redefine 'data'" msgstr "funkcja 'lme.lmList()' przedefiniuje argument 'data'" # nlme/R/lme.R: 112 # warning("initial value for \"reStruct\" overwritten in 'lme.lmList()'") msgid "initial value for \"reStruct\" overwritten in 'lme.lmList'" msgstr "" "początkowa wartość dla \"reStruct\" została nadpisana w funkcji 'lme." "lmList()'" # nlme/R/simulate.R: 26 # stop("fixed-effects model must be a formula of the form \"resp ~ pred\"") # nlme/R/lme.R: 155 # stop("fixed-effects model must be a formula of the form \"resp ~ pred\"") msgid "fixed-effects model must be a formula of the form \"resp ~ pred\"" msgstr "" "model stałych efektów musi być formułą o formie \"zmienna zależna ~ zmienna " "niezależna\"" # nlme/R/simulate.R: 39 # stop("incompatible lengths for 'random' and grouping factors") # nlme/R/nlme.R: 206 # stop("incompatible lengths for 'random' and grouping factors") # nlme/R/lme.R: 168 # stop("incompatible lengths for 'random' and grouping factors") msgid "incompatible lengths for 'random' and grouping factors" msgstr "niespójne długości dla 'random' oraz czynników grupujących" msgid "incompatible formulas for groups in 'random' and 'correlation'" msgstr "niespójne formuły dla grup w 'random' oraz 'correlation'" # nlme/R/lme.R: 199 # warning("cannot use smaller level of grouping for 'correlation' than for 'random'. Replacing the former with the latter.") msgid "" "cannot use smaller level of grouping for 'correlation' than for 'random'. " "Replacing the former with the latter." msgstr "" "nie można użyć mniejszego poziomu grupowania dla 'correlation' niż dla " "'random'. Zastępowanie pierwszego drugim." # nlme/R/nlme.R: 559 # warning(gettextf("fewer observations than random effects in all level %s groups", Q), domain = "R-nlme") # nlme/R/lme.R: 292 # warning(gettextf("fewer observations than random effects in all level %s groups", Q), domain = "R-nlme") msgid "fewer observations than random effects in all level %s groups" msgstr "" "mniej obserwacji niż losowych efektów we wszystkich grupach w poziomie %s" # nlme/R/lme.R: 342 # gettextf("%s problem, convergence error code = %s\n message = %s", controlvals$opt, optRes$convergence, paste(optRes$message, collapse = "")) msgid "" "%s problem, convergence error code = %s\n" " message = %s" msgstr "" "problem %s, kod błędu zbieżności = %s\n" " komunikat = %s" # nlme/R/lme.R: 368 # gettext("maximum number of iterations (lmeControl(maxIter)) reached without convergence") msgid "" "maximum number of iterations (lmeControl(maxIter)) reached without " "convergence" msgstr "" "maksymalna liczba iteracji ('lmeControl(maxIter)') została osiągnięta bez " "uzyskania zbieżności" msgid "object must inherit from class \"lme\"" msgstr "argument 'object' nie jest obiektem klasy \"lme\"" # nlme/R/lme.R: 907 # stop("terms must all have the same denominator DF") msgid "terms must all have the same denominator DF" msgstr "wszystkie człony muszą mieć ten sam mianownik DF" # nlme/R/lme.R: 950 # stop("L may only involve fixed effects with the same denominator DF") msgid "L may only involve fixed effects with the same denominator DF" msgstr "" "'L' może zawierać jedynie stałe efekty z tą samą liczbą stopni swobody " "mianownika" #, fuzzy msgid "objects must inherit from classes %s, or %s" msgstr "argument 'object' nie jest obiektem klasy \"gls\"" # nlme/R/lme.R: 988 # warning("some fitted objects deleted because response differs from the first model") msgid "" "some fitted objects deleted because response differs from the first model" msgstr "" "niektóre dopasowane obiekty zostały usunięte ponieważ zmienne zależne różnią " "się od pierwszego modelu" # nlme/R/lme.R: 990 # stop("first model has a different response from the rest") msgid "first model has a different response from the rest" msgstr "pierwszy model ma inną zmienną zależną od reszty" # nlme/R/lme.R: 1002 # stop("all fitted objects must have the same estimation method") msgid "all fitted objects must have the same estimation method" msgstr "wszystkie dopasowane obiekty muszą mieć tę samą metodę oszacowania" # nlme/R/lme.R: 1019 # warning("fitted objects with different fixed effects. REML comparisons are not meaningful.") #, fuzzy msgid "" "fitted objects with different fixed effects. REML comparisons are not " "meaningful." msgstr "dopasowane obiekty z różnymi stałymi efektami." # nlme/R/lme.R: 1026 # stop("objects must have a \"call\" component or attribute") msgid "objects must have a \"call\" component or attribute" msgstr "obiekty muszą mieć komponent 'call' lub atrybut" # nlme/R/lme.R: 1036 # stop("all fitted objects must use the same number of observations") msgid "all fitted objects must use the same number of observations" msgstr "wszystkie dopasowane obiekty muszą używać tej samej liczby obserwacji" # nlme/R/lme.R: 1159 # stop("only single level allowed") # nlme/R/lme.R: 1655 # stop("only single level allowed") msgid "only single level allowed" msgstr "jedynie pojedynczy poziom jest dozwolony" # nlme/R/gls.R: 772 # stop(gettextf("cannot get confidence intervals on var-cov components: %s", aV), domain = "R-nlme") # nlme/R/lme.R: 1302 # stop(gettextf("cannot get confidence intervals on var-cov components: %s", aV), domain = "R-nlme") #, fuzzy msgid "" "cannot get confidence intervals on var-cov components: %s\n" " Consider '%s'" msgstr "nie można uzyskać przedziałów ufności na komponentach var-cov: %s" # nlme/R/lme.R: 1519 # stop("covariate must have a level attribute when groups are present") msgid "covariate must have a level attribute when groups are present" msgstr "zmienna niezależna musi mieć atrybut poziomu, gdy grupy są obecne" msgid "covariate must have a level attribute when 'id' is a formula" msgstr "" "zmienna niezależna musi mieć atrybut poziomu, gdy argument 'id' jest formułą" msgid "covariate must have a level attribute when 'idLabels' is a formula" msgstr "" "zmienna niezależna musi mieć atrybut poziomu, gdy 'idLabels' jest formułą" # nlme/R/lme.R: 1728 # stop(gettextf("'%s' argument must be a formula when not NULL", "form")) msgid "'form' must be a formula when not NULL" msgstr "argument 'form' musi być formułą, gdy nie jest wartością NULL" # nlme/R/lme.R: 1734 # stop("only single effects allowed in left side of 'form'") msgid "only single effects allowed in left side of 'form'" msgstr "tylko pojedynczy efekt jest dozwolony po lewej stronie 'form'" # nlme/R/lme.R: 1738 # stop(gettextf("%s is not a valid effect name", sQuote(reName)), domain = "R-nlme") msgid "%s is not a valid effect name" msgstr "%s nie jest poprawną nazwą efektu" # nlme/R/lme.R: 1742 # stop("no effects allowed in right side of formula") msgid "no effects allowed in right side of formula" msgstr "nie są dozwolone żadne efekty po prawej stronie fomuły" # nlme/R/nlme.R: 1109 # stop("cannot evaluate groups for desired levels on 'newdata'") # nlme/R/lme.R: 1872 # stop("cannot evaluate groups for desired levels on 'newdata'") msgid "cannot evaluate groups for desired levels on 'newdata'" msgstr "nie można wyznaczyć grup dla pożądanych poziomów w 'newdata'" msgid "'Id' must be between 0 and 1" msgstr "argument 'id' musi być pomiędzy 0 a 1" # nlme/R/lme.R: 2469 # stop("augmentation of random effects only available for single level") msgid "augmentation of random effects only available for single level" msgstr "" "rozszerzenie efektów losowych dostępne jedynie dla pojedynczego poziomu" # nlme/R/lme.R: 2831 # stop("no condensed linear model") msgid "no condensed linear model" msgstr "brak skondensowanego modelu liniowego" # nlme/R/lme.R: 2834 # stop("no fitted \"lme\" object") msgid "no fitted \"lme\" object" msgstr "brak dopasowanego obiektu \"lme\"" # nlme/R/newFunc.R: 83 # stop("objects must have coefficients with same row names") msgid "objects must have coefficients with same row names" msgstr "obiekty muszą mieć współczynniki z tymi samymi nazwami wierszy" msgid "object must inherit from \"data.frame\"" msgstr "obiekt musi dziedziczyć z klasy \"data.frame\"" msgid "only one level allowed in 'gapply'" msgstr "tylko jeden poziom jest dozwolony w funkcji 'gapply()'" msgid "'which' must be between 1 and %d" msgstr "argument 'which' musi być pomiędzy 1 a %d" msgid "'which' can only be character or integer" msgstr "argument 'which' może być jedynie tekstem lub liczbą całkowitą" msgid "formula(object) must return a formula" msgstr "'formuła(obiekt)' musi zwracać formułę" msgid "'form' must be a two-sided formula" msgstr "argument 'form' musi być dwustronną formułą" msgid "only one level allowed in 'gsummary'" msgstr "tylko jeden poziom jest dostępny w funkcji 'gsummary()'" # nlme/R/newFunc.R: 253 # stop("'FUN' can only be a function or a list of functions") msgid "'FUN' can only be a function or a list of functions" msgstr "argument 'FUN' może być jedynie funkcją lub listą funkcji" # nlme/R/newFunc.R: 282 # stop("cannot omit grouping factor without 'form'") msgid "cannot omit grouping factor without 'form'" msgstr "nie można pominąć czynnika grupującego bez 'form'" msgid "object must inherit from class \"lmList\"" msgstr "argument nie jest obiektem klasy \"lmList\"" # nlme/R/newFunc.R: 313 # stop("no degrees of freedom for estimating standard deviation") msgid "no degrees of freedom for estimating std. dev." msgstr "brak stopni swobody na potrzeby oszacowania odchylenia standardowego" # nlme/R/newMethods.R: 52 # stop("'data' argument passed to \"data.frame\" method for 'getGroups()' does not make sense") msgid "" "data argument to \"data.frame\" method for 'getGroups' does not make sense" msgstr "" "argument danych przekazywany do metody 'data.frame()' dla 'getGroups()' nie " "ma sensu" # nlme/R/newMethods.R: 66 # stop("invalid formula for groups") msgid "invalid formula for groups" msgstr "niepoprawna formuła dla grup" # nlme/R/newMethods.R: 71 # stop("'form' must have all components as formulas") msgid "'form' must have all components as formulas" msgstr "" "argument 'form' musi mieć wszystkie komponenty przedstawione jako formuły" msgid "'form' can only be a formula, or a list of formulas" msgstr "argument 'form' może być jedynie formułą lub listą formuł" # nlme/R/newMethods.R: 92 # stop(gettextf("level of %s does not match formula %s", level[aux], sQuote(deparse(form))), domain = "R-nlme") # nlme/R/newMethods.R: 97 # stop(gettextf("level of %s does not match formula %s", level[aux], sQuote(deparse(form))), domain = "R-nlme") msgid "level of %s does not match formula %s" msgstr "poziom %s nie zgadza się z formułą %s" # nlme/R/reStruct.R: 66 # stop(gettextf("'%s' argument must have a formula", "object")) # nlme/R/reStruct.R: 84 # stop(gettextf("'%s' argument must have a formula", "object")) msgid "'form' argument must be a formula" msgstr "argument 'form' musi być formułą" # nlme/R/newMethods.R: 209 # stop("at least two coefficients are needed") msgid "at least two coefficients are needed" msgstr "przynajmniej dwa współczynniki są potrzebne" # nlme/R/newMethods.R: 619 # stop("no model variogram available with 'showModel = TRUE'") msgid "no model variogram available with 'showModel = TRUE'" msgstr "brak dostępnego modelu wariogramu w 'showModel = TRUE'" # nlme/R/newMethods.R: 730 # stop("only residuals allowed") msgid "only residuals allowed" msgstr "jedynie reszty są dozwolone" msgid "'distance' and 'object' have incompatible lengths" msgstr "argumenty 'distance' oraz 'object' mają niespójne długości" # nlme/R/nlme.R: 63 # warning("'nlme.nlsList' will redefine 'fixed', 'data', and 'start'") msgid "'nlme.nlsList' will redefine 'fixed', 'data', and 'start'" msgstr "" "funkcja 'nlme.nlsList()' ponownie przedefiniuje argumenty 'fixed', 'data' " "oraz 'start'" # nlme/R/nlme.R: 90 # stop("can only fit \"nlsList\" objects with single grouping variable") msgid "can only fit \"nlsList\" objects with single grouping variable" msgstr "" "można dopasować jedynie obiekty klasy \"nlsList\" z pojedynczą zmienną " "grupującą" # nlme/R/nlme.R: 122 # warning("initial value for 'reStruct' overwritten in 'nlme.nlsList'") msgid "initial value for 'reStruct' overwritten in 'nlme.nlsList'" msgstr "początkowa wartość dla 'reStruct' nadpisana w funkcji 'nlme.nlsList()'" msgid "'model' must be a formula" msgstr "argument 'model' musi być formułą" # nlme/R/gnls.R: 73 # stop("model formula must be of the form \"resp ~ pred\"") # nlme/R/nlme.R: 188 # stop("model formula must be of the form \"resp ~ pred\"") msgid "model formula must be of the form \"resp ~ pred\"" msgstr "" "formuła modelu musi mieć formę \"zmienna zależna ~ zmienna niezależna\"" # nlme/R/nlme.R: 239 # stop("'data' must be given explicitly to use 'nlsList'") msgid "'data' must be given explicitly to use 'nlsList'" msgstr "" "argument 'data' musi być podane bezpośrednio aby użyć funkcji 'nlsList()'" msgid "'fixed' must be a formula or list of formulae" msgstr "argument 'fixed' musi być formułą lub listą formuł" msgid "formulae in 'fixed' must be of the form \"parameter ~ expr\"" msgstr "" "formuły w argumencie 'fixed' muszą mieć formę \"parametr ~ wyrażenie\"." msgid "'random' must be a formula or list of formulae" msgstr "argument 'random' musi być formułą lub listą formuł" msgid "formulae in 'random' must be of the form \"parameter ~ expr\"" msgstr "" "formuły w argumencie 'random' muszą mieć formę \"parametr ~ wyrażenie\"" # nlme/R/nlme.R: 329 # stop("incompatible formulas for groups in \"random\" and \"correlation\"") # nlme/R/nlme.R: 340 # stop("incompatible formulas for groups in \"random\" and \"correlation\"") # nlme/R/lme.R: 196 # stop("incompatible formulas for groups in \"random\" and \"correlation\"") # nlme/R/lme.R: 207 # stop("incompatible formulas for groups in \"random\" and \"correlation\"") msgid "incompatible formulas for groups in \"random\" and \"correlation\"" msgstr "niespójne formuły dla grup w \"random\" oraz \"correlation\"" # nlme/R/nlme.R: 332 # warning("cannot use smaller level of grouping for \"correlation\" than for \"random\". Replacing the former with the latter.") msgid "" "cannot use smaller level of grouping for \"correlation\" than for \"random" "\". Replacing the former with the latter." msgstr "" "nie można użyć mniejszego poziomu grupowania dla \"correlation\" niż dla " "\"random\". Zastępowanie pierwszego drugim." # nlme/R/nlme.R: 481 # stop ("'start' must have a component called 'fixed'") msgid "'start' must have a component called 'fixed'" msgstr "argument 'start' musi mieć komponent o nazwie 'fixed'" # nlme/R/nlme.R: 521 # stop ("starting values for the 'fixed' component are not the correct length") msgid "starting values for the 'fixed' component are not the correct length" msgstr "początkowe wartości dla komponentu 'fixed' nie mają poprawnej długości" # nlme/R/nlme.R: 569 # stop("starting values for random effects should be a list, or a matrix") msgid "starting values for random effects should be a list, or a matrix" msgstr "" "początkowe wartości dla efektów losowych powinny być listą lub macierzą" # nlme/R/nlme.R: 576 # stop(gettextf("list with starting values for random effects must have names or be of length %d", Q), domain = "R-nlme") msgid "" "list with starting values for random effects must have names or be of length " "%d" msgstr "" "lista z początkowymi wartościami dla efektów losowych musi zawierać nazwy " "lub być długości %d" # nlme/R/nlme.R: 594 # stop("starting values for the random components should be a list of matrices") msgid "starting values for the random components should be a list of matrices" msgstr "" "wartości początkowe dla losowych komponentów powinny być listą macierzy" # nlme/R/nlme.R: 597 # stop(gettextf("number of rows in starting values for random component at level %s should be %d", namGrp[i], Dims$ngrps[i]), domain = "R-nlme") msgid "" "number of rows in starting values for random component at level %s should be " "%d" msgstr "" "liczba wierszy w wartościach początkowych dla losowego komponentu na " "poziomie %s powinna wynosić %d" # nlme/R/nlme.R: 600 # stop(gettextf("number of columns in starting values for random component at level %s should be %d", namGrp[i], rlength[i]), domain = "R-nlme") msgid "" "number of columns in starting values for random component at level %s should " "be %d" msgstr "" "liczba kolumn w wartościach początkowych dla losowego komponentu na poziomie " "%s powinna wynosić %d" # nlme/R/nlme.R: 604 # stop("starting values for random effects must include group levels") msgid "starting values for random effects must include group levels" msgstr "" "wartości początkowe dla losowych efektów muszą zawierać w sobie poziomy grup" # nlme/R/nlme.R: 608 # stop(gettextf("groups levels mismatch in 'random' and starting values for 'random' at level %s", namGrp[i]), domain = "R-nlme") msgid "" "groups levels mismatch in 'random' and starting values for 'random' at level " "%s" msgstr "" "poziomy grup nie zgadzają się w 'random' oraz początkowych wartościach " "'random' na poziomie %s" # nlme/R/nlme.R: 626 # stop (gettextf("names mismatch in 'random' and starting values for 'random' at level %s", namGrp[i]), domain = "R-nlme") msgid "" "names mismatch in 'random' and starting values for 'random' at level %s" msgstr "" "nazwy nie zgadzają się w 'random' oraz początkowych wartościach dla 'random' " "na poziomie %s" msgid "Iteration %d, LME step: nlminb() did not converge (code = %d)." msgstr "" msgid "Do increase 'msMaxIter'!" msgstr "" msgid "PORT message:" msgstr "" msgid "Iteration %d, LME step: nlm() did not converge (code = %d)." msgstr "" # nlme/R/lme.R: 368 # gettext("maximum number of iterations (lmeControl(maxIter)) reached without convergence") #, fuzzy msgid "maximum number of iterations (maxIter = %d) reached without convergence" msgstr "" "maksymalna liczba iteracji ('lmeControl(maxIter)') została osiągnięta bez " "uzyskania zbieżności" # nlme/R/nlsList.R: 31 # stop("second argument must be a groupedData object") msgid "second argument must be a groupedData object" msgstr "drugi argument musi być obiektem \"groupedData\"" # nlme/R/nlsList.R: 35 # stop("cannot use an anonymous function for the model") msgid "cannot use an anonymous function for the model" msgstr "nie można użyć anonimowej funkcji dla modelu" # nlme/R/nlsList.R: 68 # stop("'data' must be a \"groupedData\" object if 'formula' does not include groups") msgid "" "'data' must be a \"groupedData\" object if 'formula' does not include groups" msgstr "" "argument 'data' musi być obiektem klasy \"groupedData\" jeśli argument " "'fomula' nie zawiera grup" # nlme/R/nlsList.R: 87 # stop("old-style self-starting model functions\nare no longer supported.\nNew selfStart functions are available.\nUse\n SSfpl instead of fpl,\n SSfol instead of first.order.log,\n SSbiexp instead of biexp,\n SSlogis instead of logistic.\nIf writing your own selfStart model, see\n \"help(selfStart)\"\nfor the new form of the \"initial\" attribute.", domain = "R-nlme") msgid "" "old-style self-starting model functions\n" "are no longer supported.\n" "New selfStart functions are available.\n" "Use\n" " SSfpl instead of fpl,\n" " SSfol instead of first.order.log,\n" " SSbiexp instead of biexp,\n" " SSlogis instead of logistic.\n" "If writing your own selfStart model, see\n" " \"help(selfStart)\"\n" "for the new form of the \"initial\" attribute." msgstr "" "samoinicjujące się funkcje modelu starego stylu nie są już dłużej wspierane\n" "Brak dostępnych funkcji 'selfStart'.\n" "Użyj\n" " 'SSfpl' zamiast 'fpl',\n" " 'SSfol' zamiast 'first.order.log',\n" " 'SSbiexp' zamiast 'biexp',\n" " 'SSlogis' zamiast 'logistic'.\n" "Jeśli piszesz swój własny model 'selfStart', zobacz\n" " 'help(selfStart)'\n" "aby uzyskać informację o nowej formie atrybutu 'initial'." # nlme/R/nlsList.R: 148 # stop("missing call attribute in \"nlsList\" object") msgid "missing call attribute in \"nlsList\" object" msgstr "brakuje wywoływanego atrybutu w obiekcie klasy \"nlsList\"" # nlme/R/reStruct.R: 153 # stop("cannot access the matrix of uninitialized objects") # nlme/R/reStruct.R: 168 # stop("cannot access the matrix of uninitialized objects") # nlme/R/pdMat.R: 53 # stop("cannot access the matrix of uninitialized objects") # nlme/R/pdMat.R: 226 # stop("cannot access the matrix of uninitialized objects") # nlme/R/pdMat.R: 1699 # stop("cannot access the matrix of uninitialized objects") # nlme/R/pdMat.R: 1938 # stop("cannot access the matrix of uninitialized objects") msgid "cannot access the matrix of uninitialized objects" msgstr "nie można uzyskać dostępu do macierzy niezainicjalizowanych obiektów" msgid "ignoring argument 'form'" msgstr "ignorowanie argumentu 'form'" msgid "ignoring argument 'nam'" msgstr "ignorowanie argumentu 'nam'" # nlme/R/pdMat.R: 104 # stop("'value' must be a square matrix") msgid "'value' must be a square matrix" msgstr "argument 'value' musi być kwadratową macierzą" # nlme/R/pdMat.R: 109 # stop("dimnames of 'value' must match or be NULL") msgid "dimnames of 'value' must match or be NULL" msgstr "" "nazwy wymiarów argumentu 'value' muszą się zgadzać lub być wartością NULL" # nlme/R/pdMat.R: 114 # stop("names of 'value' are not consistent with 'nam' argument") msgid "names of 'value' are not consistent with 'nam' argument" msgstr "nazwy argumentu 'value' nie są spójne z argumentem 'nam'" # nlme/R/pdMat.R: 137 # stop(gettextf("%s is not a valid object for \"pdMat\"", sQuote(deparse(object))), domain = "R-nlme") msgid "%s is not a valid object for \"pdMat\"" msgstr "%s nie jest poprawnym obiektem dla klasy \"pdMat\"" # nlme/R/pdMat.R: 150 # stop("all elements of 'form' list must be two-sided formulas") msgid "all elements of 'form' list must be two-sided formulas" msgstr "wszystkie elementy listy 'form' muszą być dwustronnymi formułami" msgid "'form' can only be a formula or a list of formulae" msgstr "argument 'form' może być jedynie formułą lub listą formuł" # nlme/R/pdMat.R: 200 # stop("'form' not consistent with 'nam'") msgid "'form' not consistent with 'nam'" msgstr "argument 'form' nie jest spójny z argumentem 'nam'" # nlme/R/pdMat.R: 208 # stop("length of 'nam' not consistent with dimensions of initial value") msgid "length of 'nam' not consistent with dimensions of initial value" msgstr "" "długość argumentu 'nam' nie jest spójna z wymiarami początkowej wartości" # nlme/R/pdMat.R: 229 # stop("no default method for extracting the square root of a \"pdMat\" object") msgid "no default method for extracting the square root of a \"pdMat\" object" msgstr "" "brak domyślnej metody dla uzyskania pierwiastka z obiektu klasy \"pdMat\"" # nlme/R/pdMat.R: 246 # stop("do not know how to obtain constrained coefficients") msgid "do not know how to obtain constrained coefficients" msgstr "nie wiadomo jak uzyskać ograniczone współczynniki" # nlme/R/pdMat.R: 274 # stop("cannot access the number of columns of uninitialized objects without names") msgid "" "cannot access the number of columns of uninitialized objects without names" msgstr "" "nie można uzyskać liczby kolumn niezainicjalizowanych obiektów bez nazw" # nlme/R/pdMat.R: 290 # stop("cannot extract the log of the determinant from an uninitialized object") # nlme/R/pdMat.R: 678 # stop("cannot extract the log of the determinant from an uninitialized object") # nlme/R/pdMat.R: 1210 # stop("cannot extract the log of the determinant from an uninitialized object") # nlme/R/pdMat.R: 1360 # stop("cannot extract the log of the determinant from an uninitialized object") msgid "cannot extract the log of the determinant from an uninitialized object" msgstr "" "nie można wyodrębnić logarytmu macierzy z niezainicjalizowanego obiektu" # nlme/R/pdMat.R: 301 # stop("cannot change dimensions on an initialized \"pdMat\" object") msgid "cannot change dimensions on an initialized \"pdMat\" object" msgstr "nie można zmienić wymiarów zainicjalizowanego obiektu klasy \"pdMat\"" # nlme/R/pdMat.R: 323 # stop(gettextf("Length of names should be %d", aux), domain = "R-nlme") # nlme/R/pdMat.R: 330 # stop(gettextf("Length of names should be %d", length(dn)), domain = "R-nlme") msgid "Length of names should be %d" msgstr "Długość nazw powinna wynosić %d" # nlme/R/pdMat.R: 368 # stop("names being assigned do not correspond to a permutation of previous names") msgid "" "names being assigned do not correspond to a permutation of previous names" msgstr "przypisane nazwy nie odpowiadają permutacji poprzednich nazw" # nlme/R/pdMat.R: 419 # stop("x-y data passed to 'splom()' function got botched somehow") msgid "x-y data to splom got botched somehow" msgstr "dane x-y przekazywane do funkcji 'splom()' zostały jakoś uszkodzone" # nlme/R/pdMat.R: 526 # stop("cannot get the inverse of an uninitialized object") # nlme/R/pdMat.R: 759 # stop("cannot get the inverse of an uninitialized object") # nlme/R/pdMat.R: 843 # stop("cannot get the inverse of an uninitialized object") # nlme/R/pdMat.R: 1220 # stop("cannot get the inverse of an uninitialized object") # nlme/R/pdMat.R: 2084 # stop("cannot get the inverse of an uninitialized object") msgid "cannot get the inverse of an uninitialized object" msgstr "nie można uzyskać odwrotności niezainicjalizowanego obiektu" # nlme/R/pdMat.R: 612 # stop(gettextf("an object of length %d does not match the required parameter size", length(val)), domain = "R-nlme") # nlme/R/pdMat.R: 1142 # stop(gettextf("an object of length %d does not match the required parameter size", length(val)), domain = "R-nlme") # nlme/R/pdMat.R: 1303 # stop(gettextf("an object of length %d does not match the required parameter size", length(val)), domain = "R-nlme") # nlme/R/pdMat.R: 1443 # stop(gettextf("an object of length %d does not match the required parameter size", length(val)), domain = "R-nlme") # nlme/R/pdMat.R: 1593 # stop(gettextf("an object of length %d does not match the required parameter size", length(val)), domain = "R-nlme") msgid "an object of length %d does not match the required parameter size" msgstr "obiekt o długości %d nie zgadza się z wymaganym rozmiarem parametru" # nlme/R/pdMat.R: 632 # stop("cannot extract matrix from an uninitialized object") # nlme/R/pdMat.R: 1162 # stop("cannot extract matrix from an uninitialized object") msgid "cannot extract matrix from an uninitialized object" msgstr "nie można wyodrębnić macierzy z niezainicjalizowanego obiektu" # nlme/R/pdMat.R: 687 # stop("cannot extract the inverse from an uninitialized object") # nlme/R/pdMat.R: 991 # stop("cannot extract the inverse from an uninitialized object") # nlme/R/pdMat.R: 1369 # stop("cannot extract the inverse from an uninitialized object") # nlme/R/pdMat.R: 1510 # stop("cannot extract the inverse from an uninitialized object") msgid "cannot extract the inverse from an uninitialized object" msgstr "nie można wyodrębnić odwrotności z niezainicjalizowanego obiektu" # nlme/R/pdMat.R: 737 # stop(gettextf("an object of length %d does not match a Cholesky factor", length(val)), domain = "R-nlme") msgid "an object of length %d does not match a Cholesky factor" msgstr "obiekt o długości %d nie zgadza się z czynnikiem Cholesky'ego" # nlme/R/pdMat.R: 1319 # stop("cannot extract the matrix from an uninitialized object") msgid "cannot extract the matrix from an uninitialized object" msgstr "nie można wyodrębnić macierzy z niezainicjalizowanego obiektu" # nlme/R/pdMat.R: 1403 # stop("cannot extract the matrix from an uninitialized \"pdIdent\" object") # nlme/R/pdMat.R: 1464 # stop("cannot extract the matrix from an uninitialized \"pdIdent\" object") msgid "cannot extract the matrix from an uninitialized \"pdIdent\" object" msgstr "" "nie można wyodrębnić macierzy z niezainicjalizowanego obiektu klasy \"pdIdent" "\"" # nlme/R/pdMat.R: 1406 # stop("cannot extract the matrix with uninitialized dimensions") # nlme/R/pdMat.R: 1467 # stop("cannot extract the matrix with uninitialized dimensions") # nlme/R/pdMat.R: 1544 # stop("cannot extract the matrix with uninitialized dimensions") # nlme/R/pdMat.R: 1620 # stop("cannot extract the matrix with uninitialized dimensions") msgid "cannot extract the matrix with uninitialized dimensions" msgstr "nie można wyodrębnić macierzy z niezainicjalizowanymi wymiarami" # nlme/R/pdMat.R: 1446 # stop(gettextf("must give names when initializing %s from parameter without a formula", dQuote("pdIdent"))) # nlme/R/pdMat.R: 1596 # stop(gettextf("must give names when initializing %s from parameter without a formula", dQuote("pdCompSymm"))) msgid "" "must give names when initializing \"pdIdent\" from parameter without a " "formula" msgstr "" "nazwy są wymagane gdy występuje inicjalizowanie obiektu klasy \"pdIdent\" z " "parametru bez formuły" # nlme/R/pdMat.R: 1496 # stop("cannot extract the dimensions") # nlme/R/pdMat.R: 1663 # stop("cannot extract the dimensions") msgid "cannot extract the dimensions" msgstr "nie można wyodrębnić wymiarów" # nlme/R/pdMat.R: 1541 # stop("cannot extract the matrix from an uninitialized \"pdCompSymm\" object") # nlme/R/pdMat.R: 1617 # stop("cannot extract the matrix from an uninitialized \"pdCompSymm\" object") msgid "cannot extract the matrix from an uninitialized \"pdCompSymm\" object" msgstr "" "nie można wyodrębnić macierzy z niezainicjalizowanego obiektu klasy " "\"pdCompSymm\"" # nlme/R/pdMat.R: 1584 # warning("initializing \"pdCompSymm\" object is not positive definite") msgid "initializing \"pdCompSymm\" object is not positive definite" msgstr "inicjalizowany obiekt klasy \"pdCompSymm\" nie jest dodatnio określony" msgid "" "must give names when initializing \"pdCompSymm\" from parameter without a " "formula" msgstr "" "nazwy są wymagane podczas inicjalizowania obiektu klasy \"pdCompSymm\" z " "parametru bez formuły" # nlme/R/pdMat.R: 1647 # stop("cannot obtain constrained coefficients with uninitialized dimensions") msgid "cannot obtain constrained coefficients with uninitialized dimensions" msgstr "" "nie można uzyskać ograniczonych współczynników z niezainicjalizowanych " "wymiarów" # nlme/R/pdMat.R: 1702 # stop("cannot access the matrix of object without names") # nlme/R/pdMat.R: 1941 # stop("cannot access the matrix of object without names") msgid "cannot access the matrix of object without names" msgstr "nie można uzyskać dostępu do macierzy obiektu bez nazw" msgid "'form' must be a list" msgstr "argument 'form' musi być listą" msgid "'nam' must be a list" msgstr "argument 'nam' musi być listą" msgid "'form' and 'nam' have incompatible lengths" msgstr "argumenty 'form' oraz 'nam' mają niezgodne długości" # nlme/R/pdMat.R: 1761 # stop(gettextf("'%s' argument must be a character vector", "pdClass")) msgid "'pdClass' must be a character vector" msgstr "argument 'pdClass' musi być wektorem tekstowym" msgid "'form' and 'pdClass' have incompatible lengths" msgstr "argumenty 'form' oraz 'pdClass' mają niezgodne długości" msgid "'nam' and 'pdClass' have incompatible lengths" msgstr "argumenty 'nam' oraz 'pdClass' mają niezgodne długości" # nlme/R/pdMat.R: 1781 # stop("LNone of the arguments specify more than one block") msgid "LNone of the arguments specify more than one block" msgstr "żaden z argumentów nie określa więcej niż jednego bloku" # nlme/R/pdMat.R: 1787 # stop("'object' must be a list when not missing, not a matrix, and not numeric") msgid "'object' must be a list when not missing, not a matrix, and not numeric" msgstr "" "argument 'object' musi być listą, gdy nie jest brakujący, nie jest macierzą, " "ani też liczbą" # nlme/R/pdMat.R: 1791 # stop("arguments imply different number of blocks") msgid "arguments imply different number of blocks" msgstr "argumenty sugerują różną liczbę bloków" # nlme/R/pdMat.R: 1863 # stop("all elements in the argument must generate \"pdMat\" objects") msgid "all elements in the argument must generate \"pdMat\" objects" msgstr "wszystkie elementy w argumencie muszą tworzyć obiekty klasy \"pdMat\"" # nlme/R/pdMat.R: 1886 # stop("cannot have duplicated column names in a \"pdMat\" object") # nlme/R/pdMat.R: 1905 # stop("cannot have duplicated column names in a \"pdMat\" object") msgid "cannot have duplicated column names in a \"pdMat\" object" msgstr "nie można mieć powtórzonych nazw kolumn w obiekcie klasy \"pdMat\"" # nlme/R/pdMat.R: 1892 # stop("must have formula when no names are given") msgid "must have formula when no names are given" msgstr "formuła jest wymagana, gdy nie podano nazw" # nlme/R/pdMat.R: 1895 # stop("must give names when initializing from matrix or parameter") msgid "must give names when initializing from matrix or parameter" msgstr "nazwy są wymagane, gdy następuje inicjowanie z macierzy lub parametru" # nlme/R/pdMat.R: 1900 # stop("all elements must have names when any has names") msgid "all elements must have names when any has names" msgstr "wszystkie elementy muszą mieć nazwy, gdy którykolwiek posiada" # nlme/R/pdMat.R: 1917 # stop("all elements must have a non-zero size") msgid "all elements must have a non-zero size" msgstr "wszystkie elementy muszą mieć niezerowy rozmiar" # nlme/R/reStruct.R: 188 # stop("cannot change the parameter when length of parameters is undefined") # nlme/R/pdMat.R: 1970 # stop("cannot change the parameter when length of parameters is undefined") msgid "cannot change the parameter when length of parameters is undefined" msgstr "nie można zmienić parametru gdy długość parametru jest nieokreślona" msgid "cannot change parameter length of initialized \"pdMat\" object" msgstr "" "nie można zmienić długości parametru zainicjowanego obiektu klasy \"pdMat\"" # nlme/R/pdMat.R: 1990 # stop("all elements must have formulas when any has a formula") msgid "all elements must have formulas when any has a formula" msgstr "wszystkie elementy muszą mieć formułę, gdy którykolwiek posiada" # nlme/R/pdMat.R: 2008 # stop("all elements of formula must be list of two-sided formulae or two-sided formulae") msgid "" "all elements of formula must be list of two-sided formulae or two-sided " "formulae" msgstr "" "wszystkie elementy formuły muszą być listą dwustronnych formuł lub " "dwustronnymi formułami" # nlme/R/pdMat.R: 2040 # stop("cannot change the number of columns on an initialized object") msgid "cannot change the number of columns on an initialized object" msgstr "nie można zmienić liczby kolumn zainicjowanego obiektu" # nlme/R/pdMat.R: 2047 # stop("names of object and value must match") msgid "names of object and value must match" msgstr "nazwy obiektu oraz wartości muszą się zgadzać" msgid "\"pdMat\" element must have a formula" msgstr "element \"pdMat\" musi posiadać formułę" msgid "'object' must be a list or a formula" msgstr "argument 'object' musi być listą lub formułą" msgid "\"pdMat\" elements must have a formula" msgstr "elementy \"pdMat\" muszą posiadać formułę" # nlme/R/reStruct.R: 101 # stop("elements in 'object' argument must be formulae or objects of class \"pdMat\"") msgid "elements in 'object' must be formulas or \"pdMat\" objects" msgstr "" "elementy w argumencie 'object' muszą być formułami lub obiektami klasy " "\"pdMat\"" msgid "cannot change the parameter when ength of parameters is undefined" msgstr "nie można zmienić parametru gdy długość parametru jest nieokreślona" msgid "cannot change parameter length of initialized objects" msgstr "nie można zmienić długości parametru zainicjowanych obiektów" # nlme/R/reStruct.R: 211 # stop("cannot extract groups formula without a formula") msgid "cannot extract groups formula without a formula" msgstr "nie można wyodrębnić formuł grup bez formuły" # nlme/R/reStruct.R: 252 # stop("all elements of an object of class \"reStruct\" must have a non-zero size") msgid "all elements of a \"reStruct\" object must have a non-zero size" msgstr "" "wszystkie elementy obiektu klasy \"reStruct\" muszą mieć niezerowy rozmiar" # nlme/R/reStruct.R: 302 # stop("cannot change the length of 'object' argument") msgid "cannot change the length of 'object'" msgstr "nie można zmienić długości argumentu 'object'" # nlme/R/reStruct.R: 315 # stop("cannot extract model matrix without formula") msgid "cannot extract model matrix without formula" msgstr "nie można wyodrębnić macierzy modelu bez formuły" # nlme/R/reStruct.R: 373 # stop("incompatible lengths for object names") msgid "incompatible lengths for object names" msgstr "niezgodne długości dla nazw obiektu" # nlme/R/simulate.R: 51 # stop("'data' must inherit from \"groupedData\" class if 'random' does not define groups") msgid "" "'data' must inherit from \"groupedData\" class if 'random' does not define " "groups" msgstr "" "argument 'data' musi być obiektem klasy \"groupedData\" jeśli argument " "'random' nie określa grup" # nlme/R/simulate.R: 162 # stop("models with \"corStruct\" and/or \"varFunc\" objects not allowed") # nlme/R/simulate.R: 227 # stop("models with \"corStruct\" and/or \"varFunc\" objects not allowed") msgid "models with \"corStruct\" and/or \"varFunc\" objects not allowed" msgstr "" "modele z obiektami klasy \"corStruct\" oraz/lub \"varFunc\" nie są dozwolone" # nlme/R/simulate.R: 367 # stop("no degrees of freedom specified") msgid "no degrees of freedom specified" msgstr "nie określono stopni swobody" # nlme/R/simulate.R: 356 # stop("plot method only implemented for comparing models") # nlme/R/simulate.R: 362 # stop("plot method only implemented for comparing models") msgid "plot method only implemented for comparing models" msgstr "" "metoda rysująca wykres została zaimplementowana jedynie do porównywania " "modeli" # nlme/R/simulate.R: 375 # stop("degrees of freedom and weights must have the same length") msgid "degrees of freedom and weights must have the same length" msgstr "stopnie swobody oraz wagi muszą mieć tę samą długość" # nlme/R/simulate.R: 383 # stop("negative degrees of freedom not allowed") msgid "negative degrees of freedom not allowed" msgstr "ujemne stopnie swobody nie są dozwolone" # nlme/R/simulate.R: 386 # stop("more than one degree of freedom is needed when one them is zero.") msgid "more than one degree of freedom is needed when one them is zero." msgstr "" "więcej niż jeden stopień swobody jest potrzebny jeśli jeden człon wynosi " "zero." # nlme/R/varFunc.R: 46 # stop("can only construct \"varFunc\" object from another \"varFunc\" object, a formula, or a character string") msgid "" "can only construct \"varFunc\" object from another \"varFunc\" object, a " "formula, or a character string" msgstr "" "można stworzyć jedynie obiekt klasy \"varFunc\" z innego obiektu klasy " "\"varFunc\", formuły lub łańcucha tekstowego" # nlme/R/varFunc.R: 64 # stop("cannot extract parameters of uninitialized object") msgid "cannot extract parameters of uninitialized object" msgstr "nie można wyodrębnić parametrów niezainicjowanego obiektu" # nlme/R/varFunc.R: 80 # stop(gettextf("do not know how to get coefficients for %s object", dQuote(class(object)[1])), domain = "R-nlme") msgid "do not know how to get coefficients for %s object" msgstr "nie wiadomo jak uzyskać współczynniki dla obiektu %s" # nlme/R/varFunc.R: 90 # stop("cannot change the length of covariate in \"varFunc\" object") msgid "cannot change the length of covariate in \"varFunc\" object" msgstr "" "nie można zmienić długości zmiennej niezależnej w obiekcie klasy \"varFunc\"" msgid "'value' must be a one sided formula" msgstr "argument 'value' musi być jednostronną formułą" # nlme/R/varFunc.R: 463 # stop("'form' must have a covariate") # nlme/R/varFunc.R: 676 # stop("'form' must have a covariate") # nlme/R/varFunc.R: 929 # stop("'form' must have a covariate") msgid "'form' must have a covariate" msgstr "argument 'form' musi posiadać zmienną niezależną" # nlme/R/varFunc.R: 206 # warning("ignoring 'group' in \"varFixed\" formula") msgid "ignoring 'group' in \"varFixed\" formula" msgstr "Ignorowanie 'group' w formule klasy \"varFixed\"" # nlme/R/varFunc.R: 228 # stop("all variables used in 'formula' must be in 'data'") msgid "all variables used in 'formula' must be in 'data'" msgstr "wszystkie zmienne użyte w 'formula' muszą być w 'data'" # nlme/R/varFunc.R: 266 # stop("initial values must have group names in 'varIdent'") msgid "initial values must have group names in 'varIdent'" msgstr "początkowe wartości muszą posiadać nazwy grupy w 'varIdent'" # nlme/R/varFunc.R: 270 # stop("initial values for 'varIdent' must be > 0") msgid "initial values for 'varIdent' must be > 0" msgstr "początkowe wartości dla 'varIdent' muszą być > 0" # nlme/R/varFunc.R: 278 # stop("fixed parameters must have names in 'varIdent'") msgid "fixed parameters must have names in 'varIdent'" msgstr "ustalone parametry muszą posiadać nazwy w 'varIdent'" msgid "" "cannot change the length of the \"varIdent\" parameter after initialization" msgstr "" "nie można zmienić długości parametru \"varIdent\" po jego zainicjowaniu" # nlme/R/varFunc.R: 364 # stop("fixed parameter names in 'varIdent' must be a subset of group names") msgid "fixed parameter names in 'varIdent' must be a subset of group names" msgstr "ustalone nazwy parametrów w 'varIdent' muszą być podzbiorem nazw grup" # nlme/R/varFunc.R: 372 # stop("cannot fix variances in all groups") msgid "cannot fix variances in all groups" msgstr "nie można ustalić wariancji we wszystkich grupach" msgid "initial value for \"varIdent\" should be of length %d" msgstr "początkowa wartość dla \"varIdent\" powinna być długości %d" # nlme/R/varFunc.R: 392 # stop("names of starting value for \"varIdent\" object must contain all but one of the stratum levels") msgid "" "names of starting value for \"varIdent\" object must contain all but one of " "the stratum levels" msgstr "" "nazwy wartości początkowych dla obiektu klasy \"varIdent\" muszą zawierać " "wszystkie oprócz jednego z poziomów warstwy" msgid "nonexistent group names for initial values in 'varIdent'" msgstr "nieistniejące nazwy grup dla początkowych wartości w 'varIdent'" # nlme/R/varFunc.R: 467 # stop("initial values must have group names in 'varPower'") msgid "initial values must have group names in 'varPower'" msgstr "początkowe wartości muszą posiadać nazwy grup w 'varPower'" msgid "fixed parameters must have group names in 'varPower'" msgstr "ustalone parametry muszą posiadać nazwy grup w 'varPower'" msgid "" "cannot change the length of the \"varStruct\" parameter after initialization" msgstr "" "nie można zmienić długości parametru \"varStruct\" po jego zainicjowaniu" # nlme/R/varFunc.R: 530 # stop("cannot change coefficients before initialization or when all parameters are fixed") # nlme/R/varFunc.R: 740 # stop("cannot change coefficients before initialization or when all parameters are fixed") # nlme/R/varFunc.R: 1015 # stop("cannot change coefficients before initialization or when all parameters are fixed") msgid "" "cannot change coefficients before initialization or when all parameters are " "fixed" msgstr "" "nie można zmienić współczynników przed zainicjowaniem lub gdy wszystkie " "parametry są ustalone" msgid "fixed parameters must have group names" msgstr "ustalone parametry muszą posiadać nazwy grup" # nlme/R/varFunc.R: 559 # stop("mismatch between group names and fixed values names") # nlme/R/varFunc.R: 769 # stop("mismatch between group names and fixed values names") # nlme/R/varFunc.R: 1048 # stop("mismatch between group names and fixed values names") msgid "mismatch between group names and fixed values names" msgstr "niezgodność pomiędzy nazwami grup oraz nazwami ustalonych wartości" msgid "initial value for \"varPower\" should be of length %d" msgstr "początkowa wartość dla \"varPower\" powinna być długości %d" msgid "nonexistent group names for initial values in \"varPower\"" msgstr "nieistniejące nazwy grup dla początkowych wartości w \"varPower\"" msgid "initial value for \"varPower\" should be of length 1" msgstr "początkowa wartość dla \"varPower\" powinna być długości 1" # nlme/R/varFunc.R: 680 # stop("initial values must have group names in 'varExp'") msgid "initial values must have group names in 'varExp'" msgstr "początkowe wartości muszą posiadać nazwy grupy w 'varExp'" msgid "fixed parameters must have group names in 'varExp'" msgstr "ustalone parametry muszą posiadać nazwy grup w 'varExp'" msgid "" "cannot change the length of the \"varExp\" parameter after initialization" msgstr "nie można zmienić długości parametru \"varExp\" po jego zainicjowaniu" msgid "initial value for \"varExp\" should be of length %d" msgstr "początkowa wartość dla \"varExp\" powinna być długości %d" msgid "nonexistent group names for initial values in \"varExp\"" msgstr "nieistniejące nazwy grup dla początkowych wartości w \"varExp\"" msgid "initial value for \"varExp\" should be of length 1" msgstr "początkowa wartość dla \"varExp\" powinna być długości 1" # nlme/R/varFunc.R: 889 # stop(gettextf("%s can have at most two components", nam), domain = "R-nlme") msgid "%s can have at most two components" msgstr "%s może posiadać najwyżej dwa komponenty" # nlme/R/varFunc.R: 895 # stop(gettextf("%s can only have names \"const\" and \"power\"", nam), domain = "R-nlme") msgid "%s can only have names \"const\" and \"power\"" msgstr "%s może posiadać jedynie nazwy \"const\" oraz \"power\"" # nlme/R/varFunc.R: 904 # stop(gettextf("%s can only be a list or numeric", nam), domain = "R-nlme") msgid "%s can only be a list or numeric" msgstr "%s może być jedynie listą lub liczbą" # nlme/R/varFunc.R: 914 # stop(gettextf("%s must have group names in 'varConstPower'", nam), domain = "R-nlme") msgid "%s must have group names in 'varConstPower'" msgstr "%s musi posiadać nazwy grup w 'varConstPower'" # nlme/R/varFunc.R: 920 # stop("constant in \"varConstPower\" structure must be > 0") msgid "constant in \"varConstPower\" structure must be > 0" msgstr "stała w strukturze \"varConstPower\" musi być > 0" # nlme/R/varFunc.R: 1070 # stop(gettext("initial value should be of length %d", nStratVar), domain = "R-nlme") # nlme/R/varFunc.R: 1118 # stop(gettext("initial value should be of length %d", aux), domain = "R-nlme") msgid "initial value should be of length %d" msgstr "początkowa wartość powinna być długości %d" # nlme/R/varFunc.R: 1075 # stop("nonexistent group names for initial values") msgid "nonexistent group names for initial values" msgstr "nieistniejące nazwy grup dla początkowych wartości" # nlme/R/varFunc.R: 1159 # stop("all arguments to 'varComb' must be of class \"varFunc\".") msgid "all arguments to 'varComb' must be of class \"varFunc\"." msgstr "" "wszystkie argumenty przekazywane do funkcji 'varComb()' muszą być obiektami " "klasy \"varFunc\"" msgid "cannot change parameter length of initialized \"varComb\" object" msgstr "" "nie można zmienić długości parametru zainicjalizowanego obiektu \"varComb\"" msgid "Package" msgstr "" msgid "installed with old R version" msgstr "" msgid "should not be used with R version" msgstr "" msgid "Rather re-install it with this version of R." msgstr "" msgid "deviance undefined for REML fit" msgstr "" msgid "AIC undefined for REML fit" msgstr "" msgid "" "not (yet) implemented. Contributions are welcome; use intervals() instead " "(for now)" msgstr "" # nlme/R/gls.R: 459 # stop(sprintf(ngettext(sum(noMatch), # "term %s was not matched", # "terms %s were not matched", domain = "R-nlme"), # paste(Terms[noMatch], collapse = ", ")), # domain = NA) # nlme/R/lme.R: 895 # stop(sprintf(ngettext(sum(noMatch), # "term %s was not matched", # "terms %s were not matched", domain = "R-nlme"), # paste(Terms[noMatch], collapse = ", ")), # domain = NA) msgid "term %s not matched" msgid_plural "terms %s not matched" msgstr[0] "człon %s nie został dopasowany" msgstr[1] "człony %s nie zostały dopasowane" msgstr[2] "człony %s nie zostały dopasowane" # nlme/R/gls.R: 478 # stop(sprintf(ngettext(ncol(L), # "'L' must have at most %d column", # "'L' must have at most %d columns", domain = "R-nlme"), # ncol(L)), domain = NA) # nlme/R/lme.R: 918 # stop(sprintf(ngettext(nX, # "'L' must have at most %d column", # "'L' must have at most %d columns", domain = "R-nlme"), # nX), domain = NA) msgid "'L' must have at most %d column" msgid_plural "'L' must have at most %d columns" msgstr[0] "'L' musi mieć co najwyzej %d kolumnę" msgstr[1] "'L' musi mieć co najwyzej %d kolumny" msgstr[2] "'L' musi mieć co najwyzej %d kolumn" # nlme/R/gls.R: 490 # stop(sprintf(ngettext(sum(noMatch), # "effect %s was not matched", # "effects %s were not matched", domain = "R-nlme"), # paste(dmsL2[noMatch], collapse = ", ")), domain = NA) # nlme/R/lme.R: 930 # stop(sprintf(ngettext(sum(noMatch), # "effect %s was not matched", # "effects %s were not matched", domain = "R-nlme"), # paste(dmsL2[noMatch],collapse = ", ")), # domain = NA) msgid "effect %s not matched" msgid_plural "effects %s not matched" msgstr[0] "efekt %s nie został dopasowany" msgstr[1] "efekty %s nie zostały dopasowane" msgstr[2] "efekty %s nie zostały dopasowane" msgid "level %s not allowed for %s" msgid_plural "levels %s not allowed for %s" msgstr[0] "poziom %s nie jest dozwolony dla %s" msgstr[1] "poziomy %s nie są dozwolone dla %s" msgstr[2] "poziomy %s nie są dozwolone dla %s" msgid "%d error caught in %s: %s" msgid_plural "%d times caught the same error in %s: %s" msgstr[0] "" msgstr[1] "" msgstr[2] "" msgid "%s not found in data" msgid_plural "%s not found in data" msgstr[0] "%s nie został znaleziony w danych" msgstr[1] "%s nie zostały znalezione w danych" msgstr[2] "%s nie zostały znalezione w danych" # nlme/R/lme.R: 1222 # stop(sprintf(ngettext(sum(aux), # "nonexistent level %s", # "nonexistent levels %s", domain = "R-nlme"), # level[aux]), domain = NA) # nlme/R/lme.R: 2531 # stop(sprintf(ngettext(sum(aux), # "nonexistent level %s", # "nonexistent levels %s", domain = "R-nlme"), # level[aux]), domain = NA) msgid "nonexistent level %s" msgid_plural "nonexistent levels %s" msgstr[0] "nieistniejący poziom %s" msgstr[1] "nieistniejące poziomy %s" msgstr[2] "nieistniejące poziomy %s" # nlme/R/lme.R: 1688 # stop(sprintf(ngettext(sum(whichNA), # "%s is not available for plotting", # "%s are not available for plotting", domain = "R-nlme"), # onames[whichNA], collapse = ", "), domain = NA) # nlme/R/lme.R: 1745 # stop(sprintf(ngettext(sum(whichNA), # "%s is not available for plotting", # "%s are not available for plotting", domain = "R-nlme"), # onames[whichNA], collapse = ", "), domain = NA) msgid "%s not available for plotting" msgid_plural "%s not available for plotting" msgstr[0] "%s nie jest dostępne do rysowania" msgstr[1] "%s nie są dostępne do rysowania" msgstr[2] "%s nie są dostępne do rysowania" # nlme/R/gls.R: 459 # stop(sprintf(ngettext(sum(noMatch), # "term %s was not matched", # "terms %s were not matched", domain = "R-nlme"), # paste(Terms[noMatch], collapse = ", ")), # domain = NA) # nlme/R/lme.R: 895 # stop(sprintf(ngettext(sum(noMatch), # "term %s was not matched", # "terms %s were not matched", domain = "R-nlme"), # paste(Terms[noMatch], collapse = ", ")), # domain = NA) msgid "%s not matched" msgid_plural "%s not matched" msgstr[0] "człon %s nie został dopasowany" msgstr[1] "człony %s nie zostały dopasowane" msgstr[2] "człony %s nie zostały dopasowane" # nlme/R/nlme.R: 581 # stop(sprintf(ngettext(sum(noMatch), # "group name not matched in starting values for random effects: %s", # "group names not matched in starting values for random effects: %s", domain = "R-nlme"), # paste(namSran[noMatch], collapse = ", ")), domain = NA) msgid "group name not matched in starting values for random effects: %s" msgid_plural "" "group names not matched in starting values for random effects: %s" msgstr[0] "" "nazwa grupy nie zgadza się z początkowymi wartościami dla efektów losowych: " "%s" msgstr[1] "" "nazwy grup nie zgadzają się z początkowymi wartościami dla efektów losowych: " "%s" msgstr[2] "" "nazwy grup nie zgadzają się z początkowymi wartościami dla efektów losowych: " "%s" # nlme/R/gnls.R: 419 # warning("step halving factor reduced below minimum in NLS step") # nlme/R/gnls.R: 421 # stop("step halving factor reduced below minimum in NLS step") #~ msgid "step halving factor reduced below minimum in NLS step" #~ msgstr "" #~ "czynnik skracający krok został zredukowany poniżej minimum w kroku NLS" # nlme/R/lmList.R: 87 # warning("An lm fit failed, probably because a factor only had one level") #~ msgid "An lm fit failed, probably because a factor only had one level" #~ msgstr "" #~ "Dopasowanie 'lm()' nie powiodło się prawdopodobnie dlatego, że czynnik " #~ "miał tylko jeden poziom" #~ msgid "" #~ "objects must inherit from classes \"gls\", \"gnls\",\"lm\",\"lmList\", " #~ "\"lme\",\"nlme\",\"nlsList\", or \"nls\"" #~ msgstr "" #~ "obiekty muszą dziedziczyć z co najmniej jednej z następujących klas: \"lm" #~ "\",\"lmList\", \"lme\",\"nlme\",\"nlsList\", \"nls\"" # nlme/R/gnls.R: 483 # stop("approximate covariance matrix for parameter estimates not of full rank") #~ msgid "" #~ "approximate covariance matrix for parameter estimates not of full rank" #~ msgstr "" #~ "przybliżona macierz kowariancji dla szacunkowych parametrów nie jest " #~ "pełnej rangi" # nlme/R/nlme.R: 878 # warning("step halving factor reduced below minimum in PNLS step") # nlme/R/nlme.R: 880 # stop("step halving factor reduced below minimum in PNLS step") #~ msgid "step halving factor reduced below minimum in PNLS step" #~ msgstr "" #~ "czynnik skracający krok został zredukowany poniżej minimum w kroku PNLS" #~ msgid "negative control$nlmStepMax - using default value" #~ msgstr "ujemna wartość 'control$nlmStepMax' - używanie wartości domyślnej" #~ msgid "REML comparisons are not meaningful." #~ msgstr "Porównania REML nie mają sensu." # nlme/R/VarCov.R: 26 # stop("'getVarCov.lme()' is not implemented for objects of class \"nlme\"") #~ msgid "'getVarCov.lme()' is not implemented for objects of class \"nlme\"" #~ msgstr "" #~ "funkcja 'getVarCov.lme()' nie jest zaimplementowana dla obiektów klasy " #~ "\"nlme\"" # nlme/R/VarCov.R: 105 # gettext("correlation matrix", domain = "R-nlme") #~ msgid "correlation matrix" #~ msgstr "macierz korelacji" # nlme/R/VarCov.R: 111 # gettext("variance covariance matrix", domain = "R-nlme") #~ msgid "variance covariance matrix" #~ msgstr "macierz wariancji-kowariancji" # nlme/R/VarCov.R: 116 # gettext(" Standard Deviations: ", domain = "R-nlme") #~ msgid "Standard Deviations:" #~ msgstr "Standardowe odchylenia:" # nlme/R/corStruct.R: 125 # stop(gettextf("cannot change the length of the parameter of an object of class %s", dQuote("corStruct"))) # nlme/R/corStruct.R: 418 # stop(gettextf("cannot change the length of the parameter of an object of class %s", dQuote("corSymm"))) # nlme/R/corStruct.R: 658 # stop(gettextf("cannot change the length of the parameter of an object of class %s", dQuote("corNatural"))) # nlme/R/corStruct.R: 946 # stop(gettextf("cannot change the length of the parameter of an object of class %s", dQuote("corAR1"))) # nlme/R/corStruct.R: 1112 # stop(gettextf("cannot change the length of the parameter of an object of class %s", dQuote("corCAR1"))) # nlme/R/corStruct.R: 1313 # stop(gettextf("cannot change the length of the parameter of an object of class %s", dQuote("corARMA"))) # nlme/R/corStruct.R: 1489 # stop(gettextf("cannot change the length of the parameter of an object of class %s", dQuote("corCompSymm"))) #~ msgid "cannot change the length of the parameter of an object of class %s" #~ msgstr "nie można zmienić długości parametru obiektu klasy %s" # nlme/R/corStruct.R: 164 # stop("'data' argument is required in order to calculate covariate of \"corStruct\" object") #~ msgid "" #~ "'%s' argument is required in order to calculate covariate of an object of " #~ "class %s" #~ msgstr "" #~ "wymagany jest argument '%s' w celu obliczenia zmiennej wyjaśniającej " #~ "obiektu klasy %s" # nlme/R/corStruct.R: 268 # gettextf("Correlation structure of class %s representing", dQuote(class(x)[1]), domain = "R-nlme") # nlme/R/corStruct.R: 504 # gettextf("Correlation structure of class %s representing", dQuote("corSymm"), domain = "R-nlme") # nlme/R/corStruct.R: 738 # gettextf("Correlation structure of class %s representing", dQuote("corNatural"), domain = "R-nlme") #~ msgid "Correlation structure of class %s representing" #~ msgstr "Struktura korelacji klasy reprezentującej %s" # nlme/R/corStruct.R: 271 # gettextf("Uninitialized correlation structure of class %s", dQuote(class(x)[1]), domain = "R-nlme") #~ msgid "Uninitialized correlation structure of class %s" #~ msgstr "Niezainicjalizowana struktura korelacji klasy %s" # nlme/R/corStruct.R: 280 # gettext("Correlation Structure: ", domain = "R-nlme") #~ msgid "Correlation Structure:" #~ msgstr "Struktura korelacji:" # nlme/R/corStruct.R: 281 # gettext(" Formula: ", domain = "R-nlme") # nlme/R/corStruct.R: 517 # gettext(" Formula: ", domain = "R-nlme") # nlme/R/corStruct.R: 751 # gettext(" Formula: ", domain = "R-nlme") # nlme/R/varFunc.R: 136 # gettext(" Formula: ", domain = "R-nlme") # nlme/R/varFunc.R: 242 # gettext(" Formula: ", domain = "R-nlme") # nlme/R/pdMat.R: 450 # gettext(" Formula: ", domain = "R-nlme") #~ msgid "Formula:" #~ msgstr "Formuła:" # nlme/R/corStruct.R: 282 # gettext(" Parameter estimates:", domain = "R-nlme") # nlme/R/corStruct.R: 518 # gettext(" Parameter estimates:", domain = "R-nlme") # nlme/R/corStruct.R: 752 # gettext(" Parameter estimates:", domain = "R-nlme") # nlme/R/varFunc.R: 137 # gettext(" Parameter estimates:", domain = "R-nlme") #~ msgid "Parameter estimates:" #~ msgstr "Oszacowania parametrów:" # nlme/R/corStruct.R: 448 # stop(gettextf("covariate must have unique values within groups for objects of class %s", dQuote("corSymm"))) # nlme/R/corStruct.R: 688 # stop(gettextf("covariate must have unique values within groups for objects of class %s", dQuote("corNatural"))) # nlme/R/corStruct.R: 971 # stop(gettextf("covariate must have unique values within groups for objects of class %s", dQuote("corAR1"))) # nlme/R/corStruct.R: 1139 # stop(gettextf("covariate must have unique values within groups for objects of class %s", dQuote("corCAR1"))) # nlme/R/corStruct.R: 1344 # stop(gettextf("covariate must have unique values within groups for objects of class %s", dQuote("corARMA"))) #~ msgid "" #~ "covariate must have unique values within groups for objects of class %s" #~ msgstr "" #~ "zmienna wyjaśniająca musi mieć unikalne wartości w obrębie grup dla " #~ "obiektów klasy %s" # nlme/R/corStruct.R: 453 # stop(gettextf("unique values of the covariate for objects of class %s must be a sequence of consecutive integers", dQuote("corSymm"))) # nlme/R/corStruct.R: 693 # stop(gettextf("unique values of the covariate for objects of class %s must be a sequence of consecutive integers", dQuote("corNatural"))) #~ msgid "" #~ "unique values of the covariate for objects of class %s must be a " #~ "sequence of consecutive integers" #~ msgstr "" #~ "unikalne wartości zmiennej wyjaśniającej dla obiektów klasy %s muszą być " #~ "ciągiem kolejnych liczb całkowitych" # nlme/R/corStruct.R: 468 # stop(gettextf("initial values for %d must be between %d and %d", dQuote("corSymm"), -1, 1)) # nlme/R/corStruct.R: 708 # stop(gettextf("initial values for %d must be between %d and %d", dQuote("corNatural"), -1, 1)) #~ msgid "initial values for %s must be between %d and %d" #~ msgstr "początkowe wartości dla %s muszą być pomiędzy %d a %d" # nlme/R/corStruct.R: 507 # gettextf("Unitialized correlation structure of class %s", dQuote("corSymm"), domain = "R-nlme") # nlme/R/corStruct.R: 524 # gettextf("Unitialized correlation structure of class %s", dQuote("corSymm"), domain = "R-nlme") # nlme/R/corStruct.R: 741 # gettextf("Unitialized correlation structure of class %s", dQuote("corNatural"), domain = "R-nlme") # nlme/R/corStruct.R: 759 # gettextf("Unitialized correlation structure of class %s", dQuote("corNatural"), domain = "R-nlme") #~ msgid "Unitialized correlation structure of class %s" #~ msgstr "Niezainicjalizowana struktura korelacji klasy %s" # nlme/R/corStruct.R: 516 # gettext("Correlation Structure: General", domain = "R-nlme") # nlme/R/corStruct.R: 750 # gettext("Correlation Structure: General", domain = "R-nlme") #~ msgid "Correlation Structure: General" #~ msgstr "Struktura korelacji: Ogólna" # nlme/R/corStruct.R: 546 # gettext("General correlation", domain = "R-nlme") #~ msgid "General correlation" #~ msgstr "Ogólna korelacja" # nlme/R/corStruct.R: 782 # gettext("General correlation, with natural parametrization", domain = "R-nlme") #~ msgid "General correlation, with natural parametrization" #~ msgstr "Ogólna korelacja z naturalną parametryzacją" # nlme/R/corStruct.R: 842 # gettext("Independent", domain = "R-nlme") #~ msgid "Independent" #~ msgstr "Niezależna" # nlme/R/corStruct.R: 856 # stop(gettextf("parameter in %s structure must be between %d and %d", "AR(1)", -1, 1)) # nlme/R/corStruct.R: 1018 # stop(gettextf("parameter in %s structure must be between %d and %d", "CAR(1)", 0, 1)) # nlme/R/corStruct.R: 1397 # stop(gettextf("parameter in %s structure must be between %d and %d", dQuote("corCompSymm"), -1, 1)) #~ msgid "parameter in %s structure must be between %d and %d" #~ msgstr "parametr w strukturze %s musi być pomiędzy %d a %d" # nlme/R/corStruct.R: 1163 # gettext("Continuous AR(1)", domain = "R-nlme") #~ msgid "Continuous AR(1)" #~ msgstr "Ciągła AR(1)" # nlme/R/corStruct.R: 1189 # stop(gettextf("parameters in %s structure must be between %d and %d", "ARMA", -1, 1)) #~ msgid "parameters in %s structure must be between %d and %d" #~ msgstr "parametry w strukturze %s muszą być pomiędzy %d a %d" # nlme/R/corStruct.R: 1541 # gettext("Compound symmetry", domain = "R-nlme") #~ msgid "Compound symmetry" #~ msgstr "Złożona symetria" # nlme/R/corStruct.R: 2118 # stop("'range' must be > 0 in \"corLin\" initial value") #~ msgid "'%s' argument must be > 0 in %s initial value" #~ msgstr "argument '%s' musi być > 0 w początkowej wartości %s" # nlme/R/corStruct.R: 2038 # gettext("Exponential spatial correlation", domain = "R-nlme") #~ msgid "Exponential spatial correlation" #~ msgstr "Wykładnicza korelacja przestrzenna" # nlme/R/corStruct.R: 2068 # gettext("Gaussian spatial correlation", domain = "R-nlme") #~ msgid "Gaussian spatial correlation" #~ msgstr "Gaussowska korelacja przestrzenna" # nlme/R/corStruct.R: 2156 # gettext("Linear spatial correlation", domain = "R-nlme") #~ msgid "Linear spatial correlation" #~ msgstr "Liniowa korelacja przestrzenna" # nlme/R/corStruct.R: 2186 # gettext("Rational quadratic spatial correlation", domain = "R-nlme") #~ msgid "Rational quadratic spatial correlation" #~ msgstr "Wymierna kwadratowa korelacja przestrzenna" # nlme/R/corStruct.R: 2277 # gettext("Spherical spatial correlation", domain = "R-nlme") #~ msgid "Spherical spatial correlation" #~ msgstr "Sferyczna korelacja przestrzenna" # nlme/R/gls.R: 38 # warning("negative 'control$nlmStepMax' - using default value") # nlme/R/gnls.R: 62 # warning("negative 'control$nlmStepMax' - using default value") # nlme/R/nlme.R: 177 # warning("negative 'control$nlmStepMax' - using default value") # nlme/R/lme.R: 145 # warning("negative 'control$nlmStepMax' - using default value") #~ msgid "negative 'control$nlmStepMax' - using default value" #~ msgstr "ujemna wartość 'control$nlmStepMax' - używanie wartości domyślnej" # nlme/R/gls.R: 163 # gettext("Iteration: ", domain = "R-nlme") #~ msgid "Iteration:" #~ msgstr "Iteracja:" # nlme/R/gls.R: 164 # gettext("Objective: ", domain = "R-nlme") #~ msgid "Objective:" #~ msgstr "Funkcja celu:" # nlme/R/gls.R: 166 # gettext("Convergence:", domain = "R-nlme") # nlme/R/gnls.R: 454 # gettext("Convergence:", domain = "R-nlme") # nlme/R/nlme.R: 936 # gettext("Convergence:", domain = "R-nlme") #~ msgid "Convergence:" #~ msgstr "Zbieżność:" # nlme/R/gls.R: 206 # gettext("Approximate variance-covariance matrix not available", domain = "R-nlme") # nlme/R/gnls.R: 512 # gettext("Approximate variance-covariance matrix not available", domain = "R-nlme") # nlme/R/lme.R: 411 # gettext("Approximate variance-covariance matrix not available", domain = "R-nlme") #~ msgid "Approximate variance-covariance matrix not available" #~ msgstr "Przybliżona macierz wariancji-kowiariancji nie jest dostępna" # nlme/R/gls.R: 294 # gettext("Non-positive definite approximate variance-covariance", domain = "R-nlme") # nlme/R/gnls.R: 593 # gettext("Non-positive definite approximate variance-covariance", domain = "R-nlme") # nlme/R/lme.R: 617 # gettext("Non-positive definite approximate variance-covariance", domain = "R-nlme") #~ msgid "Non-positive definite approximate variance-covariance" #~ msgstr "Niedodatnio określona przybliżona macierz wariancji-kowariancji" # nlme/R/newMethods.R: 15 # stop(gettextf("'%s' argument is not an object of class %s", "form", dQuote("formula"))) # nlme/R/newMethods.R: 134 # stop(gettextf("'%s' argument is not an object of class %s", "object", dQuote("formula"))) # nlme/R/newMethods.R: 273 # stop(gettextf("'%s' argument is not an object of class %s", "form", dQuote("formula"))) # nlme/R/newMethods.R: 693 # stop(gettextf("'%s' argument is not an object of class %s", "form", dQuote("formula"))) # nlme/R/gls.R: 410 # stop(gettextf("'%s' argument is not an object of class %s", "object", dQuote("gls"))) # nlme/R/gnls.R: 71 # stop(gettextf("'%s' argument is not an object of class %s", "form", dQuote("formula"))) # nlme/R/varFunc.R: 198 # stop(gettextf("'%s' argument is not an object of class %s", "value", dQuote("formula"))) # nlme/R/nlme.R: 186 # stop(gettextf("'%s' argument is not an object of class %s", "model", dQuote("formula"))) # nlme/R/lme.R: 853 # stop(gettextf("'%s' argument is not an object of class %s", "object", dQuote("lme"))) # nlme/R/lme.R: 1427 # stop(gettextf("'%s' argument is not an object of class %s", "form", dQuote("formula"))) # nlme/R/lme.R: 2237 # stop(gettextf("'%s' argument is not an object of class %s", "form", dQuote("formula"))) # nlme/R/lmList.R: 387 # stop(gettextf("'%s' argument is not an object of class %s", "form", dQuote("formula"))) # nlme/R/lmList.R: 649 # stop(gettextf("'%s' argument is not an object of class %s", "form", dQuote("formula"))) # nlme/R/lmList.R: 1031 # stop(gettextf("'%s' argument is not an object of class %s", "form", dQuote("formula"))) # nlme/R/newFunc.R: 135 # stop(gettextf("'%s' argument is not an object of class %s", "object", dQuote("data.frame"))) # nlme/R/newFunc.R: 140 # stop(gettextf("'%s' argument is not an object of class %s", "form", dQuote("formula"))) # nlme/R/newFunc.R: 186 # stop(gettextf("'%s' argument is not an object of class %s", "object", dQuote("formula"))) # nlme/R/newFunc.R: 216 # stop(gettextf("'%s' argument is not an object of class %s", "object", dQuote("data.frame"))) # nlme/R/newFunc.R: 220 # stop(gettextf("'%s' argument is not an object of class %s", "form", dQuote("fomrula"))) # nlme/R/newFunc.R: 301 # stop(gettextf("'%s' argument is not an object of class %s", "object", dQuote("lmList"))) #~ msgid "'%s' argument is not an object of class %s" #~ msgstr "argument '%s' nie jest obiektem klasy %s" # nlme/R/gls.R: 428 # gettext("Denom. DF: ", domain = "R-nlme") #~ msgid "Denom. DF:" #~ msgstr "Stopnie swobody mianownika:" # nlme/R/newMethods.R: 370 # stop(gettextf("'%s' argument must be between %d and %d", "id", 0, 1)) # nlme/R/newMethods.R: 746 # stop(gettextf("'%s' argument must be between %d and %d", "id", 0, 1)) # nlme/R/gls.R: 454 # stop(gettextf("'%s' argument must be between %d and %d", "Terms", 1, nTerms), domain = "R-nlme") # nlme/R/lme.R: 890 # stop(gettextf("'%s' argument must be between %d and %d", "Terms", 1, nTerms), domain = "R-nlme") # nlme/R/lme.R: 1516 # stop(gettextf("'%s' argument must be between %d and %d", "id", 0, 1)) # nlme/R/lme.R: 2297 # stop(gettextf("'%s' argument must be between %d and %d", "id", 0, 1)) # nlme/R/lme.R: 2353 # stop(gettextf("'%s' argument must be between %d and %d", "id", 0, 1)) # nlme/R/lmList.R: 473 # stop(gettextf("'%s' argument must be between %d and %d", "id", 0, 1)) # nlme/R/lmList.R: 745 # stop(gettextf("'%s' argument must be between %d and %d", "id", 0, 1)) # nlme/R/lmList.R: 1090 # stop(gettextf("'%s' argument must be between %d and %d", "id", 0, 1)) # nlme/R/lmList.R: 1143 # stop(gettextf("'%s' argument must be between %d and %d", "id", 0, 1)) # nlme/R/newFunc.R: 166 # stop(gettextf("'%s' argument must be between %d and %d", "which", 1, ncol(object)), domain = "R-nlme") #~ msgid "'%s' argument must be between %d and %d" #~ msgstr "argument '%s' musi być pomiędzy %d a %d" # nlme/R/gls.R: 470 # gettext(" F-test for: ", domain = "R-nlme") # nlme/R/lme.R: 910 # gettext("F-test for: ", domain = "R-nlme") #~ msgid "F-test for:" #~ msgstr "Test F dla:" # nlme/R/gls.R: 506 # gettext(" F-test for linear combinations", domain = "R-nlme") # nlme/R/lme.R: 952 # gettext("F-test for linear combinations", domain = "R-nlme") #~ msgid "F-test for linear combinations" #~ msgstr "Test F dla kombinacji liniowej" # nlme/R/gls.R: 705 # gettext("Fitted values", domain = "R-nlme") # nlme/R/lme.R: 1242 # gettext("Fitted values", domain = "R-nlme") # nlme/R/lmList.R: 262 # gettext("Fitted values", domain = "R-nlme") #~ msgid "Fitted values" #~ msgstr "Dopasowanie wartości" # nlme/R/gls.R: 754 # gettext("Coefficients:", domain = "R-nlme") # nlme/R/gls.R: 955 # gettext("Coefficients:", domain = "R-nlme") # nlme/R/gls.R: 992 # gettext("Coefficients:", domain = "R-nlme") # nlme/R/lmList.R: 986 # gettext("Coefficients:", domain = "R-nlme") # nlme/R/lmList.R: 1011 # gettext("Coefficients:", domain = "R-nlme") #~ msgid "Coefficients:" #~ msgstr "Współczynniki:" # nlme/R/gls.R: 769 # gettext("Residual standard error:", domain = "R-nlme") # nlme/R/gls.R: 800 # gettext("Residual standard error:", domain = "R-nlme") # nlme/R/gls.R: 962 # gettext("Residual standard error: ", domain = "R-nlme") # nlme/R/gls.R: 1013 # gettext("Residual standard error: ", domain = "R-nlme") # nlme/R/lmList.R: 994 # gettext("Residual standard error: ", domain = "R-nlme") #~ msgid "Residual standard error:" #~ msgstr "Standardowy błąd reszt:" # nlme/R/gls.R: 814 # gettext("Correlation structure:", domain = "R-nlme") # nlme/R/lme.R: 1383 # gettext("Correlation structure:", domain = "R-nlme") #~ msgid "Correlation structure:" #~ msgstr "Struktura korelacji:" # nlme/R/gls.R: 815 # gettext("Variance function:", domain = "R-nlme") # nlme/R/varFunc.R: 134 # gettext("Variance function:", domain = "R-nlme") # nlme/R/varFunc.R: 240 # gettext("Variance function:", domain = "R-nlme") # nlme/R/lme.R: 1384 # gettext("Variance function:", domain = "R-nlme") #~ msgid "Variance function:" #~ msgstr "Funkcja wariancji:" # nlme/R/gls.R: 906 # gettext("Predicted values", domain = "R-nlme") # nlme/R/gnls.R: 754 # gettext("Predicted values", domain = "R-nlme") # nlme/R/nlme.R: 1315 # gettext("Predicted values", domain = "R-nlme") # nlme/R/lme.R: 1967 # gettext("Predicted values", domain = "R-nlme") # nlme/R/lme.R: 2009 # gettext("Predicted values", domain = "R-nlme") # nlme/R/lmList.R: 956 # gettext("Predicted values", domain = "R-nlme") #~ msgid "Predicted values" #~ msgstr "Wyznaczone wartości" # nlme/R/gls.R: 916 # gettextf("Approximate %s %% confidence intervals", attr(x, "level") * 100, domain = "R-nlme") # nlme/R/lme.R: 2072 # gettextf("Approximate %s %% confidence intervals", attr(x, "level") * 100, domain = "R-nlme") #~ msgid "Approximate %s %% confidence intervals" #~ msgstr "Przybliżone %s %% przedziały ufności" # nlme/R/gls.R: 933 # gettext("Generalized nonlinear least squares fit", domain = "R-nlme") # nlme/R/gls.R: 973 # gettext("Generalized nonlinear least squares fit", domain = "R-nlme") #~ msgid "Generalized nonlinear least squares fit" #~ msgstr "Uogólnione nieliniowe dopasowanie metodą najmniejszych kwadratów" # nlme/R/gls.R: 936 # gettext("Generalized least squares fit by REML", domain = "R-nlme") # nlme/R/gls.R: 976 # gettext("Generalized least squares fit by REML", domain = "R-nlme") #~ msgid "Generalized least squares fit by REML" #~ msgstr "" #~ "Uogólnione dopasowanie metodą najmniejszych kwadratów ze względu na REML" # nlme/R/gls.R: 938 # gettext("Generalized least squares fit by maximum likelihood", domain = "R-nlme") # nlme/R/gls.R: 978 # gettext("Generalized least squares fit by maximum likelihood", domain = "R-nlme") #~ msgid "Generalized least squares fit by maximum likelihood" #~ msgstr "" #~ "Uogólnione dopasowanie metodą najmniejszych kwadratów ze względu na " #~ "maksimum funkcji wiarygodności" # nlme/R/gls.R: 941 # gettext(" Model: ", domain = "R-nlme") # nlme/R/gls.R: 981 # gettext(" Model: ", domain = "R-nlme") # nlme/R/lme.R: 2099 # gettext(" Model: ", domain = "R-nlme") # nlme/R/lme.R: 2168 # gettext(" Model: ", domain = "R-nlme") # nlme/R/lmList.R: 981 # gettext(" Model: ", domain = "R-nlme") # nlme/R/lmList.R: 1005 # gettext(" Model: ", domain = "R-nlme") #~ msgid "Model:" #~ msgstr "Model:" # nlme/R/gls.R: 942 # gettext(" Data: ", domain = "R-nlme") # nlme/R/gls.R: 982 # gettext(" Data: ", domain = "R-nlme") # nlme/R/lme.R: 2107 # gettext(" Data: ", domain = "R-nlme") # nlme/R/lme.R: 2177 # gettext(" Data: ", domain = "R-nlme") # nlme/R/lmList.R: 985 # gettext(" Data: ", domain = "R-nlme") # nlme/R/lmList.R: 1010 # gettext(" Data: ", domain = "R-nlme") #~ msgid "Data:" #~ msgstr "Dane:" # nlme/R/gls.R: 944 # gettext(" Subset: ", domain = "R-nlme") # nlme/R/gls.R: 984 # gettext(" Subset: ", domain = "R-nlme") # nlme/R/lme.R: 2109 # gettext(" Subset: ", domain = "R-nlme") # nlme/R/lme.R: 2179 # gettext(" Subset: ", domain = "R-nlme") #~ msgid "Subset:" #~ msgstr "Podzbiór:" # nlme/R/gls.R: 947 # gettext(" Log-likelihood: ", domain = "R-nlme") # nlme/R/gls.R: 952 # gettext(" Log-likelihood: ", domain = "R-nlme") # nlme/R/lme.R: 2114 # gettext(" Log-likelihood: ", domain = "R-nlme") #~ msgid "Log-likelihood:" #~ msgstr "logarytm funkcji wiarygodności:" # nlme/R/gls.R: 950 # gettext(" Log-restricted-likelihood: ", domain = "R-nlme") # nlme/R/lme.R: 2112 # gettext(" Log-restricted-likelihood: ", domain = "R-nlme") #~ msgid "Log-restricted-likelihood:" #~ msgstr "Logarytm ograniczonej funkcji wiarygodności:" # nlme/R/gls.R: 961 # gettextf("Degrees of freedom: %s total; %s residual", dd[["N"]], dd[["N"]] - dd[["p"]], domain = "R-nlme") # nlme/R/gls.R: 1014 # gettextf("Degrees of freedom: %s total; %s residual", dd[["N"]], dd[["N"]] - dd[["p"]], domain = "R-nlme") # nlme/R/lmList.R: 993 # gettextf("Degrees of freedom: %s total; %s residual", length(unlist(lapply(x, fitted))), dfRes, domain = "R-nlme") #~ msgid "Degrees of freedom: %s total; %s residual" #~ msgstr "Stopnie swobody: całość %s, %s reszt" # nlme/R/gls.R: 987 # gettext("Convergence at iteration: ", domain = "R-nlme") # nlme/R/lme.R: 2182 # gettext("Convergence at iteration: ", domain = "R-nlme") #~ msgid "Convergence at iteration:" #~ msgstr "Zbieżność w iteracji:" # nlme/R/newMethods.R: 668 # gettext(" Correlation:", domain = "R-nlme") # nlme/R/gls.R: 1008 # gettext("Correlation:", domain = "R-nlme") # nlme/R/lme.R: 2209 # gettext(" Correlation:", domain = "R-nlme") #~ msgid "Correlation:" #~ msgstr "Korelacja:" # nlme/R/gls.R: 1010 # gettext("Standardized residuals:", domain = "R-nlme") #~ msgid "Standardized residuals:" #~ msgstr "Standaryzowane reszty:" # nlme/R/newMethods.R: 726 # gettext("Standardized residuals", domain = "R-nlme") # nlme/R/gls.R: 1025 # gettext("Standardized residuals", domain = "R-nlme") # nlme/R/lme.R: 2273 # gettext("Standardized residuals", domain = "R-nlme") # nlme/R/lme.R: 2572 # gettext("Standardized residuals", domain = "R-nlme") # nlme/R/lmList.R: 1067 # gettext("Standardized residuals", domain = "R-nlme") # nlme/R/lmList.R: 1319 # gettext("Standardized residuals", domain = "R-nlme") #~ msgid "Standardized residuals" #~ msgstr "Standaryzowane reszty" # nlme/R/newMethods.R: 727 # gettext("Normalized residuals", domain = "R-nlme") # nlme/R/newMethods.R: 748 # gettext("Normalized residuals", domain = "R-nlme") # nlme/R/gls.R: 1030 # gettext("Normalized residuals", domain = "R-nlme") # nlme/R/lme.R: 2274 # gettext("Normalized residuals", domain = "R-nlme") # nlme/R/lme.R: 2299 # gettext("Normalized residuals", domain = "R-nlme") # nlme/R/lme.R: 2573 # gettext("Normalized residuals", domain = "R-nlme") #~ msgid "Normalized residuals" #~ msgstr "Znormalizowane reszty" # nlme/R/newMethods.R: 729 # gettext("Residuals", domain = "R-nlme") # nlme/R/gls.R: 1034 # gettext("Residuals", domain = "R-nlme") # nlme/R/lme.R: 2276 # gettext("Residuals", domain = "R-nlme") # nlme/R/lme.R: 2566 # gettext("Residuals", domain = "R-nlme") # nlme/R/lmList.R: 1069 # gettext("Residuals", domain = "R-nlme") # nlme/R/lmList.R: 1315 # gettext("Residuals", domain = "R-nlme") #~ msgid "Residuals" #~ msgstr "Reszty" # nlme/R/gls.R: 1093 # stop("an object with 'call' component is required") # nlme/R/gnls.R: 768 # stop("an object with 'call' component is required") # nlme/R/nlme.R: 1332 # stop("an object with 'call' component is required") # nlme/R/lme.R: 2625 # stop("an object with 'call' component is required") #~ msgid "an object with 'call' component is required" #~ msgstr "wymagany jest obiekt z komponentem 'call'" # nlme/R/gnls.R: 126 # stop(gettextf("'%s' must be a formula or list of formulae", "params")) # nlme/R/nlme.R: 275 # stop(gettextf("'%s' must be a formula or list of formulae", "fixed")) # nlme/R/nlme.R: 294 # stop(gettextf("'%s' must be a formula or list of formulae", "random")) #~ msgid "'%s' argument must be a formula or list of formulae" #~ msgstr "argument '%s' musi być formułą lub listą formuł" # nlme/R/gnls.R: 128 # stop(gettextf("formulae in '%s' must be of the form \"parameter ~ expr\"", "params")) # nlme/R/gnls.R: 130 # stop(gettextf("formulae in '%s' must be of the form \"parameter ~ expr\"", "params")) # nlme/R/nlme.R: 277 # stop(gettextf("formulae in '%s' must be of the form \"parameter ~ expr\"", "fixed")) # nlme/R/nlme.R: 279 # stop(gettextf("formulae in '%s' must be of the form \"parameter ~ expr\"", "fixed")) # nlme/R/nlme.R: 296 # stop(gettextf("formulae in '%s' must be of the form \"parameter ~ expr\"", "random")) # nlme/R/nlme.R: 298 # stop(gettextf("formulae in '%s' must be of the form \"parameter ~ expr\"", "random")) #~ msgid "formulae in '%s' must be of the form \"parameter ~ expr\"" #~ msgstr "formuły w '%s' muszą mieć formę \"parametr ~ wyrażenie\"" # nlme/R/gnls.R: 382 # gettextf("Iteration %d", numIter, domain = "R-nlme") # nlme/R/nlme.R: 841 # gettextf("Iteration %d", numIter, domain = "R-nlme") #~ msgid "Iteration %d" #~ msgstr "Iteracja %d" # nlme/R/gnls.R: 384 # gettext("GLS step: Objective: ", domain = "R-nlme") #~ msgid "GLS step: Objective:" #~ msgstr "krok GLS: Funkcja celu:" #~ msgid "NLS step: RSS = %s" #~ msgstr "krok NLS: RSS = %s" # nlme/R/gnls.R: 433 # gettext("model parameters:", domain = "R-nlme") #~ msgid "model parameters:" #~ msgstr "parametry modelu:" # nlme/R/gnls.R: 435 # gettext("iterations: ", domain = "R-nlme") # nlme/R/nlme.R: 901 # gettext("iterations: ", domain = "R-nlme") #~ msgid "iterations:" #~ msgstr "iteracje:" # nlme/R/groupedData.R: 31 # stop(gettextf("first argument passed to %s function must be a two-sided formula", sQuote("GroupedData()"))) # nlme/R/groupedData.R: 50 # stop(gettextf("first argument passed to %s function must be a two-sided formula", sQuote("nfGroupedData()"))) # nlme/R/groupedData.R: 150 # stop(gettextf("first argument passed to %s function must be a two-sided formula", sQuote("nmGroupedData()"))) #~ msgid "first argument passed to %s function must be a two-sided formula" #~ msgstr "" #~ "pierwszy argument przekazywany do funkcji %s musi być dwustronną formułą" # nlme/R/pdMat.R: 1740 # stop(gettextf("'%s' argument must be a list", "form")) # nlme/R/pdMat.R: 1749 # stop(gettextf("'%s' argument must be a list", "nam")) # nlme/R/groupedData.R: 227 # stop(gettextf("'%s' argument must be a list", "subset")) #~ msgid "'%s' argument must be a list" #~ msgstr "argument '%s' musi być listą" # nlme/R/newMethods.R: 121 # stop(gettextf("'%s' argument must be a two-sided formula", "form")) # nlme/R/newFunc.R: 201 # stop(gettextf("'%s' argument must be a two-sided formula", "form")) # nlme/R/groupedData.R: 293 # stop(gettextf("'%s' argument must be a two-sided formula", "preserve")) #~ msgid "'%s' argument must be a two-sided formula" #~ msgstr "argument '%s' musi być dwustronną formułą" # nlme/R/groupedData.R: 560 # gettext("Grouped Data: ", domain = "R-nlme") #~ msgid "Grouped Data:" #~ msgstr "Zgrupowane dane:" # nlme/R/lme.R: 1206 # gettext("Coefficients", domain = "R-nlme") # nlme/R/lmList.R: 216 # gettext("Coefficients", domain = "R-nlme") #~ msgid "Coefficients" #~ msgstr "Współczynniki" # nlme/R/lme.R: 1430 # stop(gettextf("'%s' argument must be a one-sided formula", "form")) # nlme/R/lmList.R: 390 # stop(gettextf("'%s' argument must be a one-sided formula", "form")) #~ msgid "'%s' argument must be a one-sided formula" #~ msgstr "argument '%s' musi być jednostronną formułą" # nlme/R/newMethods.R: 376 # stop(gettextf("'%s' argument can only be a formula or numeric", "id")) # nlme/R/newMethods.R: 757 # stop(gettextf("'%s' argument can only be a formula or numeric", "id")) # nlme/R/lme.R: 1528 # stop(gettextf("'%s' argument can only be a formula or numeric", "id")) # nlme/R/lme.R: 2306 # stop(gettextf("'%s' argument can only be a formula or numeric", "id")) # nlme/R/lme.R: 2359 # stop(gettextf("'%s' argument can only be a formula or numeric", "id")) # nlme/R/lmList.R: 482 # stop(gettextf("'%s' argument can only be a formula or numeric", "id")) # nlme/R/lmList.R: 750 # stop(gettextf("'%s' argument can only be a formula or numeric", "id")) # nlme/R/lmList.R: 1096 # stop(gettextf("'%s' argument can only be a formula or numeric", "id")) # nlme/R/lmList.R: 1149 # stop(gettextf("'%s' argument can only be a formula or numeric", "id")) #~ msgid "'%s' argument can only be a formula or numeric" #~ msgstr "argument '%s' może być jedynie formułą lub liczbą" # nlme/R/newMethods.R: 388 # stop(gettextf("'%s' argument is of incorrect length", "idLabels")) # nlme/R/newMethods.R: 769 # stop(gettextf("'%s' argument is of incorrect length", "idLabels")) # nlme/R/lme.R: 1546 # stop(gettextf("'%s' argument is of incorrect length", "idLabels")) # nlme/R/lme.R: 2318 # stop(gettextf("'%s' argument is of incorrect length", "idLabels")) # nlme/R/lme.R: 2374 # stop(gettextf("'%s' argument is of incorrect length", "idLabels")) # nlme/R/lmList.R: 497 # stop(gettextf("'%s' argument is of incorrect length", "idLabels")) # nlme/R/lmList.R: 762 # stop(gettextf("'%s' argument is of incorrect length", "idLabels")) # nlme/R/lmList.R: 1108 # stop(gettextf("'%s' argument is of incorrect length", "idLabels")) # nlme/R/lmList.R: 1164 # stop(gettextf("'%s' argument is of incorrect length", "idLabels")) #~ msgid "'%s' argument is of incorrect length" #~ msgstr "argument '%s' ma niepoprawną długość" # nlme/R/newMethods.R: 392 # stop(gettextf("'%s' argument can only be a formula or a vector", "idLabels")) # nlme/R/newMethods.R: 773 # stop(gettextf("'%s' argument can only be a formula or a vector", "idLabels")) # nlme/R/lme.R: 1550 # stop(gettextf("'%s' argument can only be a formula or a vector", "idLabels")) # nlme/R/lme.R: 2322 # stop(gettextf("'%s' argument can only be a formula or a vector", "idLabels")) # nlme/R/lme.R: 2378 # stop(gettextf("'%s' argument can only be a formula or a vector", "idLabels")) # nlme/R/lmList.R: 501 # stop(gettextf("'%s' argument can only be a formula or a vector", "idLabels")) # nlme/R/lmList.R: 766 # stop(gettextf("'%s' argument can only be a formula or a vector", "idLabels")) # nlme/R/lmList.R: 1112 # stop(gettextf("'%s' argument can only be a formula or a vector", "idLabels")) # nlme/R/lmList.R: 1168 # stop(gettextf("'%s' argument can only be a formula or a vector", "idLabels")) #~ msgid "'%s' argument can only be a formula or a vector" #~ msgstr "argument '%s' może być jedynie formułą lub wektorem" # nlme/R/lme.R: 2036 # gettext("Call:", domain = "R-nlme") # nlme/R/lmList.R: 979 # gettext("Call:", domain = "R-nlme") # nlme/R/lmList.R: 1003 # gettext("Call:", domain = "R-nlme") #~ msgid "Call:" #~ msgstr "Wywołanie:" # nlme/R/lme.R: 2078 # gettext(" Level: ", domain = "R-nlme") # nlme/R/lme.R: 2149 # gettext("Level: ", domain = "R-nlme") # nlme/R/pdMat.R: 461 # gettext("Level: ", domain = "R-nlme") # nlme/R/lmList.R: 983 # gettext(" Level: ", domain = "R-nlme") # nlme/R/lmList.R: 1008 # gettext(" Level: ", domain = "R-nlme") #~ msgid "Level:" #~ msgstr "Poziom:" # nlme/R/lmList.R: 1018 # gettextf("Residual standard error: %s on %s degrees of freedom", format(x$RSE), x$df.residual, domain = "R-nlme") #~ msgid "Residual standard error: %s on %s degrees of freedom" #~ msgstr "Standardowy błąd reszt: %s dla %s stopni swobody" # nlme/R/newMethods.R: 733 # gettext("Quantiles of standard normal", domain = "R-nlme") # nlme/R/lme.R: 2283 # gettext("Quantiles of standard normal", domain = "R-nlme") # nlme/R/lmList.R: 1076 # gettext("Quantiles of standard normal", domain = "R-nlme") #~ msgid "Quantiles of standard normal" #~ msgstr "Kwantyle rozkładu normalnego" # nlme/R/lme.R: 2509 # gettext("Standardized random effects", domain = "R-nlme") # nlme/R/lmList.R: 1243 # gettext("Standardized random effects", domain = "R-nlme") #~ msgid "Standardized random effects" #~ msgstr "Ustandaryzowane efekty losowe" # nlme/R/lme.R: 2511 # gettext("Random effects", domain = "R-nlme") # nlme/R/lmList.R: 1245 # gettext("Random effects", domain = "R-nlme") #~ msgid "Random effects" #~ msgstr "Efekty losowe" # nlme/R/lme.R: 67 # stop("can only fit \"lmList\" objects with single grouping variable") # nlme/R/lme.R: 107 # stop("can only fit \"lmList\" objects with single grouping variable") #~ msgid "can only fit objects of class %s with single grouping variable" #~ msgstr "" #~ "można dopasować jedynie obiekty klasy %s z pojedynczą zmienną grupującą" # nlme/R/lme.R: 981 # stop(gettextf("objects must inherit from at least one of the following classes: %s", paste(dQuote(valid.classes), collapse = ", "))) #~ msgid "objects must inherit from at least one of the following classes: %s" #~ msgstr "" #~ "obiekty muszą dziedziczyć z co najmniej jednej z następujących klas: %s" # nlme/R/nlme.R: 899 # gettext("Fixed effects:", domain = "R-nlme") # nlme/R/lme.R: 1297 # gettext("Fixed effects:", domain = "R-nlme") # nlme/R/lme.R: 2186 # gettext("Fixed effects: ", domain = "R-nlme") #~ msgid "Fixed effects:" #~ msgstr "Ustalone efekty:" # nlme/R/lme.R: 1333 # gettext("Within-group standard error:", domain = "R-nlme") #~ msgid "Within-group standard error:" #~ msgstr "Standardowy błąd w obrębie grup:" # nlme/R/reStruct.R: 396 # gettext("Random effects:", domain = "R-nlme") # nlme/R/lme.R: 1382 # gettext("Random effects:", domain = "R-nlme") #~ msgid "Random effects:" #~ msgstr "Efekty losowe:" # nlme/R/lme.R: 1533 # stop(gettextf("covariate must have a level attribute when '%s' argument is a formula", "id")) # nlme/R/lme.R: 1556 # stop(gettextf("covariate must have a level attribute when '%s' argument is a formula", "idLabels")) #~ msgid "" #~ "covariate must have a level attribute when '%s' argument is a formula" #~ msgstr "" #~ "zmienna niezależna musi mieć atrybut poziomu, gdy argument '%s' jest " #~ "formułą" # nlme/R/lme.R: 2095 # gettext("Nonlinear mixed-effects model fit by REML", domain = "R-nlme") # nlme/R/lme.R: 2164 # gettext("Nonlinear mixed-effects model fit by REML", domain = "R-nlme") #~ msgid "Nonlinear mixed-effects model fit by REML" #~ msgstr "Nieliniowe dopasowanie modelu mieszanych efektów ze względu na REML" # nlme/R/lme.R: 2097 # gettext("Nonlinear mixed-effects model fit by maximum likelihood", domain = "R-nlme") # nlme/R/lme.R: 2166 # gettext("Nonlinear mixed-effects model fit by maximum likelihood", domain = "R-nlme") #~ msgid "Nonlinear mixed-effects model fit by maximum likelihood" #~ msgstr "" #~ "Nieliniowe dopasowanie modelu mieszanych efektów ze względu na maksimum " #~ "funkcji wiarygodności" # nlme/R/lme.R: 2102 # gettext("Linear mixed-effects model fit by REML", domain = "R-nlme") # nlme/R/lme.R: 2171 # gettext("Linear mixed-effects model fit by REML", domain = "R-nlme") #~ msgid "Linear mixed-effects model fit by REML" #~ msgstr "Liniowe dopasowanie modelu mieszanych efektów ze względnu na REML" # nlme/R/lme.R: 2104 # gettext("Linear mixed-effects model fit by maximum likelihood", domain = "R-nlme") # nlme/R/lme.R: 2173 # gettext("Linear mixed-effects model fit by maximum likelihood", domain = "R-nlme") #~ msgid "Linear mixed-effects model fit by maximum likelihood" #~ msgstr "" #~ "Liniowe dopasowanie model mieszanych efektów ze względu na maksimum " #~ "funkcji wiarygodności" # nlme/R/lme.R: 2118 # gettext(" Fixed: ", domain = "R-nlme") #~ msgid "Fixed:" #~ msgstr "Ustalone:" # nlme/R/lme.R: 2125 # gettext("Number of Observations: ", domain = "R-nlme") # nlme/R/lme.R: 2213 # gettext("Number of Observations: ", domain = "R-nlme") #~ msgid "Number of Observations:" #~ msgstr "Liczba obserwacji:" # nlme/R/lme.R: 2126 # gettext("Number of Groups: ", domain = "R-nlme") # nlme/R/lme.R: 2214 # gettext("Number of Groups: ", domain = "R-nlme") #~ msgid "Number of Groups:" #~ msgstr "Liczba brup:" # nlme/R/lme.R: 2211 # gettext("Standardized Within-Group Residuals:", domain = "R-nlme") #~ msgid "Standardized Within-Group Residuals:" #~ msgstr "Ustandaryzowane reszty wewnątrz grupy:" # nlme/R/modelStruct.R: 62 # gettextf("%s parameters:", i, domain = "R-nlme") #~ msgid "%s parameters:" #~ msgstr "parametry %s:" # nlme/R/newFunc.R: 148 # stop(gettextf("only one level allowed in %s function", sQuote("gapply"))) # nlme/R/newFunc.R: 228 # stop(gettextf("only one level allowed in %s function", sQuote("gsummary"))) #~ msgid "only one level allowed in %s function" #~ msgstr "tylko jeden poziom jest dozwolony w funkcji %s" # nlme/R/newFunc.R: 169 # stop(gettextf("'%s' argument can only be character or integer", "which")) #~ msgid "'%s' argument can only be character or integer" #~ msgstr "argument '%s' może być jedynie znakiem lub liczbą całkowitą" # nlme/R/newMethods.R: 74 # stop(gettextf("'%s' argument can only be a formula or a list of formulae", "form")) # nlme/R/pdMat.R: 170 # stop(gettextf("'%s' argument can only be a formula or a list of formulae", "form")) #~ msgid "'%s' argument can only be a formula or a list of formulae" #~ msgstr "argument '%s' może być jedynie formułą lub listą formuł" # nlme/R/newMethods.R: 475 # gettext("Lag", domain = "R-nlme") #~ msgid "Lag" #~ msgstr "Opóźnienie" #~ msgid "Autocorrelation" #~ msgstr "Autokorelacja" # nlme/R/newMethods.R: 603 # gettext("Distance", domain = "R-nlme") #~ msgid "Distance" #~ msgstr "Odległość" #~ msgid "Semivariogram" #~ msgstr "Semiwariogram" # nlme/R/newMethods.R: 815 # stop(gettextf("'%s' and '%s' arguments have incompatible lengths", "distance", "object")) # nlme/R/pdMat.R: 1753 # stop(gettextf("'%s' and '%s' arguments have incompatible lengths", "form", "nam")) # nlme/R/pdMat.R: 1766 # stop(gettextf("'%s' and '%s' arguments have incompatible lengths", "form", "pdClass")) # nlme/R/pdMat.R: 1769 # stop(gettextf("'%s' and '%s' arguments have incompatible lengths", "nam", "pdClass")) #~ msgid "'%s' and '%s' arguments have incompatible lengths" #~ msgstr "argumenty '%s' oraz '%s' mają niezgodne długości" # nlme/R/nlme.R: 843 # gettextf("LME step: Loglik: %s, nlm iterations: %d", format(nlmeFit$logLik), convIter, domain = "R-nlme") #~ msgid "LME step: Loglik: %s, nlm iterations: %d" #~ msgstr "krok LME: Logarytm funkcji wiarygodności: %s, iteracje nlm: %d" #~ msgid "PNLS step: RSS = %s" #~ msgstr "krok PNLS: RSS = %s" # nlme/R/pdMat.R: 90 # warning(gettextf("ignoring argument '%s'", "form")) # nlme/R/pdMat.R: 98 # warning(gettextf("ignoring argument '%s'", "nam")) # nlme/R/pdMat.R: 133 # warning(gettextf("ignoring argument '%s'", "form")) #~ msgid "ignoring argument '%s'" #~ msgstr "ignorowanie argumentu '%s'" # nlme/R/pdMat.R: 436 # gettextf("Positive definite matrix structure of class %s representing", dQuote(class(x)[1]), domain = "R-nlme") #~ msgid "Positive definite matrix structure of class %s representing" #~ msgstr "Struktura dodatnio określonej macierzy klasy reprezentującej %s" # nlme/R/pdMat.R: 439 # gettextf("Uninitialized positive definite matrix structure of class %s.", dQuote(class(x)[1]), domain = "R-nlme") #~ msgid "Uninitialized positive definite matrix structure of class %s." #~ msgstr "" #~ "Niezainicjalizowana struktura dodatnio określonej macierzy klasy %s" # nlme/R/varFunc.R: 135 # gettext(" Structure: ", domain = "R-nlme") # nlme/R/pdMat.R: 476 # gettext(" Structure: ", domain = "R-nlme") #~ msgid "Structure:" #~ msgstr "Struktura:" # nlme/R/pdMat.R: 510 # gettext(" Composite Structure: ", domain = "R-nlme") #~ msgid "Composite Structure:" #~ msgstr "Struktura złożona:" # nlme/R/pdMat.R: 1319 # stop("cannot extract the matrix from an uninitialized object") #~ msgid "cannot extract the matrix from an uninitialized object of class %s" #~ msgstr "" #~ "nie można wyodrębnić macierzy z niezainicjalizowanego obiektu klasy %s" # nlme/R/reStruct.R: 191 # stop(gettextf("cannot change parameter length of initialized object of class %s", dQuote("reStruct"))) # nlme/R/varFunc.R: 1191 # stop(gettextf("cannot change parameter length of initialized object of class %s", dQuote("varComb"))) # nlme/R/pdMat.R: 1973 # stop(gettextf("cannot change parameter length of initialized object of class %s", dQuote("pdMat"))) #~ msgid "cannot change parameter length of initialized object of class %s" #~ msgstr "" #~ "nie można zmienić długości parametru zainicjowanych obiektów klasy %s" # nlme/R/reStruct.R: 71 # stop(gettextf("'%s' argument must be a list or a formula", "object")) #~ msgid "'%s' argument must be a list or a formula" #~ msgstr "argument '%s' musi być listą lub formułą" # nlme/R/reStruct.R: 401 # gettext("Random effects estimates:", domain = "R-nlme") #~ msgid "Random effects estimates:" #~ msgstr "Oszacowania efektów losowych:" # nlme/R/reStruct.R: 407 # gettext("Uninitialized random effects structure", domain = "R-nlme") #~ msgid "Uninitialized random effects structure" #~ msgstr "Niezainicjalizowana struktura efektów losowych" # nlme/R/simulate.R: 115 # stop("order of arguments in 'simulate.lme' has changed to conform with generic in R-2.2.0", domain = "R-nlme") #~ msgid "" #~ "order of arguments in 'simulate.lme' has changed to conform with generic " #~ "in R-2.2.0" #~ msgstr "" #~ "kolejność argumentów w 'simulate.lme()' zmieniła się aby pasowała z " #~ "funkcjami ogólnymi w R-2.2.0" # nlme/R/varFunc.R: 144 # gettextf("Variance function structure of class %s with no parameters, or uninitialized", dQuote(class(x)[1]), domain = "R-nlme") # nlme/R/varFunc.R: 156 # gettextf("Variance function structure of class %s with no parameters, or uninitialized", dQuote(class(x)[1]), domain = "R-nlme") #~ msgid "" #~ "Variance function structure of class %s with no parameters, or " #~ "uninitialized" #~ msgstr "" #~ "Struktura funkcji wariancji klasy %s bez parametrów lub " #~ "niezainicjalizowana" # nlme/R/varFunc.R: 153 # gettextf("Variance function structure of class %s representing", dQuote(class(x)[1]), domain = "R-nlme") #~ msgid "Variance function structure of class %s representing" #~ msgstr "Struktura funkcji wariancji klasy reprezentującej %s" # nlme/R/varFunc.R: 202 # stop("'form' argument must have a covariate") #~ msgid "'%s' argument must have a covariate" #~ msgstr "argument '%s' musi posiadać zmienną niezależną" # nlme/R/varFunc.R: 241 # gettext(" Structure: fixed weights", domain = "R-nlme") #~ msgid "Structure: fixed weights" #~ msgstr "Struktura: ustalone wagi" # nlme/R/varFunc.R: 335 # stop(gettextf("cannot change the length of the %s parameter after initialization", dQuote("varIdent"))) # nlme/R/varFunc.R: 518 # stop(gettextf("cannot change the length of the %s parameter after initialization", dQuote("varStruct"))) # nlme/R/varFunc.R: 730 # stop(gettextf("cannot change the length of the %s parameter after initialization", dQuote("varExp"))) #~ msgid "cannot change the length of the %s parameter after initialization" #~ msgstr "nie można zmienić długości parametru %s po jego zainicjowaniu" # nlme/R/varFunc.R: 387 # stop(gettextf("initial value for %s should be of length %d", dQuote("varIdent"), len), domain = "R-nlme") # nlme/R/varFunc.R: 582 # stop(gettextf("initial value for %s should be of length %d", dQuote("varPower"), nStratVar), domain = "R-nlme") # nlme/R/varFunc.R: 624 # stop(gettextf("initial value for %s should be of length %d", dQuote("varPower"), 1), domain = "R-nlme") # nlme/R/varFunc.R: 792 # stop(gettextf("initial value for %s should be of length %d", dQuote("varExp"), nStratVar), domain = "R-nlme") # nlme/R/varFunc.R: 834 # stop(gettextf("initial value for %s should be of length %d", dQuote("varExp"), 1), domain = "R-nlme") #~ msgid "initial value for %s should be of length %d" #~ msgstr "początkowa wartość dla %s powinna być długości %d" # nlme/R/varFunc.R: 397 # stop(gettextf("nonexistent group names for initial values in %s", dQuote("varIdent"))) # nlme/R/varFunc.R: 587 # stop(gettextf("nonexistent group names for initial values in %s", dQuote("varPower"))) # nlme/R/varFunc.R: 797 # stop(gettextf("nonexistent group names for initial values in %s", dQuote("varExp"))) #~ msgid "nonexistent group names for initial values in %s" #~ msgstr "nieistniejące nazwy grup dla początkowych wartości w %s" # nlme/R/varFunc.R: 471 # stop(gettextf("fixed parameters must have group names in %s function", sQuote("varPower()"))) # nlme/R/varFunc.R: 556 # stop(gettextf("fixed parameters must have group names in %s function", sQuote("Initialize.varPower()"))) # nlme/R/varFunc.R: 684 # stop(gettextf("fixed parameters must have group names in %s function", sQuote("varExp()"))) # nlme/R/varFunc.R: 766 # stop(gettextf("fixed parameters must have group names in %s function", sQuote("Initialize.varExp()"))) # nlme/R/varFunc.R: 1045 # stop(gettextf("fixed parameters must have group names in %s function", sQuote("Initialize.varConstPower()"))) #~ msgid "fixed parameters must have group names in %s function" #~ msgstr "ustalone parametry muszą posiadać nazwy grup w funkcji %s" # nlme/R/varFunc.R: 1124 # gettext("Constant plus power of variance covariate") #~ msgid "Constant plus power of variance covariate" #~ msgstr "Stała plus potęga zmiennej niezależnej wariancji" # nlme/R/varFunc.R: 1232 # gettext("Combination of:", domain = "R-nlme") #~ msgid "Combination of:" #~ msgstr "Kombinacje:" # nlme/R/varFunc.R: 1246 # gettext("Combination of variance functions:", domain = "R-nlme") #~ msgid "Combination of variance functions:" #~ msgstr "Kombinacja funkcji wariancji:" # nlme/R/gls.R: 882 # stop(sprintf(ngettext(sum(wch), # "level %s is not allowed for %s", # "levels %s are not allowed for %s", domain = "R-nlme"), # paste(levs[wch], collapse = ", ")), domain = NA) # nlme/R/gnls.R: 694 # stop(sprintf(ngettext(sum(wch), # "level %s is not allowed for %s", # "levels %s are not allowed for %s", domain = "R-nlme"), # paste(levs[wch], collapse = ", ")), domain = NA) # nlme/R/nlme.R: 1178 # stop(sprintf(ngettext(sum(wch), # "level %s is not allowed for %s", # "levels %s ares not allowed for %s", domain = "R-nlme"), # paste(levs[wch], collapse = ", ")), domain = NA) # nlme/R/lme.R: 1934 # stop(sprintf(ngettext(sum(wch), # "level %s is not allowed for %s", # "levels %s are not allowed for %s", domain = "R-nlme"), # paste(levs[wch], collapse = ", ")), # domain = NA) #~ msgid "level %s is not allowed for %s" #~ msgid_plural "levels %s are not allowed for %s" #~ msgstr[0] "poziom %s nie jest dozwolony dla %s" #~ msgstr[1] "poziomy %s nie są dozwolone dla %s" #~ msgstr[2] "poziomy %s nie są dozwolone dla %s" # nlme/R/newMethods.R: 288 # stop(sprintf(ngettext(sum(naV), # "%s was not found in data", # "%s were not found in data", domain = "R-nlme"), # allV[naV]), domain = NA) # nlme/R/newMethods.R: 708 # stop(sprintf(ngettext(sum(naV), # "%s was not found in data", # "%s were not found in data", domain = "R-nlme"), # allV[naV]), domain = NA) # nlme/R/lme.R: 1445 # stop(sprintf(ngettext(sum(naV), # "%s was not found in data", # "%s were not found in data", domain = "R-nlme"), # allV[naV]), domain = NA) # nlme/R/lme.R: 2252 # stop(sprintf(ngettext(sum(naV), # "%s was not found in data", # "%s were not found in data", domain = "R-nlme"), # allV[naV]), domain = NA) # nlme/R/lmList.R: 405 # stop(sprintf(ngettext(sum(naV), # "%s was not found in data", # "%s were not found in data", domain = "R-nlme"), # allV[naV]), domain = NA) # nlme/R/lmList.R: 665 # stop(sprintf(ngettext(sum(naV), # "%s was not found in data", # "%s were not found in data", domain = "R-nlme"), # allV[naV]), domain = NA) # nlme/R/lmList.R: 1046 # stop(sprintf(ngettext(sum(naV), # "%s was not found in data", # "%s were not found in data", domain = "R-nlme"), # allV[naV]), domain = NA) #~ msgid "%s was not found in data" #~ msgid_plural "%s were not found in data" #~ msgstr[0] "%s nie został znaleziony w danych" #~ msgstr[1] "%s nie zostały znalezione w danych" #~ msgstr[2] "%s nie zostały znalezione w danych" # nlme/R/newFunc.R: 157 # stop(sprintf(ngettext(sum(wchNot), # "%s value was not matched", # "%s values were not matched", domain = "R-nlme"), # paste(which[wchNot], collapse = ", ")), # domain = NA) #~ msgid "%s value was not matched" #~ msgid_plural "%s values were not matched" #~ msgstr[0] "wartość %s nie została dopasowana" #~ msgstr[1] "wartości %s nie zostały dopasowane" #~ msgstr[2] "wartości %s nie zostały dopasowane" # nlme/R/corStruct.R: 1888 # stop("'data' argument is required in order to calculate covariate") #~ msgid "'data' argument is required in order to calculate covariate" #~ msgstr "" #~ "wymagany jest argument 'data' w celu obliczenia zmiennej wyjaśniającej " #~ "obiektu klasy \"corStruct\"" #~ msgid "'%d' argument must be between %d and %d" #~ msgstr "argument '%s' musi być pomiędzy %d a %d" #~ msgid "Random Effects:" #~ msgstr "Efekty losowe:" #, fuzzy #~ msgid "'%s' is of incorrect length" #~ msgstr "argument '%s' ma niepoprawną długość" #~ msgid "'%s' argument must be between 1 and %d" #~ msgstr "argument '%s' musi być pomiędzy 1 a %d" #, fuzzy #~ msgid "'%s' argument must be between 0 and 1" #~ msgstr "argument 'id' musi być pomiędzy 0 a 1" #~ msgid "Parameter estimate(s):" #~ msgstr "Oszacowania parametrów:" #, fuzzy #~ msgid "'which' argument must be between 1 and %d" #~ msgstr "argument 'Terms' musi być pomiędzy 1 a %d" #, fuzzy #~ msgid "Correlation structure of class \"corSymm\" representing" #~ msgstr "Struktura korelacji klasy %s reprezentującej" #, fuzzy #~ msgid "Unitialized correlation structure of class \"corSymm\"" #~ msgstr "Niezainicjalizowana struktura korelacji klasy %s" #, fuzzy #~ msgid "Correlation structure of class \"corNatural\" representing" #~ msgstr "Struktura korelacji klasy %s reprezentującej" #, fuzzy #~ msgid "Unitialized correlation structure of class \"corNatural\"" #~ msgstr "Niezainicjalizowana struktura korelacji klasy %s" #~ msgid "'object' argument is not an object of class \"gls\"" #~ msgstr "argument 'object' nie jest obiektem klasy \"gls\"" #~ msgid "'form' argument is not an object of class \"formula\"" #~ msgstr "argument 'form' nie jest obiektem klasy \"fomula\"" #~ msgid "'object' argument is not an object of class \"data.frame\"" #~ msgstr "argument 'object' nie jest obiektem klasy \"data.frame\"" #~ msgid "'value' argument is not an object of class \"formula\"" #~ msgstr "argument 'value' nie jest obiektem klasy \"formula\"" #, fuzzy #~ msgid "'object' argument is not an object of class \"formula\"" #~ msgstr "argument 'form' nie jest obiektem klasy \"fomula\"" #, fuzzy #~ msgid "Unitialized correlation structure of class corSymm" #~ msgstr "Niezainicjalizowana struktura korelacji klasy %s" #, fuzzy #~ msgid "Unitialized correlation structure of class corNatural" #~ msgstr "Niezainicjalizowana struktura korelacji klasy %s" nlme/po/R-de.po0000644000176200001440000013576113450712326012772 0ustar liggesusers# Translation of R-nlme.pot to German # Copyright (C) 2007-2014 The R Foundation # This file is distributed under the same license as the nlme package. msgid "" msgstr "" "Project-Id-Version: R 3.6.0 / nlme-3.1-137\n" "Report-Msgid-Bugs-To: bugs@r-project.org\n" "POT-Creation-Date: 2019-04-02 18:40\n" "PO-Revision-Date: 2019-04-02 11:18+0200\n" "Last-Translator: Detlef Steuer \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "not implemented for \"nlme\" objects" msgstr "nicht für \"nlme\"-Objekte implementiert" msgid "not implemented for multiple levels of nesting" msgstr "nicht für mehrstufige Schachtelung implementiert" msgid "individual %s was not used in the fit" msgstr "Individuum %s wurde in der Anpassung nicht benutzt." # R/corStruct.R msgid "do not know how to calculate correlation matrix of %s object" msgstr "" "Es ist nicht bekannt, wie die Korrelationsmatrix des Objekts %s berechnet " "wird." msgid "\"corStruct\" object must have a \"fixed\" attribute" msgstr "\"corStruct\"-Objekt muss ein \"fixed\"-Attribut haben." msgid "do not know how to obtain parameters of %s object" msgstr "Es ist nicht bekannt, wie Parameter des Objekts %s abgefragt werden." msgid "cannot change the length of the parameter of a \"corStruct\" object" msgstr "" "Die Länge des Parameters eines \"corStruct\"-Objekts kann nicht geändert " "werden." msgid "" "'sumLenSq := sum(table(groups)^2)' = %g is too large.\n" " Too large or no groups in your correlation structure?" msgstr "" "'sumLenSq := sum(table(groups)^2)' = %g ist zu groß.\n" " Zu große oder keine Gruppen in der Korrelationsstrujtur? " msgid "cannot change 'form'" msgstr "'form' kann nicht geändert werden." msgid "need data to calculate covariate of \"corStruct\" object" msgstr "" "Zur Berechnung der Kovariate des \"corStruct\"-Objekts werden Daten benötigt." msgid "cannot change the length of the parameter of a \"corSymm\" object" msgstr "" "Die Länge des Parameters eines \"corSymm\"-Objekts kann nicht geändert " "werden." # http://www.sozpsy.uni-hannover.de/marienthal/glossar/html/k37.htm msgid "covariate must have unique values within groups for \"corSymm\" objects" msgstr "" "Kovariate muss eindeutige Werte innerhalb der Gruppen für \"corSymm\"-" "Objekte haben." msgid "" "unique values of the covariate for \"corSymm\" objects must be a sequence " "of consecutive integers" msgstr "" "Eindeutige Werte der Kovariate für \"corSymm\"-Objekte müssen eine\n" "Sequenz von aufeinander folgenden ganzen Zahlen sein." msgid "initial value for \"corSymm\" parameters of wrong dimension" msgstr "Anfangswert für \"corSymm\"-Parameter hat falsche Dimension" msgid "initial values for \"corSymm\" must be between -1 and 1" msgstr "Anfangswerte für \"corSymm\" müssen zwischen -1 und 1 liegen." msgid "" "initial values for \"corSymm\" do not define a positive-definite correlation " "structure" msgstr "" "Anfangswerte für \"corSymm\" definieren keine positiv-definite " "Korrelationsstruktur." msgid "cannot change the length of the parameter of a \"corNatural\" object" msgstr "" "Die Länge des Parameters eines \"corNatural\"-Objekts kann nicht geändert " "werden." msgid "" "covariate must have unique values within groups for \"corNatural\" objects" msgstr "" "Kovariate muss eindeutige Werte innerhalb der Gruppen für \"corNatural-" "Objekte\" haben." msgid "" "unique values of the covariate for \"corNatural\" objects must be a sequence " "of consecutive integers" msgstr "" "Eindeutige Werte der Kovariate für \"corNatural\"-Objekte müssen eine\n" "Sequenz von aufeinanderfolgenden ganzen Zahlen sein" msgid "initial value for \"corNatural\" parameters of wrong dimension" msgstr "Anfangswert für \"corNatural\"-Parameter hat falsche Dimension" msgid "initial values for \"corNatural\" must be between -1 and 1" msgstr "Anfangswerte für \"corNatural\" müssen zwischen -1 und 1 liegen." msgid "" "initial values for \"corNatural\" do not define a positive-definite " "correlation structure" msgstr "" "Anfangswerte für \"corNatural\" definieren keine positiv-definite " "Korrelationsstruktur." msgid "parameter in AR(1) structure must be between -1 and 1" msgstr "Parameter in AR(1)-Struktur muss zwischen -1 und 1 liegen" msgid "'sumLenSq' = %g is too large (larger than maximal integer)" msgstr "'sumLenSq' = %g ist zu groß (größer als maximale Integerzahl)" msgid "cannot change the length of the parameter of a \"corAR1\" object" msgstr "" "Die Länge des Parameters eines \"corAR1\"-Objekts kann nicht geändert werden." # http://www.sozpsy.uni-hannover.de/marienthal/glossar/html/k37.htm msgid "covariate must have unique values within groups for \"corAR1\" objects" msgstr "" "Kovariate muss eindeutige Werte innerhalb der Gruppen für \"corAR1-Objekte\" " "haben." msgid "parameter in CAR(1) structure must be between 0 and 1" msgstr "Parameter in CAR(1)-Struktur muss zwischen 0 und 1 liegen." msgid "cannot change the length of the parameter of a \"corCAR1\" object" msgstr "" "Die Länge des Parameters eines \"corCAR1\"-Objekts kann nicht geändert " "werden." # http://www.sozpsy.uni-hannover.de/marienthal/glossar/html/k37.htm msgid "covariate must have unique values within groups for \"corCAR1\" objects" msgstr "" "Kovariate muss eindeutige Werte innerhalb der Gruppen für \"corCAR1-Objekte" "\" haben." msgid "autoregressive order must be a non-negative integer" msgstr "Autoregressive Ordnung muss eine nicht-negative Ganzzahl sein." msgid "moving average order must be a non-negative integer" msgstr "" "Ordnung des gleitenden Durchschnitts muss eine nicht-negative Ganzzahl sein." msgid "initial value for parameter of wrong length" msgstr "Anfangswerte für Parameter hat falsche Länge" msgid "parameters in ARMA structure must be < 1 in absolute value" msgstr "Parameter in ARMA-Struktur müssen vom Betrag < 1 sein." msgid "'object' has not been Initialize()d" msgstr "Initialize() wurde nicht für »object« ausgeführt" msgid "cannot change the length of the parameter of a \"corARMA\" object" msgstr "" "Die Länge des Parameters eines \"corARMA\"-Objekts kann nicht geändert " "werden." # http://www.sozpsy.uni-hannover.de/marienthal/glossar/html/k37.htm msgid "covariate must have unique values within groups for \"corARMA\" objects" msgstr "" "Kovariate muss eindeutige Werte innerhalb der Gruppen für \"corARMA-Objekte" "\" haben." msgid "parameter in \"corCompSymm\" structure must be < 1 in absolute value" msgstr "Parameter in \"corCompSymm\"-Struktur muss vom Betrag < 1 sein." msgid "cannot change the length of the parameter of a \"corCompSymm\" object" msgstr "" "Die Länge des Parameters eines \"corCompSymm\"-Objekts kann nicht geändert " "werden." msgid "initial value in \"corCompSymm\" must be greater than %s" msgstr "Anfangswert in \"corCompSymm\" muss größer als %s sein." msgid "cannot change the length of the parameter after initialization" msgstr "" "Länge des Parameters kann nach der Initialisierung nicht geändert werden." msgid "need data to calculate covariate" msgstr "Um Kovariate zu berechnen, werden Daten benötigt." msgid "cannot have zero distances in \"corSpatial\"" msgstr "Es darf keine Null-Distanzen in \"corSpatial\" geben" msgid "'range' must be > 0 in \"corSpatial\" initial value" msgstr "'range' muss im \"corSpatial\"-Anfangswert > 0 sein." msgid "initial value for \"corSpatial\" parameters of wrong dimension" msgstr "Anfangswert des Parameters \"corSpatial\" hat falsche Dimension" msgid "initial value of nugget ratio must be between 0 and 1" msgstr "Anfangswert des Nugget-Anteils muss zwischen 0 und 1 liegen" msgid "'range' must be > 0 in \"corLin\" initial value" msgstr "'range' im \"corLin\"-Anfangswert muss > 0 sein" msgid "" "initial value for 'range' less than minimum distance. Setting it to 1.1 * " "min(distance)" msgstr "" "Anfangswert für 'range' kleiner als minimale Distanz. Er wird auf 1.1 * min " "(distance) gesetzt." msgid "initial value for \"corLin\" parameters of wrong dimension" msgstr "Anfangswert für Parameter \"corLin\" hat falsche Dimension." msgid "range must be > 0 in \"corSpher\" initial value" msgstr "Spannweite im \"corSpher\"-Anfangswert muss > 0 sein." msgid "initial value for \"corSpher\" parameters of wrong dimension" msgstr "Anfangswert für Parameter \"corSpher\" hat falsche Dimension" msgid "model must be a formula of the form \"resp ~ pred\"" msgstr "Modell muss eine Formel der Form \"resp ~ pred\" sein." msgid "no coefficients to fit" msgstr "keine Koeffizienten anzupassen" msgid "maximum number of iterations reached without convergence" msgstr "maximale Anzahl der Iterationen ohne Konvergenz erreicht" msgid "computed \"gls\" fit is singular, rank %s" msgstr "errechneter \"gls\"-Fit ist singulär, Rang %s" msgid "object must inherit from class \"gls\"" msgstr "Objekt muss von der Klasse \"gls\" abgeleitet sein." msgid "'Terms' must be between 1 and %d" msgstr "'Terms' müssen zwischen 1 und %d liegen." msgid "terms can only be integers or characters" msgstr "Terme können nur Ganzzahlen oder Zeichen sein" msgid "data in %s call must evaluate to a data frame" msgstr "Daten im %s-Aufruf müssen einen Dataframe ergeben" msgid "" "%s without \"primary\" can only be used with fits of \"groupedData\" objects" msgstr "" "%s ohne \"primary\" kann nur für Anpassungen von \"groupedData\"-Objekten " "genutzt werden." msgid "only one level allowed for predictions" msgstr "nur eine Stufe für Vorhersagen erlaubt" msgid "%s and %s must have the same group levels" msgstr "%s und %s müssen die gleichen Gruppenstufen haben" msgid "wrong group levels" msgstr "falsche Gruppenstufen" msgid "cannot get confidence intervals on var-cov components: %s" msgstr "" "Konfidenzintervalle für var-cov-Komponenten können nicht bestimmt werden: %s" msgid "need an object with call component" msgstr "ein Objekt mit Aufruf-Komponenten wird benötigt" msgid "'nint' is not consistent with 'breaks'" msgstr "'nint' ist nicht konsistent mit 'breaks'" msgid "Within-group std. dev. must be a positive numeric value" msgstr "SD innerhalb der Gruppe muss positiver numerischer Wert sein" msgid "'object' must be a formula" msgstr "'object' muss eine Formel sein" msgid "object formula must be of the form \"resp ~ pred\"" msgstr "Objekt-Formel muss von der Form \"resp ~ pred\" sein" msgid "'data' must be given explicitly to use 'nls' to get initial estimates" msgstr "" "'data' muss explizit angegeben werden, um 'nls' zum Gewinnen von " "Initialschätzungen zu nutzen." msgid "no initial values for model parameters" msgstr "keine Anfangswerte für Modellparameter" msgid "starting estimates must have names when 'params' is missing" msgstr "Startschätzung muss Namen haben, wenn 'params' fehlt" msgid "'params' must be a formula or list of formulae" msgstr "'params' müssen eine Formel oder eine Liste von Formeln sein." msgid "formulae in 'params' must be of the form \"parameter ~ expr\"" msgstr "Formeln in 'params' müssen die Form \"parameter ~ expr\" haben." msgid "starting values for parameters are not of the correct length" msgstr "Startwerte für Parameter haben nicht die richtige Länge." msgid "cannot calculate REML log-likelihood for \"gnls\" objects" msgstr "REML Log-likelihood für \"gnls\"-Objekte kann nicht berechnet werden" msgid "first argument to 'groupedData' must be a two-sided formula" msgstr "erstes Argument für 'groupedData' muss eine zweiseitige Formel sein" msgid "right-hand side of first argument must be a conditional expression" msgstr "rechte Seite des ersten Arguments muss ein bedingter Ausdruck sein" msgid "first argument to 'nfGroupedData' must be a two-sided formula" msgstr "erstes Argument für 'nfGroupedData' muss eine zweiseitige Formel sein" msgid "only one level of grouping allowed" msgstr "nur eine Stufe der Gruppierung erlaubt" msgid "second argument to 'groupedData' must inherit from data.frame" msgstr "zweites Argument für 'groupedData' muss von data.frame erben" msgid "first argument to 'nmGroupedData' must be a two-sided formula" msgstr "erstes Argument für 'nmGroupedData' muss eine zweiseitige Formel sein" msgid "single group not supported -- use groupedData()" msgstr "" msgid "'subset' ignored with single grouping factor" msgstr "'subset' mit einzelnem Gruppierungsfaktor ignoriert" msgid "'subset' must be a list" msgstr "'subset' muss eine Liste sein" msgid "undefined group declared in 'subset'" msgstr "undefinierte Gruppe in 'subset' deklariert" msgid "only one display level allowed" msgstr "nur eine Anzeigestufe erlaubt" msgid "undefined display level %s for %s" msgstr "undefinierte Anzeigestufe %s für %s" msgid "undefined collapsing level %s for %s" msgstr "Collapsing-Stufe %s für %s nicht definiert" msgid "" "collapsing level cannot be smaller than display level; setting it to the " "display level" msgstr "" "Die Collapsing-Stufe kann nicht kleiner sein, als die Anzeigestufe; sie wird " "auf die Anzeigestufe gesetzt." msgid "'preserve' must be a two-sided formula" msgstr "'preserve' muss eine zweiseitige Formel sein" msgid "'asTable' cannot be used with multilevel grouped data" msgstr "'asTable' kann nicht mit mehrstufig gruppierten Daten benutzt werden" msgid "'asTable' can only be used with balanced 'groupedData' objects" msgstr "" "'asTable' kann nur mit balancierten 'groupedData'-Objekten benutzt werden" msgid "%d errors caught in %s. The error messages and their frequencies are" msgstr "" "%d Fehler abgefangen in %s. Die Fehlermeldungen und ihre Häufigkeiten sind" #, fuzzy msgid "'data' argument not used, but taken from groupedData object" msgstr "zweites Argument muss ein groupedData-Objekt sein" msgid "multiple levels not allowed" msgstr "mehrere Stufen nicht erlaubt" msgid "'data' must be a \"groupedData\" object if 'groups' argument is missing" msgstr "" "'data' muss ein \"groupedData\"-Objekt sein, falls 'groups'-Argument fehlt" msgid "'data' in %s call must evaluate to a data frame" msgstr "'data' in %s muss sich zu einem Dataframe berechnen" msgid "nonexistent groups requested in 'subset'" msgstr "nicht existierende Gruppen in 'subset' angefordert" msgid "'subset' can only be character or integer" msgstr "'subset' kann nur ein Zeichen oder eine ganze Zahl sein" msgid "log-likelihood not available with NULL fits" msgstr "Log-likelihood nicht mit NULL-Fit verfügbar" msgid "'form' must be a formula" msgstr "'form' muss eine Formel sein" msgid "'form' must be a one-sided formula" msgstr "'form' muss eine einseitige Formel sein" msgid "covariate must be a data frame" msgstr "Kovariate muss ein Dataframe sein" msgid "cannot do pairs of just one variable" msgstr "kann pairs nicht mit nur einer Variablen durchführen" msgid "'id' must be between 0 and 1" msgstr "'id' muss zwischen 0 und 1 liegen" msgid "'id' can only be a formula or numeric" msgstr "'id' kann nur eine Formel oder numerisch sein." msgid "'idLabels' of incorrect length" msgstr "'idLabels' hat falsche Länge" msgid "'idLabels' can only be a formula or a vector" msgstr "'idLabels' kann nur eine Formel oder eine Vektor sein." msgid "covariate must be numeric" msgstr "Kovariate muss numerisch sein" msgid "nonexistent group in 'newdata'" msgstr "nicht existierende Gruppe in 'newdata'" msgid "nonexistent group requested in 'subset'" msgstr "nicht existierende Gruppe in 'subset' angefordert." msgid "only residuals and random effects allowed" msgstr "nur Residuen und zufällige Effekte erlaubt" msgid "can only fit \"lmList\" objects with single grouping variable" msgstr "" "Nur \"lmList\"-Objekte mit einzelner Gruppenvariable können angepasst werden." msgid "'lme.lmList' will redefine 'data'" msgstr "'lme.lmList' wird 'data' redefinieren" msgid "initial value for \"reStruct\" overwritten in 'lme.lmList'" msgstr "Anfangswert für \"reStruct\" in 'lme.lmList' überschrieben" msgid "fixed-effects model must be a formula of the form \"resp ~ pred\"" msgstr "Feste-Effekte-Modell muss eine Formel der Form \"resp ~ pred\" sein." msgid "incompatible lengths for 'random' and grouping factors" msgstr "inkompatible Längen für 'random' und Gruppierungsfaktoren" msgid "incompatible formulas for groups in 'random' and 'correlation'" msgstr "inkompatible Formeln für Gruppen in 'random' und 'correlation'" msgid "" "cannot use smaller level of grouping for 'correlation' than for 'random'. " "Replacing the former with the latter." msgstr "" "Für die Gruppierung von 'correlation' kann keine kleinere Stufe als für " "'random' benutzt werden. Ersteres wird durch letzteres ersetzt." msgid "fewer observations than random effects in all level %s groups" msgstr "" "weniger Beobachtungen als zufällige Effekte in allen Gruppen der Stufe %s" msgid "" "%s problem, convergence error code = %s\n" " message = %s" msgstr "" "%s Problem, Konvergenzfehlerkode = %s\n" " Nachricht = %s" msgid "" "maximum number of iterations (lmeControl(maxIter)) reached without " "convergence" msgstr "" "maximale Anzahl der Iterationen (lmeControl(maxIter)) ohne Konvergenz " "erreicht" msgid "object must inherit from class \"lme\"" msgstr "Objekt muss von der Klasse \"lme\" erben" msgid "terms must all have the same denominator DF" msgstr "Terme müssen alle den gleichen Freiheitsgrad im Nenner haben" msgid "L may only involve fixed effects with the same denominator DF" msgstr "L kann nur feste Effekte mit dem gleichen Nenner DF einschließen" msgid "objects must inherit from classes %s, or %s" msgstr "Objekte müssen von den Klassen %s oder %s erben" msgid "" "some fitted objects deleted because response differs from the first model" msgstr "" "einige gefittete Objekte gelöscht, da Antwort vom ersten Modell abweicht" msgid "first model has a different response from the rest" msgstr "erstes Modell hat eine vom Rest abweichende Antwort" msgid "all fitted objects must have the same estimation method" msgstr "Alle gefitteten Objekte müssen die gleiche Schätzungsmethode haben." msgid "" "fitted objects with different fixed effects. REML comparisons are not " "meaningful." msgstr "" "Gefittete Objekte mit unterschiedlichen festen Effekten. REML\n" "Vergleiche haben keine Bedeutung." msgid "objects must have a \"call\" component or attribute" msgstr "Objekte müssen eine \"call\"-Komponente oder -Attribut haben." msgid "all fitted objects must use the same number of observations" msgstr "" "Alle gefitteten Objekte müssen die gleiche Zahl von Beobachtungen benutzen." msgid "only single level allowed" msgstr "nur einzelne Stufe erlaubt" msgid "" "cannot get confidence intervals on var-cov components: %s\n" " Consider '%s'" msgstr "" "Konfidenzintervalle für var-cov-Komponenten können nicht bestimmt werden: " "%s\n" " Evtl. '%s'" msgid "covariate must have a level attribute when groups are present" msgstr "Kovariate muss ein Stufenattribut haben, wenn Gruppen vorhanden sind" msgid "covariate must have a level attribute when 'id' is a formula" msgstr "Kovariate muss ein Stufenattribut haben, wenn 'id' eine Formel ist" msgid "covariate must have a level attribute when 'idLabels' is a formula" msgstr "" "Kovariate muss ein Stufenattribut haben, wenn 'idLabels' eine Formel ist" msgid "'form' must be a formula when not NULL" msgstr "'form' muss eine Formel sein, wenn nicht NULL" msgid "only single effects allowed in left side of 'form'" msgstr "nur einzelne Effekte auf der linken Seite von 'form' erlaubt" msgid "%s is not a valid effect name" msgstr "%s ist kein gültiger Effektname" msgid "no effects allowed in right side of formula" msgstr "keine Effekte auf der rechten Seite der Formel erlaubt" msgid "cannot evaluate groups for desired levels on 'newdata'" msgstr "" "Gruppen für gewünschte Stufen auf 'newdata' können nicht ausgewertet werden" msgid "'Id' must be between 0 and 1" msgstr "'Id' muss zwischen 0 und 1 liegen" # CHECKME: augmentation? msgid "augmentation of random effects only available for single level" msgstr "" "Augmentation von zufälligen Effekten ist nur für einzelne Stufe verfügbar" msgid "no condensed linear model" msgstr "kein zusammengefasstes lineares Modell" msgid "no fitted \"lme\" object" msgstr "kein angepasstes \"lme\"-Objekt" msgid "objects must have coefficients with same row names" msgstr "Objekte müssen Koeffizienten mit gleichen Zeilennamen haben." msgid "object must inherit from \"data.frame\"" msgstr "Objekt muss von \"data.frame\" erben." msgid "only one level allowed in 'gapply'" msgstr "nur eine Stufe in 'gapply' erlaubt" msgid "'which' must be between 1 and %d" msgstr "'which' muss zwischen 1 und %d liegen." msgid "'which' can only be character or integer" msgstr "'which' kann nur ein Buchstabe oder eine Ganzzahl sein." msgid "formula(object) must return a formula" msgstr "Formel(Objekt) muss eine Formel zurückgeben." msgid "'form' must be a two-sided formula" msgstr "'form' muss eine zweiseitige Formel sein." msgid "only one level allowed in 'gsummary'" msgstr "nur eine Stufe in 'gsummary' erlaubt" msgid "'FUN' can only be a function or a list of functions" msgstr "'FUN' kann nur eine Funktion oder eine Liste von Funktionen sein." msgid "cannot omit grouping factor without 'form'" msgstr "Gruppierungsfaktor ohne 'form' kann nicht weggelassen werden." msgid "object must inherit from class \"lmList\"" msgstr "Objekt muss von der Klasse \"lmList\" erben." msgid "no degrees of freedom for estimating std. dev." msgstr "keine Freiheitsgrade für Schätzung von Standardabweichung" msgid "" "data argument to \"data.frame\" method for 'getGroups' does not make sense" msgstr "" "Datenargument für \"data.frame\"-Methode für 'getGroups' nicht sinnvoll" msgid "invalid formula for groups" msgstr "ungültige Formel für Gruppen" msgid "'form' must have all components as formulas" msgstr "'form' muss alle Komponenten als Formeln enthalten." msgid "'form' can only be a formula, or a list of formulas" msgstr "'form' kann nur eine Formel oder eine Liste von Formeln sein." # R/newMethods.R msgid "level of %s does not match formula %s" msgstr "Stufe von %s passt nicht zu Formel %s" msgid "'form' argument must be a formula" msgstr "'form'-Argument muss eine Formel sein" msgid "at least two coefficients are needed" msgstr "mindestens zwei Koeffizienten werden benötigt" msgid "no model variogram available with 'showModel = TRUE'" msgstr "kein Modell-Variogramm mit 'showModel = TRUE' verfügbar" msgid "only residuals allowed" msgstr "nur Residuen erlaubt" msgid "'distance' and 'object' have incompatible lengths" msgstr "'distance' und 'object' haben inkompatible Längen" msgid "'nlme.nlsList' will redefine 'fixed', 'data', and 'start'" msgstr "'nlme.nlsList' wird 'fixed', 'data' und 'start' neu definieren" msgid "can only fit \"nlsList\" objects with single grouping variable" msgstr "" "nur \"lmList\"-Objekte mit einzelner Gruppenvariable können angepasst werden." msgid "initial value for 'reStruct' overwritten in 'nlme.nlsList'" msgstr "Anfangswert für 'reStruct' in 'nlme.nlsList' überschrieben" msgid "'model' must be a formula" msgstr "'model' muss eine Formel sein." msgid "model formula must be of the form \"resp ~ pred\"" msgstr "Modell-Formel muss die Form \"resp ~ pred\" haben." msgid "'data' must be given explicitly to use 'nlsList'" msgstr "'data' muss explizit angegeben werden, um 'nlsList' zu benutzen." # R/nlme.R msgid "'fixed' must be a formula or list of formulae" msgstr "'fixed' muss eine Formel oder eine Liste von Formeln sein." msgid "formulae in 'fixed' must be of the form \"parameter ~ expr\"" msgstr "Formeln in 'fixed' müssen die Form \"parameter ~ expr\" haben." msgid "'random' must be a formula or list of formulae" msgstr "'random' muss eine Formel oder eine Liste von Formeln sein." msgid "formulae in 'random' must be of the form \"parameter ~ expr\"" msgstr "Formeln in 'random' müssen die Form \"parameter ~ expr\" haben." msgid "incompatible formulas for groups in \"random\" and \"correlation\"" msgstr "inkompatible Formeln für Gruppen in \"random\" und \"correlation\"" msgid "" "cannot use smaller level of grouping for \"correlation\" than for \"random" "\". Replacing the former with the latter." msgstr "" "Zur Gruppierung in \"correlation\" kann keine kleinere Stufe als für \"random" "\" benutzt werden. Ersteres wird durch letzteres ersetzt." msgid "'start' must have a component called 'fixed'" msgstr "'start' muss eine Komponente mit Namen 'fixed' haben." msgid "starting values for the 'fixed' component are not the correct length" msgstr "Startwerte für die Komponente 'fixed' haben nicht die richtige Länge." msgid "starting values for random effects should be a list, or a matrix" msgstr "" "Startwerte für Zufallseffekte sollten eine Liste oder eine Matrix sein." msgid "" "list with starting values for random effects must have names or be of length " "%d" msgstr "" "Liste mit Startwerten für Zufallseffekte muss Namen haben oder %d lang sein." msgid "starting values for the random components should be a list of matrices" msgstr "" "Startwerte für Zufallskomponenten sollten eine Liste von Matrizen sein." msgid "" "number of rows in starting values for random component at level %s should be " "%d" msgstr "" "Anzahl der Zeilen in Startwerten für Zufallskomponente auf Stufe %s sollte " "%d sein." msgid "" "number of columns in starting values for random component at level %s should " "be %d" msgstr "" "Anzahl der Spalten in Startwerten für Zufallskomponente auf Stufe %s sollte " "%d sein." msgid "starting values for random effects must include group levels" msgstr "Startwerte für Zufallseffekte müssen Gruppenstufen enthalten." msgid "" "groups levels mismatch in 'random' and starting values for 'random' at level " "%s" msgstr "" "Gruppenstufen stimmen in 'random' und in den Startwerten für 'random' auf " "Stufe %s nicht überein." msgid "" "names mismatch in 'random' and starting values for 'random' at level %s" msgstr "" "Namen in 'random' und in den Startwerten für 'random' auf Stufe %s passen " "nicht " msgid "Iteration %d, LME step: nlminb() did not converge (code = %d)." msgstr "Iteration %d, LME Schritt: nlminb() hat nicht konvergiert (Kode = %d)." msgid "Do increase 'msMaxIter'!" msgstr "Bitte 'msMaxIter' erhöhen!" msgid "PORT message:" msgstr "PORT Nachricht:" msgid "Iteration %d, LME step: nlm() did not converge (code = %d)." msgstr "Iteration %d, LME Schritt: nlm() hat nicht konvergiert (Kode = %d)." msgid "maximum number of iterations (maxIter = %d) reached without convergence" msgstr "" "maximale Anzahl der Iterationen (maxIter = %d) ohne Konvergenz erreicht" msgid "second argument must be a groupedData object" msgstr "zweites Argument muss ein groupedData-Objekt sein" msgid "cannot use an anonymous function for the model" msgstr "eine anonyme Funktion kann für das Modell nicht benutzt werden" msgid "" "'data' must be a \"groupedData\" object if 'formula' does not include groups" msgstr "" "'data' muss ein \"groupedData\"-Objekt sein, wenn 'formula' keine Gruppen " "enthält." msgid "" "old-style self-starting model functions\n" "are no longer supported.\n" "New selfStart functions are available.\n" "Use\n" " SSfpl instead of fpl,\n" " SSfol instead of first.order.log,\n" " SSbiexp instead of biexp,\n" " SSlogis instead of logistic.\n" "If writing your own selfStart model, see\n" " \"help(selfStart)\"\n" "for the new form of the \"initial\" attribute." msgstr "" "Selbst-startende Model Funktionen im alten Stil\n" "werden nicht mehr unterstützt.\n" "Neue selbst-startende Funktionen sind verfügbar.\n" "Nutzen Sie\n" " SSfpl statt fpl,\n" " SSfol statt first.order.lag,\n" " SSbiexp statt biexp,\n" " SSlogis statt logistic.\n" "Um eigene selbst-startende Modelle zu implementieren,\n" "sehen Sie unter \"help(selfStart)\" die neue Form\n" "der \"initial\" Attribute nach." msgid "missing call attribute in \"nlsList\" object" msgstr "fehlendes Aufrufattribut in \"nlsList\"-Objekt" msgid "cannot access the matrix of uninitialized objects" msgstr "" "Auf die Matrix der nicht initialisierten Objekten kann nicht zugegriffen " "werden." msgid "ignoring argument 'form'" msgstr "Argument 'form' wird ignoriert" msgid "ignoring argument 'nam'" msgstr "Argument 'nam' wird ignoriert" msgid "'value' must be a square matrix" msgstr "'value' muss eine quadratische Matrix sein" msgid "dimnames of 'value' must match or be NULL" msgstr "dimnames von 'value' müssen übereinstimmen oder NULL sein" msgid "names of 'value' are not consistent with 'nam' argument" msgstr "Namen von 'value' sind nicht mit dem Argument 'nam' konsistent" msgid "%s is not a valid object for \"pdMat\"" msgstr "%s ist kein gültiges Objekt für \"pdMat\"." msgid "all elements of 'form' list must be two-sided formulas" msgstr "Alle Elemente der 'form'-Liste müssen zweiseitige Formeln sein." msgid "'form' can only be a formula or a list of formulae" msgstr "'form' kann nur eine Formel oder eine Liste von Formeln sein." msgid "'form' not consistent with 'nam'" msgstr "'form' nicht konsistent mit 'nam'" msgid "length of 'nam' not consistent with dimensions of initial value" msgstr "Länge von 'nam' nicht konsistent mit Dimensionen des Startwerts" msgid "no default method for extracting the square root of a \"pdMat\" object" msgstr "" "keine Standardmethode, um die Quadratwurzel eines \"pdMat\"-Objekts zu " "extrahieren" msgid "do not know how to obtain constrained coefficients" msgstr "" "Es ist nicht bekannt, wie eingeschränkte Koeffizienten bestimmt werden " "können." msgid "" "cannot access the number of columns of uninitialized objects without names" msgstr "" "Auf die Spaltenanzahl nicht initialisierter Objekte kann ohne Namen nicht " "zugegriffen werden." msgid "cannot extract the log of the determinant from an uninitialized object" msgstr "" "Der Logarithmus der Determinante eines nicht initialisierten Objekts kann " "nicht extrahiert werden." msgid "cannot change dimensions on an initialized \"pdMat\" object" msgstr "" "Die Dimensionen eines initialisierten \"pdMat\"-Objekts können nicht " "geändert werden." msgid "Length of names should be %d" msgstr "Länge von names sollte %d sein" msgid "" "names being assigned do not correspond to a permutation of previous names" msgstr "Zugeordnete Namen entsprechen keiner Permutation vorheriger Namen." msgid "x-y data to splom got botched somehow" msgstr "x-y-Daten an splom wurden irgendwie verpfuscht." msgid "cannot get the inverse of an uninitialized object" msgstr "Inverse eines nicht initialisierten Objekts kann nicht bestimmt werden" msgid "an object of length %d does not match the required parameter size" msgstr "" "Ein Objekt der Länge %d entspricht nicht der benötigten Parametergröße." msgid "cannot extract matrix from an uninitialized object" msgstr "" "Matrix kann nicht von einem nicht initialisierten Objekt extrahiert werden." msgid "cannot extract the inverse from an uninitialized object" msgstr "" "Inverse eines nicht initialisierten Objekts kann nicht extrahiert werden." msgid "an object of length %d does not match a Cholesky factor" msgstr "Ein Objekt der Länge %d entspricht keinem Cholesky-Faktor" msgid "cannot extract the matrix from an uninitialized object" msgstr "" "Matrix eines nicht initialisierten Objekts kann nicht extrahiert werden." msgid "cannot extract the matrix from an uninitialized \"pdIdent\" object" msgstr "" "Matrix eines nicht initialisierten \"pdIdent\"-Objekts kann nicht extrahiert " "werden." msgid "cannot extract the matrix with uninitialized dimensions" msgstr "" "Matrix mit nicht initialisierten Dimensionen kann nicht extrahiert werden." msgid "" "must give names when initializing \"pdIdent\" from parameter without a " "formula" msgstr "" "Wenn \"pdIdent\" über Parameter ohne eine Formel initialisiert wird, müssen " "Namen gegeben werden." msgid "cannot extract the dimensions" msgstr "Dimensionen können nicht extrahiert werden." msgid "cannot extract the matrix from an uninitialized \"pdCompSymm\" object" msgstr "" "Matrix eines nicht initialisierten \"pdCompSymm\"-Objekts kann nicht " "extrahiert werden" msgid "initializing \"pdCompSymm\" object is not positive definite" msgstr "Initialisierendes \"pdCompSymm\"-Objekt ist nicht positiv-definit" msgid "" "must give names when initializing \"pdCompSymm\" from parameter without a " "formula" msgstr "" "Wenn \"pdCompSymm\" über Parameter ohne eine Formel initialisiert wird, " "müssen Namen vergeben werden." msgid "cannot obtain constrained coefficients with uninitialized dimensions" msgstr "" "Eingeschränkte Koeffizienten können nicht mit nicht initialisierten " "Dimensionen nicht erlangt werden." msgid "cannot access the matrix of object without names" msgstr "Auf die Matrix des Objekts kann ohne Namen nicht zugegriffen werden." msgid "'form' must be a list" msgstr "'form' muss eine Liste sein" msgid "'nam' must be a list" msgstr "'nam' muss eine Liste sein" msgid "'form' and 'nam' have incompatible lengths" msgstr "'form' und 'nam' haben inkompatible Längen" # http://einstein.informatik.uni-oldenburg.de/rechnernetze/neue_verfahren.htm msgid "'pdClass' must be a character vector" msgstr "'pdClass' muss ein Zeichenvektor sein" msgid "'form' and 'pdClass' have incompatible lengths" msgstr "'form' und 'pdClass' haben inkompatible Längen" msgid "'nam' and 'pdClass' have incompatible lengths" msgstr "'nam' und 'pdClass' haben inkompatible Längen" # FIXME s/LNone/None/ specifies? msgid "LNone of the arguments specify more than one block" msgstr "Keines der Argumente gibt mehr als einen Block an" # R/pdMat.R msgid "'object' must be a list when not missing, not a matrix, and not numeric" msgstr "" "'object' muss eine Liste sein, wenn es nicht fehlt, keine Matrix und nicht " "numerisch." msgid "arguments imply different number of blocks" msgstr "Argumente implizieren eine unterschiedliche Zahl von Blöcken" msgid "all elements in the argument must generate \"pdMat\" objects" msgstr "Alle Elemente des Arguments müssen \"pdMat\"-Objekte generieren." msgid "cannot have duplicated column names in a \"pdMat\" object" msgstr "In \"pdMat\"-Objekten darf es keine doppelten Spaltennamen geben." msgid "must have formula when no names are given" msgstr "muss Formel haben, wenn keine Namen gegeben sind" msgid "must give names when initializing from matrix or parameter" msgstr "" "Namen müssen vergeben werden, wenn von Matrix oder Parameter initialisiert " "wird" msgid "all elements must have names when any has names" msgstr "Alle Elemente müssen Namen habe, wenn irgendeins einen Namen hat." msgid "all elements must have a non-zero size" msgstr "Alle Elemente müssen eine Größe ungleich Null haben." msgid "cannot change the parameter when length of parameters is undefined" msgstr "" "Der Parameter kann nicht geändert werden, wenn die Länge der Parameter " "undefiniert ist." msgid "cannot change parameter length of initialized \"pdMat\" object" msgstr "" "Länge des initialisierten \"pdMat\"-Objekts kann nicht geändert werden." msgid "all elements must have formulas when any has a formula" msgstr "Alle Elemente müssen Formeln habe, wenn irgendeins eine Formel hat." msgid "" "all elements of formula must be list of two-sided formulae or two-sided " "formulae" msgstr "" "Alle Elemente der Formel müssen eine Liste zweiseitiger Formeln oder " "zweiseitige Formeln sein." msgid "cannot change the number of columns on an initialized object" msgstr "" "Die Anzahl der Spalten eines initialisierten Objekts kann nicht geändert " "werden." msgid "names of object and value must match" msgstr "Namen von Objekt und Wert müssen übereinstimmen." msgid "\"pdMat\" element must have a formula" msgstr "\"pdMat\"-Element muss eine Formel haben." msgid "'object' must be a list or a formula" msgstr "'object' muss eine Liste oder Formel sein" msgid "\"pdMat\" elements must have a formula" msgstr "\"pdMat\"-Elemente müssen eine Formel haben" msgid "elements in 'object' must be formulas or \"pdMat\" objects" msgstr "Elemente in 'object' müssen Formeln oder \"pdMat\"-Objekte sein." # FIXME s/ength/length/ msgid "cannot change the parameter when ength of parameters is undefined" msgstr "" "Der Parameter kann nicht geändert werden, wenn die Länge der Parameters " "nicht definiert ist." msgid "cannot change parameter length of initialized objects" msgstr "" "Parameterlänge von initialisierten Objekten kann nicht geändert werden." msgid "cannot extract groups formula without a formula" msgstr "Gruppenformel ohne eine Formel kann nicht extrahiert werden." msgid "all elements of a \"reStruct\" object must have a non-zero size" msgstr "" "Alle Elemente eines \"reStruct\"-Objekts müssen eine Größe ungleich Null " "haben." msgid "cannot change the length of 'object'" msgstr "Länge von 'object' kann nicht geändert werden." msgid "cannot extract model matrix without formula" msgstr "Modellmatrix kann ohne Formel nicht extrahiert werden." msgid "incompatible lengths for object names" msgstr "inkompatible Länge für Objektnamen" msgid "" "'data' must inherit from \"groupedData\" class if 'random' does not define " "groups" msgstr "" "'data' muss von der Klasse \"groupedData\" erben, falls 'random' keine " "Gruppen definiert." msgid "models with \"corStruct\" and/or \"varFunc\" objects not allowed" msgstr "Modelle mit \"corStruct\"- und/oder \"varFunc\"-Objekten nicht erlaubt" msgid "no degrees of freedom specified" msgstr "keine Freiheitsgrade angegeben" msgid "plot method only implemented for comparing models" msgstr "Plotmehtode nur für Modellvergleiche implementiert" msgid "degrees of freedom and weights must have the same length" msgstr "Freiheitsgrade und Gewichte müssen die gleiche Länge haben." msgid "negative degrees of freedom not allowed" msgstr "negative Freiheitsgrade nicht erlaubt" msgid "more than one degree of freedom is needed when one them is zero." msgstr "" "Mehr als ein Freiheitsgrad wird benötigt, wenn einer von ihnen Null ist." msgid "" "can only construct \"varFunc\" object from another \"varFunc\" object, a " "formula, or a character string" msgstr "" "\"varFunc\"-Objekt kann nur aus anderem \"varFunc\", einer Formel oder einer " "Zeichenkette erstellt werden." msgid "cannot extract parameters of uninitialized object" msgstr "" "Parameter eines nicht initialisierten Objekts können nicht extrahiert werden." msgid "do not know how to get coefficients for %s object" msgstr "nicht bekannt, wie Koeffizienten erlangt werden für %s-Objekt" msgid "cannot change the length of covariate in \"varFunc\" object" msgstr "" "Die Länge der Kovariate im \"varFunc\"-Objekt kann nicht geändert werden." msgid "'value' must be a one sided formula" msgstr "'value' muss eine einseitige Formel sein." msgid "'form' must have a covariate" msgstr "'form' muss eine Kovariate haben." msgid "ignoring 'group' in \"varFixed\" formula" msgstr "'group' in \"varFixed\"-Formel wird ignoriert." msgid "all variables used in 'formula' must be in 'data'" msgstr "Alle in 'formula' benutzten Variablen müssen in 'data' enthalten sein." msgid "initial values must have group names in 'varIdent'" msgstr "Startwerte müssen Gruppennamen in 'varIdent' haben." msgid "initial values for 'varIdent' must be > 0" msgstr "Startwerte für 'varIdent' müssen > 0 sein." msgid "fixed parameters must have names in 'varIdent'" msgstr "Feste Parameter müssen in 'varIdent' Namen haben." msgid "" "cannot change the length of the \"varIdent\" parameter after initialization" msgstr "" "Länge des Parameters \"varIdent\" kann nach der Initialisierung nicht mehr " "geändert werden." msgid "fixed parameter names in 'varIdent' must be a subset of group names" msgstr "" "Feste Parameternamen in 'varIdent' müssen eine Teilmenge von Gruppennamen " "sein." msgid "cannot fix variances in all groups" msgstr "Varianzen können nicht in allen Gruppen festgehalten werden." msgid "initial value for \"varIdent\" should be of length %d" msgstr "Startwert von \"varIndent\" sollte die Länge %d haben." msgid "" "names of starting value for \"varIdent\" object must contain all but one of " "the stratum levels" msgstr "" "Die Namen des Startwerts für ein \"varIdent\"-Objekt müssen alles außer " "einer Schichtstufe enthalten." msgid "nonexistent group names for initial values in 'varIdent'" msgstr "nicht existente Gruppennamen für Startwerte in 'varIdent'" msgid "initial values must have group names in 'varPower'" msgstr "Anfangswerte müssen Gruppennamen in 'varPower' haben." msgid "fixed parameters must have group names in 'varPower'" msgstr "Feste Parameter müssen Gruppennamen in 'varPower' haben." msgid "" "cannot change the length of the \"varStruct\" parameter after initialization" msgstr "" "Länge des Parameters \"varStruct\" kann nach der Initialisierung nicht " "geändert werden." msgid "" "cannot change coefficients before initialization or when all parameters are " "fixed" msgstr "" "Koeffizienten können nicht vor der Initialisierung oder wenn alle Parameter " "fest sind geändert werden." msgid "fixed parameters must have group names" msgstr "Feste Parameter müssen Gruppennamen haben." msgid "mismatch between group names and fixed values names" msgstr "keine Übereinstimmung zwischen Gruppennamen und festen Wertnamen" msgid "initial value for \"varPower\" should be of length %d" msgstr "Startwert von \"varPower\" sollte Länge %d haben." msgid "nonexistent group names for initial values in \"varPower\"" msgstr "nicht existierende Gruppennamen für Anfangswerte in \"varPower\"" msgid "initial value for \"varPower\" should be of length 1" msgstr "Anfangswert für \"varPower\" sollte die Länge 1 haben." msgid "initial values must have group names in 'varExp'" msgstr "Anfangswerte müssen Gruppennamen in 'varExp' haben." msgid "fixed parameters must have group names in 'varExp'" msgstr "Feste Parameter müssen Gruppennamen in 'varExp' haben." msgid "" "cannot change the length of the \"varExp\" parameter after initialization" msgstr "" "Länge des Parameters \"varExp\" kann nach der Initialisierung nicht geändert " "werden." msgid "initial value for \"varExp\" should be of length %d" msgstr "Startwert von \"varExp\" sollte Länge %d haben." msgid "nonexistent group names for initial values in \"varExp\"" msgstr "nicht existente Gruppennamen für Anfangswerte in \"varExp\"" msgid "initial value for \"varExp\" should be of length 1" msgstr "Anfangswert für \"varExp\" sollte die Länge 1 haben." msgid "%s can have at most two components" msgstr "%s kann höchstens zwei Komponenten haben." msgid "%s can only have names \"const\" and \"power\"" msgstr "%s kann nur die Namen \"const\" und \"power\" haben." msgid "%s can only be a list or numeric" msgstr "%s kann nur eine Liste oder numerisch sein." msgid "%s must have group names in 'varConstPower'" msgstr "%s muss Gruppennamen in 'varConstPower' haben." msgid "constant in \"varConstPower\" structure must be > 0" msgstr "Konstante in \"varConstPower\"-Struktur muss > 0 sein." msgid "initial value should be of length %d" msgstr "Startwert sollte Länge %d haben." msgid "nonexistent group names for initial values" msgstr "Nicht existierende Gruppenamen für Startwerte" msgid "all arguments to 'varComb' must be of class \"varFunc\"." msgstr "Alle Argumente für 'varComb' müssen von der Klasse \"varFunc\" sein." msgid "cannot change parameter length of initialized \"varComb\" object" msgstr "" "Parameterlänge eines initialisierten \"varComb\"-Objekts kann nicht geändert " "werden" msgid "Package" msgstr "Paket" msgid "installed with old R version" msgstr "installiert mit alter R Version" msgid "should not be used with R version" msgstr "sollte nicht benutzt werden mit R Version" msgid "Rather re-install it with this version of R." msgstr "Besser mit dieser R Version erneut installieren." msgid "deviance undefined for REML fit" msgstr "Devianz für REML Anpassung nicht definiert" msgid "AIC undefined for REML fit" msgstr "AIC für REML Anpassung nicht definiert" msgid "" "not (yet) implemented. Contributions are welcome; use intervals() instead " "(for now)" msgstr "" "(nocht) nicht implementiert. Beiträge sind willkommen; Für den Moment " "stattdessen intervals() nutzen" msgid "term %s not matched" msgid_plural "terms %s not matched" msgstr[0] "Term %s nicht übereinstimmend" msgstr[1] "Terme %s nicht übereinstimmend" msgid "'L' must have at most %d column" msgid_plural "'L' must have at most %d columns" msgstr[0] "'L' muss zumindest %d Spalte haben:" msgstr[1] "'L' muss zumindest %d Spalten haben:" msgid "effect %s not matched" msgid_plural "effects %s not matched" msgstr[0] "Effekt %s nicht übereinstimmend" msgstr[1] "Effekte %s nicht übereinstimmend" msgid "level %s not allowed for %s" msgid_plural "levels %s not allowed for %s" msgstr[0] "Stufe %s nicht für %s erlaubt" msgstr[1] "Stufen %s nicht für %s erlaubt" msgid "%d error caught in %s: %s" msgid_plural "%d times caught the same error in %s: %s" msgstr[0] "%d Fehler abgefangen in %s: %s" msgstr[1] "%d Mal denselben Fehler abgefangen in %s: %s" msgid "%s not found in data" msgid_plural "%s not found in data" msgstr[0] "%s nicht in Daten gefunden" msgstr[1] "%s nicht in Daten gefunden" msgid "nonexistent level %s" msgid_plural "nonexistent levels %s" msgstr[0] "nicht existierende Stufe %s" msgstr[1] "nicht existierende Stufen %s" msgid "%s not available for plotting" msgid_plural "%s not available for plotting" msgstr[0] "%s nicht verfügbar für grafische Darstellung" msgstr[1] "%s nicht verfügbar für grafische Darstellung" msgid "%s not matched" msgid_plural "%s not matched" msgstr[0] "%s nicht übereinstimmend" msgstr[1] "%s nicht übereinstimmend" msgid "group name not matched in starting values for random effects: %s" msgid_plural "" "group names not matched in starting values for random effects: %s" msgstr[0] "Gruppenname nicht zu Startwerten für Zufallseffekte passend: %s" msgstr[1] "Gruppennamen nicht zu Startwerten für Zufallseffekte passend: %s" #~ msgid "step halving factor reduced below minimum in NLS step" #~ msgstr "" #~ "Schrittlängen-Halbierungsfaktor reduziert unter Minimum im NLS-Schritt" #~ msgid "" #~ "for 'sigma' fixed, 'apVar' is set FALSE, as the cov approxmation is not " #~ "yet available." #~ msgstr "" #~ "für festes 'sigma' wird 'apVar' auf FALSE gesetzt, da die cov " #~ "Approximation noch nicht verfügbar ist." #~ msgid "An lm fit failed, probably because a factor only had one level" #~ msgstr "" #~ "Eine lm Anpassung ist fehlgeschlage, vermtlich, weil ein Faktor nur\n" #~ "eine Stufe hatte" #~ msgid "" #~ "objects must inherit from classes \"gls\", \"gnls\",\"lm\",\"lmList\", " #~ "\"lme\",\"nlme\",\"nlsList\", or \"nls\"" #~ msgstr "" #~ "Objekte müssen von den Klassen \"gls\", \"gnls\", \"lm\", \"lmList\", " #~ "\"lme\", \"nlme\", \"nlsList\" oder \"nls\" erben" #~ msgid "" #~ "approximate covariance matrix for parameter estimates not of full rank" #~ msgstr "" #~ "Approximiert Kovarianzmatrix für Parameterschätzungen haben keinen " #~ "vollständigen Rang." #~ msgid "step halving factor reduced below minimum in PNLS step" #~ msgstr "" #~ "Schrittlängenhalbierungsfaktor unter das Minimum in PNLS-Schritt " #~ "vermindert" #~ msgid "REML comparisons are not meaningful." #~ msgstr "REML-Vergleiche sind nicht sinnvoll." #~ msgid "negative control$nlmStepMax - using default value" #~ msgstr "Negativer control$nlmStepMax – Standardwert wird benutzt." # FIXME 'Terms; #~ msgid "'Terms; must be between 1 and %d" #~ msgstr "'Terms' müssen zwischen 1 und %d liegen" nlme/po/R-fr.po0000644000176200001440000013513613450712326013005 0ustar liggesusers# Translation of R-nlme.pot to French # Copyright (C) 2005 The R Foundation # This file is distributed under the same license as the nlme R package. # Philippe Grosjean 2005. # msgid "" msgstr "" "Project-Id-Version: nlme 3.1-65\n" "Report-Msgid-Bugs-To: bugs@r-project.org\n" "POT-Creation-Date: 2019-04-02 18:40\n" "PO-Revision-Date: 2014-03-30 08:37+0100\n" "Last-Translator: Philippe Grosjean \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Poedit 1.6.4\n" msgid "not implemented for \"nlme\" objects" msgstr "Pas implment pour des objets \"nlme\"" msgid "not implemented for multiple levels of nesting" msgstr "Pas implment pour des niveaux multiples d'imbrication" msgid "individual %s was not used in the fit" msgstr "l'individu %s n'a pas t utilis dans l'ajustement" msgid "do not know how to calculate correlation matrix of %s object" msgstr "Incapable de calculer la matrice de corrlation de l'objet %s" msgid "\"corStruct\" object must have a \"fixed\" attribute" msgstr "l'objet \"corStruct\" doit avoir un attribut \"fixed\"" msgid "do not know how to obtain parameters of %s object" msgstr "incapable d'obtenir les paramtres de l'objet %s" msgid "cannot change the length of the parameter of a \"corStruct\" object" msgstr "" "impossible de changer la longueur des paramtres d'un objet \"corStruct\"" msgid "" "'sumLenSq := sum(table(groups)^2)' = %g is too large.\n" " Too large or no groups in your correlation structure?" msgstr "" msgid "cannot change 'form'" msgstr "Impossible de changer 'form'" msgid "need data to calculate covariate of \"corStruct\" object" msgstr "" "des donnes sont ncessaires pour calculer les covariables d'un objet " "\"corStruct\"" msgid "cannot change the length of the parameter of a \"corSymm\" object" msgstr "" "impossible de changer la longueur des paramtres d'un objet \"corSymm\"" msgid "covariate must have unique values within groups for \"corSymm\" objects" msgstr "" "La covariable doit avoir des valeurs uniques l'intrieur des groupes pour " "les objets \"corSymm\"" msgid "" "unique values of the covariate for \"corSymm\" objects must be a sequence " "of consecutive integers" msgstr "" "les valeurs uniques des covariables pour les objets \"corSymm\" doivent tre " "des squences d'entiers conscutifs" msgid "initial value for \"corSymm\" parameters of wrong dimension" msgstr "" "La valeur initiale pour les paramtres de \"corSymm\" n'ont pas les bonnes " "dimensions" msgid "initial values for \"corSymm\" must be between -1 and 1" msgstr "Les valeurs initiales pour \"corSymm\" doivent se situer entre -1 et 1" msgid "" "initial values for \"corSymm\" do not define a positive-definite correlation " "structure" msgstr "" "les valeurs initiales pour \"corSymm\" ne dfinissent pas une structure de " "corrlation positive-dfinie" msgid "cannot change the length of the parameter of a \"corNatural\" object" msgstr "" "impossible de changer la longueur des paramtres d'un objet \"corNatural\"" msgid "" "covariate must have unique values within groups for \"corNatural\" objects" msgstr "" "la cavariable doit avoir des valeurs uniques pour les intragroupes des " "objets 'corNatural'" msgid "" "unique values of the covariate for \"corNatural\" objects must be a sequence " "of consecutive integers" msgstr "" "les valeurs uniques pour la covariables des objets \"corNatural\" doivent " "tre une squence d'entiers conscutifs" msgid "initial value for \"corNatural\" parameters of wrong dimension" msgstr "" "La valeur initiale pour les paramtres \"corNatural\" n'a pas la bonne " "dimension" msgid "initial values for \"corNatural\" must be between -1 and 1" msgstr "" "Les valeurs initiales pour \"corNatural\" doivent se situer entre -1 et 1" msgid "" "initial values for \"corNatural\" do not define a positive-definite " "correlation structure" msgstr "" "Les valeurs initiales pour \"corNatural\" ne sont pas dfinies sous forme " "d'une structure de corrlation positive-dfinie" msgid "parameter in AR(1) structure must be between -1 and 1" msgstr "Le paramtre dans la structure AR(1) doit se situer entre - 1 et 1" msgid "'sumLenSq' = %g is too large (larger than maximal integer)" msgstr "" msgid "cannot change the length of the parameter of a \"corAR1\" object" msgstr "Impossible de changer la longueur des paramtres d'un objet \"corAR1\"" msgid "covariate must have unique values within groups for \"corAR1\" objects" msgstr "" "La covariable doit avoir des valeurs uniques pour les intragroupes des " "objets \"corAR1\"" msgid "parameter in CAR(1) structure must be between 0 and 1" msgstr "Le paramtre dans la structure CAR(1) doit se situer entre -1 et 1" msgid "cannot change the length of the parameter of a \"corCAR1\" object" msgstr "" "Impossible de changer la longueur des paramtres d'un objet \"corCAR1\"" msgid "covariate must have unique values within groups for \"corCAR1\" objects" msgstr "" "la covariable doit avoir des valeurs uniques pour les intragroupes des " "objets \"corCAR1\"" msgid "autoregressive order must be a non-negative integer" msgstr "l'ordre autorgressif doit tre un entier positif ou nul" msgid "moving average order must be a non-negative integer" msgstr "l'ordre de la moyenne mobile doit tre un entier positif ou nul" msgid "initial value for parameter of wrong length" msgstr "la valeur initiale du paramtre est de la mauvaise taille" msgid "parameters in ARMA structure must be < 1 in absolute value" msgstr "les paramtres d'une structure ARMA doivent tre < 1 en valeur absolue" msgid "'object' has not been Initialize()d" msgstr "'object' n'a pas t initialis ; utilisez Initialize()" msgid "cannot change the length of the parameter of a \"corARMA\" object" msgstr "" "impossible de changer la longueur des paramtres d'un objet \"corARMA\"" msgid "covariate must have unique values within groups for \"corARMA\" objects" msgstr "" "la covariable doit avoir des valeurs uniques pour les intragroupes des " "objets \"corARMA\"" msgid "parameter in \"corCompSymm\" structure must be < 1 in absolute value" msgstr "" "les paramtres d'une structure \"corCompSymm\" doivent tre < 1 en valeur " "absolue" msgid "cannot change the length of the parameter of a \"corCompSymm\" object" msgstr "" "impossible de changer la longueur des paramtres d'un objet \"corCompSymm\"" msgid "initial value in \"corCompSymm\" must be greater than %s" msgstr "La valeur initiale dans \"corCompSymm\" doit tre plus grande que %s" msgid "cannot change the length of the parameter after initialization" msgstr "impossible de changer la longueur du paramtre aprs l'initialisation" msgid "need data to calculate covariate" msgstr "des donnes sont ncessaires pour calculer la covariable" msgid "cannot have zero distances in \"corSpatial\"" msgstr "distances nulles non autorises dans \"corSpatial\"" msgid "'range' must be > 0 in \"corSpatial\" initial value" msgstr "" "l'tendue des valeurs initiales ('range') dans \"corSpatial\" doit tre > 0 " msgid "initial value for \"corSpatial\" parameters of wrong dimension" msgstr "" "la valeur initiale pour les paramtres \"corSpatial\" n'ont pas la bonne " "taille" msgid "initial value of nugget ratio must be between 0 and 1" msgstr "" "la valeur initiale du coefficient de ppite doit tre comprise entre 0 et 1" msgid "'range' must be > 0 in \"corLin\" initial value" msgstr "" "l'tendue ('range') doit tre > 0 pour les valeurs initiales dans \"corLin\"" msgid "" "initial value for 'range' less than minimum distance. Setting it to 1.1 * " "min(distance)" msgstr "" "la valeur initiale pour l'tendue ('range') est infrieure la distance " "minimale. Elle est fixe 1.1 * min(distance)" msgid "initial value for \"corLin\" parameters of wrong dimension" msgstr "" "la valeur initiale pour les paramtres \"corLin\" n'ont pas la bonne taille" msgid "range must be > 0 in \"corSpher\" initial value" msgstr "l'tendue des valeurs initiales dans \"corSpher\" doit tre > 0" msgid "initial value for \"corSpher\" parameters of wrong dimension" msgstr "" "la valeur initiale pour les paramtres \"corSpher\" sont de la mauvaise " "taille" msgid "model must be a formula of the form \"resp ~ pred\"" msgstr "le modle doit tre une formule de la forme \"resp ~ pred\"" msgid "no coefficients to fit" msgstr "pas de coefficients ajuster" msgid "maximum number of iterations reached without convergence" msgstr "le nombre maximum d'itrations est atteint, mais pas la convergence" msgid "computed \"gls\" fit is singular, rank %s" msgstr "l'ajustement \"gls\" calcul est singulier, de rang %s" msgid "object must inherit from class \"gls\"" msgstr "l'objet doit hriter de la classe \"gls\"" msgid "'Terms' must be between 1 and %d" msgstr "'Terms' doivent tre compris entre 1 et %d" msgid "terms can only be integers or characters" msgstr "" "Les termes peuvent tre seulement des entiers ou des chanes de caractres" msgid "data in %s call must evaluate to a data frame" msgstr "" "les donnes dans l'appel %s doivent tre values comme un tableau de " "donnes (\"data frame\")" msgid "" "%s without \"primary\" can only be used with fits of \"groupedData\" objects" msgstr "" "%s sans \"primary\" ne peut tre utilis avec des ajustement d'objets " "\"groupedData\"" msgid "only one level allowed for predictions" msgstr "seul un niveau est permis pour les prdictions" msgid "%s and %s must have the same group levels" msgstr "%s et %s doivent avoir les mmes niveaux de groupes" msgid "wrong group levels" msgstr "niveaux de groupes errons" msgid "cannot get confidence intervals on var-cov components: %s" msgstr "" "impossible de calculer un intervalle de confiance sur les composantes var-" "cov : %s" msgid "need an object with call component" msgstr "ncessite un objet avec une composante 'call'" msgid "'nint' is not consistent with 'breaks'" msgstr "'nint' n'est pas consistant avec 'breaks'" msgid "Within-group std. dev. must be a positive numeric value" msgstr "" msgid "'object' must be a formula" msgstr "'object' doit tre une formule" msgid "object formula must be of the form \"resp ~ pred\"" msgstr "l'objet formule doit tre de la forme \"rep ~ pred\"" msgid "'data' must be given explicitly to use 'nls' to get initial estimates" msgstr "" "'data' doit tre fourni de manire explicite pour utiliser 'nls' afin " "d'obtenir les estimateurs initiaux" msgid "no initial values for model parameters" msgstr "pas de valeurs initiales pour les paramtres du modle" msgid "starting estimates must have names when 'params' is missing" msgstr "" "les estimations initiales doivent tre nomms lorsque 'params' est manquant" msgid "'params' must be a formula or list of formulae" msgstr "'params' doit tre une formule ou une liste de formules" msgid "formulae in 'params' must be of the form \"parameter ~ expr\"" msgstr "" "les formules dans 'params' doivent tre de la forme \"parameter ~ expr\"" msgid "starting values for parameters are not of the correct length" msgstr "les valeurs initiales pour les paramtres n'ont pas la taille correcte" msgid "cannot calculate REML log-likelihood for \"gnls\" objects" msgstr "" "impossible de calculer la log-vraissemblance REML pour les objets \"gnls\"" msgid "first argument to 'groupedData' must be a two-sided formula" msgstr "" "le premier argument 'groupedData' doit tre une formule deux membres" msgid "right-hand side of first argument must be a conditional expression" msgstr "" "le membre de droite du premier argument doit tre une expression " "conditionnelle" msgid "first argument to 'nfGroupedData' must be a two-sided formula" msgstr "" "le premier argument de 'nfGroupedData' doit tre une formule deux membres" msgid "only one level of grouping allowed" msgstr "seul un niveau de regroupement est autoris" msgid "second argument to 'groupedData' must inherit from data.frame" msgstr "le second argument de 'groupedData' doit hriter d'un data.frame" msgid "first argument to 'nmGroupedData' must be a two-sided formula" msgstr "" "le premier argument de 'nmGroupedData' doit tre une formule deux membres" msgid "single group not supported -- use groupedData()" msgstr "" msgid "'subset' ignored with single grouping factor" msgstr "" "'subset' ignor lors de l'utilisation d'un seul facteur pour le regroupement" msgid "'subset' must be a list" msgstr "'subset' doit tre une liste" msgid "undefined group declared in 'subset'" msgstr "groupe non dclar dans 'subset'" msgid "only one display level allowed" msgstr "un seul niveau d'affichage est permis" msgid "undefined display level %s for %s" msgstr "niveau d'affichage non dfini %s pour %s" msgid "undefined collapsing level %s for %s" msgstr "niveau de fusion non dfini %s pour %s" msgid "" "collapsing level cannot be smaller than display level; setting it to the " "display level" msgstr "" "le niveau de fusion ne peut tre plus petit que le niveau d'affichage ; il " "est fix au niveau d'affichage" msgid "'preserve' must be a two-sided formula" msgstr "'preserve' doit tre une formule deux membres" msgid "'asTable' cannot be used with multilevel grouped data" msgstr "" "'asTable' ne peut tre utilis avec des donnes groupements multiniveaux" msgid "'asTable' can only be used with balanced 'groupedData' objects" msgstr "" "'asTable' ne peut tre utilis qu'avec des objets 'groupedData' balancs" msgid "%d errors caught in %s. The error messages and their frequencies are" msgstr "" #, fuzzy msgid "'data' argument not used, but taken from groupedData object" msgstr "le second argument doit tre un objet 'groupedData'" msgid "multiple levels not allowed" msgstr "niveaux multiples non permis" msgid "'data' must be a \"groupedData\" object if 'groups' argument is missing" msgstr "" "'data' doit tre un objet \"groupedData\" si l'argument 'groups' est manquant" msgid "'data' in %s call must evaluate to a data frame" msgstr "'data dans l'appel %s doit tre valu comme un data.frame" msgid "nonexistent groups requested in 'subset'" msgstr "groupes inexistants demands dans 'subset'" msgid "'subset' can only be character or integer" msgstr "" "'subset' ne peut qu'tre une chane de caractres ou une valeur numrique" msgid "log-likelihood not available with NULL fits" msgstr "la log-vraissemblance n'est pas disponible avec des ajustements NULL" msgid "'form' must be a formula" msgstr "'form' doit tre une formule" msgid "'form' must be a one-sided formula" msgstr "'form' doit tre une formule un seul membre" msgid "covariate must be a data frame" msgstr "la covariable doit tre un tableau de donnes (data.frame)" msgid "cannot do pairs of just one variable" msgstr "impossible d'apparier avec seulement une variable" msgid "'id' must be between 0 and 1" msgstr "'id' doit tre compris entre 0 et 1" msgid "'id' can only be a formula or numeric" msgstr "'id' doit tre une formule ou une valeur numrique" msgid "'idLabels' of incorrect length" msgstr "'idLabels' de longueur incorrecte" msgid "'idLabels' can only be a formula or a vector" msgstr "'idLabels' ne peut tre qu'une formule ou un vecteur" msgid "covariate must be numeric" msgstr "la covariable doit tre numrique" msgid "nonexistent group in 'newdata'" msgstr "groupe inexistant dans 'newdata'" msgid "nonexistent group requested in 'subset'" msgstr "groupe inexistant mais requis dans 'subset'" msgid "only residuals and random effects allowed" msgstr "seuls les rsidus et les effets alatoires sont permis" msgid "can only fit \"lmList\" objects with single grouping variable" msgstr "" "seuls les objets \"lmList\" peuvent tre ajusts avec une seule variable de " "groupe" msgid "'lme.lmList' will redefine 'data'" msgstr "'lme.lmList' va redfinir 'data'" msgid "initial value for \"reStruct\" overwritten in 'lme.lmList'" msgstr "la valeur initiale de \"reStruct\" est remplace dans 'lme.lmList'" msgid "fixed-effects model must be a formula of the form \"resp ~ pred\"" msgstr "" "un modle effet fixe doit tre une formule de la forme \"resp ~ pred\"" msgid "incompatible lengths for 'random' and grouping factors" msgstr "tailles incompatibles entre 'random' et les facteurs de regroupement" msgid "incompatible formulas for groups in 'random' and 'correlation'" msgstr "" "formules incompatibles entre les groupes dans 'random' et 'correlation'" msgid "" "cannot use smaller level of grouping for 'correlation' than for 'random'. " "Replacing the former with the latter." msgstr "" "impossible d'utiliser un niveau plus petit pour le regroupement de " "'correlation' par rapport 'random'. Replacement du premier par le second." msgid "fewer observations than random effects in all level %s groups" msgstr "" "moins d'observations qu'il n'y a d'effets alatoires dans les niveaux des " "groupes %s" msgid "" "%s problem, convergence error code = %s\n" " message = %s" msgstr "" "problme %s, code d'erreur de convergence = %s\n" " message = %s" msgid "" "maximum number of iterations (lmeControl(maxIter)) reached without " "convergence" msgstr "" "le nombre maximum d'itrations (lmeControl(maxIter)) est atteint, mais pas " "la convergence" msgid "object must inherit from class \"lme\"" msgstr "l'objet doit hriter de la classe \"lme\"" msgid "terms must all have the same denominator DF" msgstr "" "Les termes doivent tous avoir le mme nombre de degrs de libert au " "dnominateur" msgid "L may only involve fixed effects with the same denominator DF" msgstr "" "'L' ne peut que prendre en compte des effets fixes ayant mme degr de " "libert au dnominateur" #, fuzzy msgid "objects must inherit from classes %s, or %s" msgstr "l'objet doit hriter de la classe \"gls\"" msgid "" "some fitted objects deleted because response differs from the first model" msgstr "" "certains objets ajusts sont limins parce que leur rponse diffre du " "premier modle" msgid "first model has a different response from the rest" msgstr "le premier modle a une rponse diffrente du reste" msgid "all fitted objects must have the same estimation method" msgstr "" "tous les objets ajusts doivent l'tre l'aide de la mme mthode " "d'estimation" msgid "" "fitted objects with different fixed effects. REML comparisons are not " "meaningful." msgstr "" "les objets ont t ajusts avec diffrents effets fixes. Les comparaisons " "REML n'ont aucun sens dans ce cas." msgid "objects must have a \"call\" component or attribute" msgstr "les objets doivent avoir une composante ou un attribut \"call\"" msgid "all fitted objects must use the same number of observations" msgstr "tous les objets ajusts doivent utiliser le mme nombre d'observations" msgid "only single level allowed" msgstr "seul un niveau est autoris" #, fuzzy msgid "" "cannot get confidence intervals on var-cov components: %s\n" " Consider '%s'" msgstr "" "impossible de calculer un intervalle de confiance sur les composantes var-" "cov : %s" msgid "covariate must have a level attribute when groups are present" msgstr "" "la covariable doit avoir un attribut 'level', lorsque des groupes sont " "prsents" msgid "covariate must have a level attribute when 'id' is a formula" msgstr "" "la covariable doit avoir un attribut 'level', lorsque 'id' est une formule" msgid "covariate must have a level attribute when 'idLabels' is a formula" msgstr "" "la covariable doit avoir un attribut 'level', lorsque 'idLabels' est une " "formule" msgid "'form' must be a formula when not NULL" msgstr "'form' doit tre une formule, lorsqu'il n'est pas NULL." msgid "only single effects allowed in left side of 'form'" msgstr "seul un effet est permis dans le membre de gauche de 'form'" msgid "%s is not a valid effect name" msgstr "%s n'est pas un nom valide pour un effet" msgid "no effects allowed in right side of formula" msgstr "aucun effet n'est autoris dans le membre de droite de la formule" msgid "cannot evaluate groups for desired levels on 'newdata'" msgstr "impossible d'valuer les groupes pour les niveaux dsirs de 'newdata'" msgid "'Id' must be between 0 and 1" msgstr "'id' doit tre compris entre 0 et 1" msgid "augmentation of random effects only available for single level" msgstr "" "l'augmentation des effets alatoires n'est disponible que pour un seul niveau" msgid "no condensed linear model" msgstr "aucun modle linaire condens" msgid "no fitted \"lme\" object" msgstr "pas d'objet \"lme\" ajust" msgid "objects must have coefficients with same row names" msgstr "les objets doivent avoir des coefficients qui ont mmes noms de lignes" msgid "object must inherit from \"data.frame\"" msgstr "l'objet doit hriter de la classe \"data.frame\"" msgid "only one level allowed in 'gapply'" msgstr "seul un niveau est autoris pour 'gapply'" msgid "'which' must be between 1 and %d" msgstr "'which' doit tre compris entre 1 et %d" msgid "'which' can only be character or integer" msgstr "'which' ne peut tre qu'une chane de caractres ou un entier" msgid "formula(object) must return a formula" msgstr "formula(object) doit renvoyer une formule" msgid "'form' must be a two-sided formula" msgstr "'formf doit tre une formule deux membres" msgid "only one level allowed in 'gsummary'" msgstr "seul un niveau est permis dans 'gsummary'" msgid "'FUN' can only be a function or a list of functions" msgstr "'FUN' ne peut qu'tre une fonction ou une liste de fonctions" msgid "cannot omit grouping factor without 'form'" msgstr "le facteur utilis pour le regroupement ne peut tre omis sans 'form'" msgid "object must inherit from class \"lmList\"" msgstr "l'objet doit hriter de la classe \"lmList\"" msgid "no degrees of freedom for estimating std. dev." msgstr "aucun nombre de degrs de libert pour l'estimation de l'cart type" msgid "" "data argument to \"data.frame\" method for 'getGroups' does not make sense" msgstr "" "l'argument 'data' pour la mthode \"data.frame\" de 'getGroups' n'a pas de " "sens" msgid "invalid formula for groups" msgstr "formule incorrecte pour les groupes" msgid "'form' must have all components as formulas" msgstr "'form' doit avoir tous ses composantes sous forme de formules" msgid "'form' can only be a formula, or a list of formulas" msgstr "'form' ne peut tre qu'une formule, ou une liste de formules" msgid "level of %s does not match formula %s" msgstr "le niveau de %s ne correspond pas la formule %s" msgid "'form' argument must be a formula" msgstr "l'argument 'form' doit tre une formule" msgid "at least two coefficients are needed" msgstr "il faut au moins deux coefficients" msgid "no model variogram available with 'showModel = TRUE'" msgstr "" "aucun variogramme n'est disponible pour le modle avec 'showModel = TRUE'" msgid "only residuals allowed" msgstr "seuls les rsidus sont autoriss" msgid "'distance' and 'object' have incompatible lengths" msgstr "'distance' et 'object' ont des tailles incompatibles" msgid "'nlme.nlsList' will redefine 'fixed', 'data', and 'start'" msgstr "'nlme.nlsList' va redfinir 'fixed', 'data', et 'start'" msgid "can only fit \"nlsList\" objects with single grouping variable" msgstr "" "seuls les objets \"nlsList\" peuvent tre ajusts avec une seule variable de " "groupe" msgid "initial value for 'reStruct' overwritten in 'nlme.nlsList'" msgstr "la valeur initiale pour 'reStruct' est remplace dans 'nlme.nlsList'" msgid "'model' must be a formula" msgstr "'model' doit tre une formule" msgid "model formula must be of the form \"resp ~ pred\"" msgstr "la formule du modle doit tre de la forme \"rep ~ pred\"" msgid "'data' must be given explicitly to use 'nlsList'" msgstr "'data' doit tre fourni explicitement pour utiliser 'nlsList'" msgid "'fixed' must be a formula or list of formulae" msgstr "'fixed' doit tre une formule ou une liste de formules" msgid "formulae in 'fixed' must be of the form \"parameter ~ expr\"" msgstr "" "les formules dans 'fixed' doivent tre de la forme \"paramtre ~ expression\"" msgid "'random' must be a formula or list of formulae" msgstr "'random' doit tre une formule ou une liste de formules" msgid "formulae in 'random' must be of the form \"parameter ~ expr\"" msgstr "" "les formules dans 'random' doivent tre de la forme \"paramtre ~ expression" "\"" msgid "incompatible formulas for groups in \"random\" and \"correlation\"" msgstr "" "formules incompatibles entre les groupes dans \"random\" et \"correlation\"" msgid "" "cannot use smaller level of grouping for \"correlation\" than for \"random" "\". Replacing the former with the latter." msgstr "" "impossible d'utiliser un niveau plus petit pour le regroupement de " "\"correlation\" par rapport \"random\". Replacement du premier par le " "second." msgid "'start' must have a component called 'fixed'" msgstr "'start' doit avoir une composante nomme 'fixed'" msgid "starting values for the 'fixed' component are not the correct length" msgstr "" "les valeurs de dpart pour la composante 'fixed' n'ont pas la bonne taille" msgid "starting values for random effects should be a list, or a matrix" msgstr "" "les valeurs de dpart pour les effets alatoires doivent tre dans une liste " "ou dans une matrice" msgid "" "list with starting values for random effects must have names or be of length " "%d" msgstr "" "la liste contenant les valeurs de dpart pour les effets alatoires doit " "tre nommes ou de longueur %d" msgid "starting values for the random components should be a list of matrices" msgstr "" "les valeurs de dpart pour les composantes alatoires devraient tre un " "liste de matrices" msgid "" "number of rows in starting values for random component at level %s should be " "%d" msgstr "" "le nombre de lignes dans les valeurs de dpart pour la composante alatoire " "au niveau %s doit tre %d" msgid "" "number of columns in starting values for random component at level %s should " "be %d" msgstr "" "le nombre de colonnes dans les valeurs de dpart pour la composante " "alatoire au niveau %s doit tre %d" msgid "starting values for random effects must include group levels" msgstr "" "les valeurs de dpart pour les effets alatoires doivent inclure les niveaux " "de groupe" msgid "" "groups levels mismatch in 'random' and starting values for 'random' at level " "%s" msgstr "" "niveaux de groupes incohrents dans 'random' et dans les valeurs de dpart " "pour 'random' au niveau %s" msgid "" "names mismatch in 'random' and starting values for 'random' at level %s" msgstr "" "incohrence de noms entre 'random' et les valeurs de dpart pour 'random' au " "niveau %s" msgid "Iteration %d, LME step: nlminb() did not converge (code = %d)." msgstr "" msgid "Do increase 'msMaxIter'!" msgstr "" msgid "PORT message:" msgstr "" msgid "Iteration %d, LME step: nlm() did not converge (code = %d)." msgstr "" #, fuzzy msgid "maximum number of iterations (maxIter = %d) reached without convergence" msgstr "" "le nombre maximum d'itrations (lmeControl(maxIter)) est atteint, mais pas " "la convergence" msgid "second argument must be a groupedData object" msgstr "le second argument doit tre un objet 'groupedData'" msgid "cannot use an anonymous function for the model" msgstr "impossible d'utiliser une formule anonyme pour le modle" msgid "" "'data' must be a \"groupedData\" object if 'formula' does not include groups" msgstr "" "'data' doit tre dans un objet \"groupedData\" si 'formula' n'inclus pas de " "groupes" msgid "" "old-style self-starting model functions\n" "are no longer supported.\n" "New selfStart functions are available.\n" "Use\n" " SSfpl instead of fpl,\n" " SSfol instead of first.order.log,\n" " SSbiexp instead of biexp,\n" " SSlogis instead of logistic.\n" "If writing your own selfStart model, see\n" " \"help(selfStart)\"\n" "for the new form of the \"initial\" attribute." msgstr "" "les fonctions de modles 'self-start' d'un ancien style\n" "ne sont plus supportes.\n" "Les nouvelles fonctions selfStart sont disponibles.\n" "Utilisez\n" " SSfpl la place de fpl,\n" " SSfol la place de first.order.log,\n" " SSbiexp la place de biexp,\n" " SSlogis la place de logistic.\n" "Si vous crez votre propre fonction de modle selfStart, voyez\n" " \"help(selfStart)\"\n" "pour la nouvelle forme de l'attribut \"initial\"." msgid "missing call attribute in \"nlsList\" object" msgstr "attribut d'appel manquant dans l'objet \"nlsList\"" msgid "cannot access the matrix of uninitialized objects" msgstr "impossible d'accder la matrice d'objets non initialiss" msgid "ignoring argument 'form'" msgstr "L'argument 'form' est ignor" msgid "ignoring argument 'nam'" msgstr "L'argument 'nam' est ignor" msgid "'value' must be a square matrix" msgstr "'value' doit tre une matrice carre" msgid "dimnames of 'value' must match or be NULL" msgstr "" "les noms de dimensions ('dimnames') des valeurs doivent correspondre ou bien " "tre NULL" msgid "names of 'value' are not consistent with 'nam' argument" msgstr "Les noms de 'value' ne sont pas conformes avec l'argument 'nam'" msgid "%s is not a valid object for \"pdMat\"" msgstr "%s n'est pas un objet correct pour \"pdMat\"" msgid "all elements of 'form' list must be two-sided formulas" msgstr "" "tous les lments de la liste 'form' doivent tre des formules double " "membres" msgid "'form' can only be a formula or a list of formulae" msgstr "'form' ne peut qu'tre une formule ou une liste de formules" msgid "'form' not consistent with 'nam'" msgstr "'form' non conforme avec 'nam'" msgid "length of 'nam' not consistent with dimensions of initial value" msgstr "la longueur de 'nam' ne correspond pas aux dimensions initiales" msgid "no default method for extracting the square root of a \"pdMat\" object" msgstr "" "pas de mthode par dfaut pour extraire la racine carre de l'objet \"pdMat\"" msgid "do not know how to obtain constrained coefficients" msgstr "impossible d'obtenir les coefficients de contrainte" msgid "" "cannot access the number of columns of uninitialized objects without names" msgstr "" "impossible de changer le nombre de colonnes d'un objet non initialis et " "sans noms" msgid "cannot extract the log of the determinant from an uninitialized object" msgstr "" "impossible d'extraire le logarithme du dterminant d'un objet non initialis" msgid "cannot change dimensions on an initialized \"pdMat\" object" msgstr "impossible de changer les dimensions d'un objet \"pdMat\" initialis" msgid "Length of names should be %d" msgstr "La longueur des noms devrait tre %d" msgid "" "names being assigned do not correspond to a permutation of previous names" msgstr "" "les noms affect ne correspondent pas une permutation des noms de dpart" msgid "x-y data to splom got botched somehow" msgstr "les donnes x-y de 'splom' ont t corrompus" msgid "cannot get the inverse of an uninitialized object" msgstr "impossible d'obtenir l'inverse d'un objet non initialis" msgid "an object of length %d does not match the required parameter size" msgstr "" "un objet de longeur %d ne correspond pas la taille requise du paramtre" msgid "cannot extract matrix from an uninitialized object" msgstr "impossible d'extraire une matrice pour un objet non initialis" msgid "cannot extract the inverse from an uninitialized object" msgstr "impossible d'extraire l'inverse d'un objet non initialis" msgid "an object of length %d does not match a Cholesky factor" msgstr "" "un objet de longueur %d ne correspond pas une factorisation de Cholesky" msgid "cannot extract the matrix from an uninitialized object" msgstr "impossible d'extraire la matrice d'un objet non initialis" msgid "cannot extract the matrix from an uninitialized \"pdIdent\" object" msgstr "impossible d'extraire la matrice d'un objet \"pdIdent\" non initialis" msgid "cannot extract the matrix with uninitialized dimensions" msgstr "" "impossible d'extraire la matrice en utilisant des dimensions non initialises" msgid "" "must give names when initializing \"pdIdent\" from parameter without a " "formula" msgstr "" "il faut fournir les noms lorsqu'un objet \"pdIdent\" est initialis depuis " "un paramtre sans fournir de formule" msgid "cannot extract the dimensions" msgstr "impossible d'extraire les dimensions" msgid "cannot extract the matrix from an uninitialized \"pdCompSymm\" object" msgstr "" "impossible d'extraire la matrice d'un objet \"pdCompSymm\" non initialis" msgid "initializing \"pdCompSymm\" object is not positive definite" msgstr "l'initialisation d'un objet \"pdCompSymm\" n'est pas fini et positif" msgid "" "must give names when initializing \"pdCompSymm\" from parameter without a " "formula" msgstr "" "il faut fournir les noms lors de l'initialisation de \"pdCompSymm\" depuis " "un paramtre sans fournir de formule" msgid "cannot obtain constrained coefficients with uninitialized dimensions" msgstr "" "impossible d'obtenir les coefficients de contrainte avec des dimensions non " "initialises" msgid "cannot access the matrix of object without names" msgstr "" "impossible d'accder la matrice d'un objet dont les noms ne sont pas " "dfinis" msgid "'form' must be a list" msgstr "'form' doit tre une liste" msgid "'nam' must be a list" msgstr "'nam' doit tre une liste" msgid "'form' and 'nam' have incompatible lengths" msgstr "'form' et 'nam' ont des tailles incompatibles" msgid "'pdClass' must be a character vector" msgstr "'pdClass' doit tre un vecteur de chanes de caractres" msgid "'form' and 'pdClass' have incompatible lengths" msgstr "'form' et 'pdClass' ont des longueurs incompatibles" msgid "'nam' and 'pdClass' have incompatible lengths" msgstr "'nam' et 'pdClass' ont des longueurs incompatibles" msgid "LNone of the arguments specify more than one block" msgstr "Aucun des arguments ne spcifie plus d'un bloc" msgid "'object' must be a list when not missing, not a matrix, and not numeric" msgstr "" "'object' doit tre une liste, lorsqu'il n'est pas manquant, pas une matrice " "ou un nombre" msgid "arguments imply different number of blocks" msgstr "les arguments impliquent des nombres diffrents de blocs" msgid "all elements in the argument must generate \"pdMat\" objects" msgstr "tous les lments dans l'argument doivent gnrer des objets \"pdMat\"" msgid "cannot have duplicated column names in a \"pdMat\" object" msgstr "" "les noms de colonnes dupliqus ne sont pas permis dans un objet \"pdMat\"" msgid "must have formula when no names are given" msgstr "une formule est ncessaire lorsque les noms ne sont pas fournis" msgid "must give names when initializing from matrix or parameter" msgstr "" "lors de l'initialisation depuis une matrice ou un paramtre, il faut fournir " "les noms" msgid "all elements must have names when any has names" msgstr "tous les lments doivent tre nomms, lorsqu'au moins un l'est" msgid "all elements must have a non-zero size" msgstr "tous les lments doivent avoir une taille non nulle" msgid "cannot change the parameter when length of parameters is undefined" msgstr "" "le paramtre ne peut tre modifi lorsque la longueur des paramtres est " "indfinie" msgid "cannot change parameter length of initialized \"pdMat\" object" msgstr "" "impossible de changer la longueur des paramtres dans un objet \"pdMat\" " "initialis" msgid "all elements must have formulas when any has a formula" msgstr "" "tous les lments doivent contenir des formules, si au moins l'un d'eux en " "contient une" msgid "" "all elements of formula must be list of two-sided formulae or two-sided " "formulae" msgstr "" "tous les lments de type formule doivent tre des listes de formules deux " "membres ou des formules deux membres" msgid "cannot change the number of columns on an initialized object" msgstr "impossible de changer le nombre de colonnes d'un objet initialis" msgid "names of object and value must match" msgstr "les noms de l'objet et ses valeurs ne correspondent pas" msgid "\"pdMat\" element must have a formula" msgstr "l'lment \"pdMat\" doit contenir une formule" msgid "'object' must be a list or a formula" msgstr "'object' doit tre une liste ou une formule" msgid "\"pdMat\" elements must have a formula" msgstr "les lments de \"pdMat\" doivent contenir des formules" msgid "elements in 'object' must be formulas or \"pdMat\" objects" msgstr "" "les lments dans 'object' doivent tre des formules ou des objets \"pdMat\"" msgid "cannot change the parameter when ength of parameters is undefined" msgstr "" "le paramtre ne peut tre modifi lorsque la longueur des paramtres n'est " "pas dfinie" msgid "cannot change parameter length of initialized objects" msgstr "" "la longueur du paramtre ne peut tre modifie dans les objets initialiss" msgid "cannot extract groups formula without a formula" msgstr "impossible d'extraire les groupes sans une formule disposition" msgid "all elements of a \"reStruct\" object must have a non-zero size" msgstr "" "tous les lments d'un objet \"reStruct\" doivent avoir une taille non nulle" msgid "cannot change the length of 'object'" msgstr "impossible de modifier la taille de 'object'" msgid "cannot extract model matrix without formula" msgstr "" "impossible d'extraire la matrice du modle sans une formule disposition" msgid "incompatible lengths for object names" msgstr "longueurs non compatibles pour les noms de l'objet" msgid "" "'data' must inherit from \"groupedData\" class if 'random' does not define " "groups" msgstr "" "'data' doit hriter de la classe \"groupedData\" si 'random' ne dfinit pas " "les groupes" msgid "models with \"corStruct\" and/or \"varFunc\" objects not allowed" msgstr "" "les modles avec objets \"corStruct\" et / ou \"varFunc\" ne sont pas " "autoriss" msgid "no degrees of freedom specified" msgstr "aucun degr de libert n'est spcifi" msgid "plot method only implemented for comparing models" msgstr "la mthode 'plot' n'est implmente que pour la comparaison de modles" msgid "degrees of freedom and weights must have the same length" msgstr "les degrs de libert et les pondrations doivent avoir la mme taille" msgid "negative degrees of freedom not allowed" msgstr "des degrs de libert ngatifs ne sont pas permis" msgid "more than one degree of freedom is needed when one them is zero." msgstr "" "plus d'un degr de libert est ncessaire lorsque l'un d'entre eux vaut zro." msgid "" "can only construct \"varFunc\" object from another \"varFunc\" object, a " "formula, or a character string" msgstr "" "un objet \"varFunc\" ne peut tre construit qu' partir d'un autre objet " "\"varFunc\", une formula ou une chane de caractres" msgid "cannot extract parameters of uninitialized object" msgstr "impossible d'extraire les paramtres d'objets non initialiss" msgid "do not know how to get coefficients for %s object" msgstr "impossible d'obtenir les coefficients de l'objet %s" msgid "cannot change the length of covariate in \"varFunc\" object" msgstr "" "impossible de changer la longueur de la covariable dans l'objet \"varFunc\"" msgid "'value' must be a one sided formula" msgstr "'value' doit tre une formule un seul membre" msgid "'form' must have a covariate" msgstr "'form' doit avoir une covariable" msgid "ignoring 'group' in \"varFixed\" formula" msgstr "'group' est ignor dans la formule \"varFixed\"" msgid "all variables used in 'formula' must be in 'data'" msgstr "" "toutes les variables utilises dans 'formula' doivent aussi se retrouver " "dans 'data'" msgid "initial values must have group names in 'varIdent'" msgstr "" "les valeurs initiales doivent avoir des noms de groupes dans 'varIdent'" msgid "initial values for 'varIdent' must be > 0" msgstr "les valeurs initiales pour 'varIdent' doivent tre > 0" msgid "fixed parameters must have names in 'varIdent'" msgstr "les paramtres fixs doivent avoir leurs noms dans 'varIdent'" msgid "" "cannot change the length of the \"varIdent\" parameter after initialization" msgstr "" "impossible de changer la longueur du paramtre \"varIdent\" aprs " "l'initialisation" msgid "fixed parameter names in 'varIdent' must be a subset of group names" msgstr "" "les noms des paramtres fixs dans 'varIdent' doivent tre un sous-ensemble " "des noms de groupes" msgid "cannot fix variances in all groups" msgstr "impossible de fixer les variances de tous les groupes" msgid "initial value for \"varIdent\" should be of length %d" msgstr "la valeur initiale de \"varIdent\" doit tre de longueur %d" msgid "" "names of starting value for \"varIdent\" object must contain all but one of " "the stratum levels" msgstr "" "les noms des valeurs de dpart pour \"varIdent\" doivent contenir tous les " "niveaux stratifis sauf un" msgid "nonexistent group names for initial values in 'varIdent'" msgstr "noms de groupes inexistants pour les valeurs initiales dans 'varIdent'" msgid "initial values must have group names in 'varPower'" msgstr "" "les valeurs initiales doivent avoir des noms de groupes dans 'varPower'" msgid "fixed parameters must have group names in 'varPower'" msgstr "les paramtres fixs doivent avoir des noms de groupes dans 'varPower'" msgid "" "cannot change the length of the \"varStruct\" parameter after initialization" msgstr "" "impossible de changer la longueur du paramtre \"varStruct\" aprs " "l'initialisation" msgid "" "cannot change coefficients before initialization or when all parameters are " "fixed" msgstr "" "impossible de changer les coefficients avant initialisation ou lorsque tous " "les paramtres sont fixs" msgid "fixed parameters must have group names" msgstr "les paramtres fixs doivent avoir des noms de groupes" msgid "mismatch between group names and fixed values names" msgstr "incohrence entre les noms de groupes et les noms des valeurs fixes" msgid "initial value for \"varPower\" should be of length %d" msgstr "la valeur initiale pour \"varPower\" devrait tre de longueur %d" msgid "nonexistent group names for initial values in \"varPower\"" msgstr "noms de groupes inexistants pour les valeurs initiales de \"varPower\"" msgid "initial value for \"varPower\" should be of length 1" msgstr "la valeur initiale pour \"varPower\" devrait tre de longueur 1" msgid "initial values must have group names in 'varExp'" msgstr "les valeurs initiales doivent avoir des noms de groupes dans 'varExp'" msgid "fixed parameters must have group names in 'varExp'" msgstr "les paramtres fixes doivent avoir des noms de groupes dans 'varExp'" msgid "" "cannot change the length of the \"varExp\" parameter after initialization" msgstr "" "impossible de changer la longueur du paramtre \"varExp\" aprs " "l'initialisation" msgid "initial value for \"varExp\" should be of length %d" msgstr "la valeur initiale pour \"varExp\" doit tre de longueur %d" msgid "nonexistent group names for initial values in \"varExp\"" msgstr "noms de groupes inexistants pour les valeurs initiales de \"varExp\"" msgid "initial value for \"varExp\" should be of length 1" msgstr "la valeur initiale pour \"varExp\" devrait tre de longueur 1" msgid "%s can have at most two components" msgstr "%s peut avoir jusqu' deux composantes" msgid "%s can only have names \"const\" and \"power\"" msgstr "%s ne peut avoir que les noms \"const\" et \"power\"" msgid "%s can only be a list or numeric" msgstr "%s ne peut qu'tre une liste, ou un nombre" msgid "%s must have group names in 'varConstPower'" msgstr "%s doit avoir des noms de groupes dans 'varConstPower'" msgid "constant in \"varConstPower\" structure must be > 0" msgstr "la constante dans la structure \"varConstPower\" doit tre > O" msgid "initial value should be of length %d" msgstr "la valeur initiale doit tre de longueur %d" msgid "nonexistent group names for initial values" msgstr "noms de groupes inexistants pour les valeurs initiales" msgid "all arguments to 'varComb' must be of class \"varFunc\"." msgstr "tous les arguments de 'varComb' doivent tre de classe \"varFunc\"." msgid "cannot change parameter length of initialized \"varComb\" object" msgstr "" "impossible de modifier la longueur du paramtre pour des objets \"varComb\" " "initialiss" msgid "Package" msgstr "" msgid "installed with old R version" msgstr "" msgid "should not be used with R version" msgstr "" msgid "Rather re-install it with this version of R." msgstr "" msgid "deviance undefined for REML fit" msgstr "" msgid "AIC undefined for REML fit" msgstr "" msgid "" "not (yet) implemented. Contributions are welcome; use intervals() instead " "(for now)" msgstr "" msgid "term %s not matched" msgid_plural "terms %s not matched" msgstr[0] "le terme %s est incohrent" msgstr[1] "les termes %s sont incohrents" msgid "'L' must have at most %d column" msgid_plural "'L' must have at most %d columns" msgstr[0] "'L' doit avoir au moins %d colonne" msgstr[1] "'L' doit avoir au moins %d colonnes" msgid "effect %s not matched" msgid_plural "effects %s not matched" msgstr[0] "effet %s incohrent" msgstr[1] "effets %s incohrent" msgid "level %s not allowed for %s" msgid_plural "levels %s not allowed for %s" msgstr[0] "le niveau %s non autoriss pour %s" msgstr[1] "les niveaux %s sont non autoriss pour %s" msgid "%d error caught in %s: %s" msgid_plural "%d times caught the same error in %s: %s" msgstr[0] "" msgstr[1] "" msgid "%s not found in data" msgid_plural "%s not found in data" msgstr[0] "%s non trouv dans les donnes" msgstr[1] "%s non trouv dans les donnes" msgid "nonexistent level %s" msgid_plural "nonexistent levels %s" msgstr[0] "niveau inexistant %s" msgstr[1] "niveaux inexistants %s" msgid "%s not available for plotting" msgid_plural "%s not available for plotting" msgstr[0] "%s non disponible pour le graphe" msgstr[1] "%s non disponibles pour le graphe" msgid "%s not matched" msgid_plural "%s not matched" msgstr[0] "%s non assorti" msgstr[1] "%s non assortis" msgid "group name not matched in starting values for random effects: %s" msgid_plural "" "group names not matched in starting values for random effects: %s" msgstr[0] "" "le nom de groupe ne correspond pas aux valeurs de dpart pour les effets " "alatoires : %s" msgstr[1] "" "les noms des groupes ne correspondent pas aux valeurs de dpart pour les " "effets alatoires : %s" #~ msgid "step halving factor reduced below minimum in NLS step" #~ msgstr "" #~ "le facteur de division par deux du pas est rduit en dessous du minimum " #~ "dans un pas NLS" #~ msgid "An lm fit failed, probably because a factor only had one level" #~ msgstr "" #~ "Un ajustement l'aide de lm a chou, probablement parce qu'une variable " #~ "facteur n'a qu'un seul niveau" #~ msgid "" #~ "objects must inherit from classes \"gls\", \"gnls\",\"lm\",\"lmList\", " #~ "\"lme\",\"nlme\",\"nlsList\", or \"nls\"" #~ msgstr "" #~ "les objets doivent hriter des classes \"gls\", \"gnls\", \"lm\",\"lmList" #~ "\", \"lme\",\"nlme\",\"nlsList\", ou \"nls\"" #~ msgid "" #~ "approximate covariance matrix for parameter estimates not of full rank" #~ msgstr "" #~ "matrice de covariance approximative pour les estimateurs de paramtres " #~ "qui ne sont pas de rang complet" #~ msgid "step halving factor reduced below minimum in PNLS step" #~ msgstr "" #~ "le facteur de rduction chaque tape est abaiss en dessous du minimum " #~ " une tape PNLS" nlme/po/de.po0000644000176200001440000000465513450712326012570 0ustar liggesusers# Translation of nlme.pot to German # Copyright (C) 2007-2009 The R Foundation # This file is distributed under the same license as the nlme package. msgid "" msgstr "" "Project-Id-Version: R 3.6.0 / nlme 3.1-137\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-04-02 18:40+0200\n" "PO-Revision-Date: 2019-04-01 14:17+0200\n" "Last-Translator: Detlef Steuer \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: corStruct.c:423 msgid "All parameters must be less than 1 in absolute value" msgstr "Der Betrag aller Parameter muss kleiner 1 sein." #: corStruct.c:533 msgid "Coefficient matrix not invertible" msgstr "Koeffizientenmatrix nicht invertierbar" #: corStruct.c:870 corStruct.c:925 corStruct.c:985 corStruct.c:1027 msgid "Unknown spatial correlation class" msgstr "Unbekannte räumliche Korrelations-Klasse" #: nlme.c:464 msgid "First observation on an individual must have a dose" msgstr "Erste Beobachtung eines Individuums muss eine Dosis haben" #: nlmefit.c:413 #, c-format msgid "Singularity in backsolve at level %ld, block %ld" msgstr "Singularität in backsolve auf Stufe %ld, Block %ld" #: nlmefit.c:453 #, c-format msgid "" "Too many parameters for finite-difference Hessian; npar = %d, nTot = %g." msgstr "" #: nlmefit.c:564 nlmefit.c:745 msgid "Overfitted model!" msgstr "Überangepasstes Modell!" #: nlmefit.c:590 msgid "analytic gradient is not available with matrix logarithm" msgstr "analytischer Gradient ist nicht mit Matrixlogarithmus verfügbar" #: nlmefit.c:613 msgid "analytic gradient is not available with compound symmetry" msgstr "" "analytischer Gradient ist nicht mit zusammengesetzter Symmetrie verfügbar" #: nlmefit.c:906 #, c-format msgid "Unable to form eigenvalue-eigenvector decomposition [RS(.) ierr = %d]" msgstr "" "Unfähig eine Eigenwert-Eigenvektor-Zerlegung zu bilden [RS(.) ierr = %d]" #: nlmefit.c:938 #, c-format msgid "" "Unable to form Cholesky decomposition: the leading minor of order %d is not " "pos.def." msgstr "" "Cholesky-Zerlegung kann nicht bestimmt werden: Führender Minor der Ordnung " "%d\n" "ist nicht positiv definit" #: nlmefit.c:970 msgid "Haven't written the compound symmetry case for this yet" msgstr "" "Fall von zusammengesetzter Symmetrie wurde für dies noch nicht geschrieben" nlme/po/fr.po0000644000176200001440000000465213450712326012604 0ustar liggesusers# Translation of nlme.pot to French # Copyright (C) 2005 The R Foundation # This file is distributed under the same license as the nlme R package. # Philippe Grosjean , 2005. # msgid "" msgstr "" "Project-Id-Version: nlme 3.1-65\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-04-02 18:40+0200\n" "PO-Revision-Date: 2005-12-08 01:00+0100\n" "Last-Translator: Philippe Grosjean \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: corStruct.c:423 msgid "All parameters must be less than 1 in absolute value" msgstr "Tous les paramtres doivent tre infrieurs 1 en valeur absolue" #: corStruct.c:533 msgid "Coefficient matrix not invertible" msgstr "Matrice de coefficient non inversible" #: corStruct.c:870 corStruct.c:925 corStruct.c:985 corStruct.c:1027 msgid "Unknown spatial correlation class" msgstr "Classes de corrlation spatiale inconnues" #: nlme.c:464 msgid "First observation on an individual must have a dose" msgstr "La premire observation sur un individu doit avoir une dose" #: nlmefit.c:413 #, c-format msgid "Singularity in backsolve at level %ld, block %ld" msgstr "Singularit rencontre en rsolution inverse au niveau %ld, bloc %ld" #: nlmefit.c:453 #, c-format msgid "" "Too many parameters for finite-difference Hessian; npar = %d, nTot = %g." msgstr "" #: nlmefit.c:564 nlmefit.c:745 msgid "Overfitted model!" msgstr "" #: nlmefit.c:590 msgid "analytic gradient is not available with matrix logarithm" msgstr "" "un gradient analytique n'est pas disponible avec une matrice logarithmique" #: nlmefit.c:613 msgid "analytic gradient is not available with compound symmetry" msgstr "un gradient analytique n'est pas disponible avec une symtrie compose" #: nlmefit.c:906 #, c-format msgid "Unable to form eigenvalue-eigenvector decomposition [RS(.) ierr = %d]" msgstr "" "Incapable de former la dcomposition valeurs propres - vecteurs propres " "[RS(.) ierr = %d]" #: nlmefit.c:938 #, fuzzy, c-format msgid "" "Unable to form Cholesky decomposition: the leading minor of order %d is not " "pos.def." msgstr "Incapable de former la dcomposition de Cholesky" #: nlmefit.c:970 msgid "Haven't written the compound symmetry case for this yet" msgstr "Les cas de symtrie compose n'ont pas encore t crits"