[R] latex and anova.lme problem
Dear R-helpers, When I try anova(txtE2.lme, txtE2.lme1) Model df AIC BIC logLik Test L.Ratio p-value txtE2.lme 1 10 8590 8638 -4285 txtE2.lme1 2 7 8591 8624 -4288 1 vs 26.79 0.0789 latex(anova(txtE2.lme, txtE2.lme1)) Error: object n.group not found I don't even see n.group as one of the arguments of latex() I checked to see class(anova(txtE2.lme, txtE2.lme1)) [1] anova.lme data.frame A bit more information (which I don't know is relevant): methods(anova.lme) no methods were found Warning message: function 'anova.lme' appears not to be generic in: methods(anova.lme) methods(latex) [1] latex.bystats latex.bystats2 latex.default [4] latex.describe latex.describe.single latex.function [7] latex.list latex.summary.formula.cross latex.summary.formula.response [10] latex.summary.formula.reverse *sessionInfo() R version 2.4.0 (2006-10-03) powerpc-apple-darwin8.7.0 locale: C attached base packages: [1] datasets methods stats graphics grDevices utils base other attached packages: Hmisc chron xtablegeepack glmmML nlme lme4 Matrixlattice 3.1-12.3-81.3-2 1.0-10 0.65-3 3.1-77 0.9975-1 0.9975-2 0.14-9 MASSJGR iplots JavaGD rJava 7.2-29 1.4-111.0-40.3-5 0.4-10 _ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400Charlottesville, VA 22904-4400 Parcels:Room 102Gilmer Hall McCormick RoadCharlottesville, VA 22903 Office:B011+1-434-982-4729 Lab:B019+1-434-982-4751 Fax:+1-434-982-4766 WWW:http://www.people.virginia.edu/~mk9y/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] latex and anova.lme problem
Michael Kubovy wrote: Dear R-helpers, When I try anova(txtE2.lme, txtE2.lme1) Model df AIC BIC logLik Test L.Ratio p-value txtE2.lme 1 10 8590 8638 -4285 txtE2.lme1 2 7 8591 8624 -4288 1 vs 26.79 0.0789 latex(anova(txtE2.lme, txtE2.lme1)) Error: object n.group not found Michael, As far as I know, no one has implemented a latex method for anova.lme objects. You are trying to use a default latex method for a complex object. n.group is an argument to latex.default in the Hmisc package Frank I don't even see n.group as one of the arguments of latex() I checked to see class(anova(txtE2.lme, txtE2.lme1)) [1] anova.lme data.frame A bit more information (which I don't know is relevant): methods(anova.lme) no methods were found Warning message: function 'anova.lme' appears not to be generic in: methods(anova.lme) methods(latex) [1] latex.bystats latex.bystats2 latex.default [4] latex.describe latex.describe.single latex.function [7] latex.list latex.summary.formula.cross latex.summary.formula.response [10] latex.summary.formula.reverse *sessionInfo() R version 2.4.0 (2006-10-03) powerpc-apple-darwin8.7.0 locale: C attached base packages: [1] datasets methods stats graphics grDevices utils base other attached packages: Hmisc chron xtablegeepack glmmML nlme lme4 Matrixlattice 3.1-12.3-81.3-2 1.0-10 0.65-3 3.1-77 0.9975-1 0.9975-2 0.14-9 MASSJGR iplots JavaGD rJava 7.2-29 1.4-111.0-40.3-5 0.4-10 _ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400Charlottesville, VA 22904-4400 Parcels:Room 102Gilmer Hall McCormick RoadCharlottesville, VA 22903 Office:B011+1-434-982-4729 Lab:B019+1-434-982-4751 Fax:+1-434-982-4766 WWW:http://www.people.virginia.edu/~mk9y/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] latex and anova.lme problem
It works for me. I am also using R-2.4.0 library(Hmisc) library(nlme) ?lme fm1 - lme(distance ~ age, data = Orthodont) # random is ~ age fm2 - lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) anova(fm1,fm2) Model df AIC BIClogLik Test L.Ratio p-value fm1 1 6 454.6367 470.6173 -221.3183 fm2 2 5 447.5125 460.7823 -218.7562 1 vs 2 5.124178 0.0236 Warning message: Fitted objects with different fixed effects. REML comparisons are not meaningful. in: anova.lme (fm1, fm2) fm1f - lme(distance ~ age+Sex, data = Orthodont) ## to avoid above warning message anova(fm1f,fm2) Model df AIC BIClogLik Test L.Ratio p-value fm1f 1 10 453.6604 480.2000 -216.8302 fm2 2 5 447.5125 460.7823 -218.7562 1 vs 2 3.852152 0.5709 tmp.lme - latex(anova(fm1f,fm2)) getwd() ## to find out where the anova.tex file was placed. Therefore it is necessary for you to provide commented, minimal, self-contained, reproducible code. Rich __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] latex and anova.lme problem
Frank E Harrell Jr f.harrell at vanderbilt.edu writes: As far as I know, no one has implemented a latex method for anova.lme objects. Well, I have, based on your latex/Hmisc, but it's a bit to my private taste, so I won't upload it to CRAN. Also has latex.glm, .lme, .summary.lme. http://www.menne-biomed.de/download/dmisc.zip http://www.menne-biomed.de/download/dmisc_0.3.tar.gz Dieter __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.