Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of S3 method for lme class #71

Merged
merged 4 commits into from Jun 1, 2014

Conversation

RomanTsegelskyi
Copy link
Contributor

S3 method for lme class from nlme package.

Basic example

library(nlme)
fm1 <- lme(distance ~ age, data = Orthodont)
pander(fm1, summary = TRUE)
fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1)
pander(fm2, summary=TRUE)

@tbates
Copy link

tbates commented May 28, 2014

Hi,
Shouldn’t this work?

devtools::install_github("RomanTsegelskyi/pander")
library(nlme)
fm1 <- lme(distance ~ age, data = Orthodont)
pander(fm1, summary = TRUE)

Error in x[[i]] : subscript out of bounds
In addition: Warning messages:
1: In pander.default(fm1, summary = TRUE) :
No pander method for "lme", reverting to default.
2: In pander.default(x[[i]], indent = indent + 1) :
No pander method for "lmeStructInt", reverting to default.No pander method for "lmeStruct", reverting to default.No pander method for "modelStruct", reverting to default.
3: In pander.default(x[[i]], indent = indent + 1) :
No pander method for "reStruct", reverting to default.
4: In pander.default(x[[i]], indent = indent + 1) :
No pander method for "pdSymm", reverting to default.No pander method for "pdMat", reverting to default.

On 28 May 2014, at 06:19, Roman Tsegelskyi notifications@github.com wrote:

S3 method for lme class from nlme package.

Basic example

library(nlme)
fm1 <- lme(distance ~ age, data = Orthodont)
pander(fm1, summary = TRUE)
fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1)
pander(fm2, summary=TRUE)
You can merge this Pull Request by running

git pull https://github.com/RomanTsegelskyi/pander lme
Or view, comment on, or merge it at:

#71

Commit Summary

Implementation of S3 method for zoo class
Implementation of S3 method for lme class
File Changes

M NAMESPACE (2)
M R/S3.R (44)
Patch Links:

https://github.com/Rapporter/pander/pull/71.patch
https://github.com/Rapporter/pander/pull/71.diff

Reply to this email directly or view it on GitHub.

@daroczig
Copy link
Member

@tbates it's in the lme branch, thus try instead:

devtools::install_github('pander', 'RomanTsegelskyi', 'lme')

@daroczig
Copy link
Member

@RomanTsegelskyi the main caption has a line-break just before the colon:

Table: Linear mixed-effects model fit by REML
 : distance ~ age + Sex

In the other captions you put the formula on the same line, so just checking: did you add the \n on purpose?

@RomanTsegelskyi
Copy link
Contributor Author

Sorry, that was a typo. Fixed that. Also deleted code from zoo branch (somehow, this branch was based on zoo, not on master)

@daroczig
Copy link
Member

Great, thanks @RomanTsegelskyi!
But I am not sure if we do not have the same typo for method="ML":

> fm1 <- lme(distance ~ age, data = Orthodont, method="ML")
> pander(fm1, summary = TRUE)

--------------------------------------------------------------
     &nbsp;        Value   Std.Error   DF   t-value   p-value 
----------------- ------- ----------- ---- --------- ---------
 **(Intercept)**   16.76    0.7679     80    21.83   1.946e-35

     **age**      0.6602    0.07058    80    9.354   1.773e-14
--------------------------------------------------------------

Table: Fixed effects: distance ~ age


------------------------------------
 Min     Q1      Med      Q3    Max 
------ ------- -------- ------ -----
-3.306 -0.4874 0.007598 0.4822 3.923
------------------------------------

Table: Standardized Within-Group Residuals


-----------------------------------------------------------------
   &nbsp;      Observations   Groups   Log-restricted-likelihood 
------------- -------------- -------- ---------------------------
 **Subject**       108          27              -219.6           
-----------------------------------------------------------------

Table: Linear mixed-effects model fit by maximum likelihood
 : distance ~ age

@RomanTsegelskyi
Copy link
Contributor Author

Sorry, fixed that also.

@daroczig daroczig merged commit 784ca3c into Rapporter:master Jun 1, 2014
@RomanTsegelskyi RomanTsegelskyi deleted the lme branch July 11, 2014 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants