Displaying 20 results from an estimated 500 matches similar to: "How can one make stepAIC and lme"
2008 May 09
1
Using lme() inside a function
Dear R-help
I'm working on a large dataset which I have divided into 20 subsets
based on similar features. Each subset consists of observations from
different locations and I wish to use the location as a random effect.
For each group I want to select regressors by a stepwise procedure and
include a random effect on the intercept. I use stepAIC() and lme().
(The lmer()-function doesn't
2007 May 27
1
How to reference or sort rownames in a data frame
As I was working through elementary examples, I was using dataset
"plasma" of package "HSAUR".
In performing a logistic regression of the data, and making the
diagnostic plots (R-2.5.0)
data(plasma,package='HSAUR')
plasma_1<- glm(ESR ~ fibrinogen * globulin, data=plasma, family=binomial())
layout(matrix(1:4,nrow=2))
plot(plasma_1)
I find that data points
2008 Nov 06
2
R Mixed Anova
Hi list, I was searching how to properly write a command line for a mixed
ANOVA. Well honestly, there are so many material on the older post of the
list that just confused me.
I have five factors.
Season (fixed)
Beach (fixed)
Line (fixed)
Block (random)
Strata (random) nested in Block
And for each of the tree strata per block I got 3 replicates.
I saw lots of things about
2008 Jul 18
2
column wise paste of data.frames
Hi everybody!
I'm sure that I overlook something and feel quite stupid to ask, but I
have not found an easy solution to the following problem: Take e.g. the
Orthodont data from the nlme package:
> head(Orthodont)
Grouped Data: distance ~ age | Subject
distance age Subject Sex
1 26.0 8 M01 Male
2 25.0 10 M01 Male
3 29.0 12 M01 Male
4 31.0 14 M01 Male
2010 Jun 22
2
xyplot: adding pooled regression lines to a paneled type="r" plot
Consider the following plot that shows separate regression lines ~ age
for each subject in the Pothoff-Roy Orthodont data,
with separate panels by Sex:
library(nlme)
#plot(Orthodont)
xyplot(distance ~ age|Sex, data=Orthodont, type='r', groups=Subject,
col=gray(.50),
main="Individual linear regressions ~ age")
I'd like to also show in each panel the pooled OLS
1999 Jun 02
0
Sv: lme problem ?
Dear Douglas Bates. I just downloaded the compiled version (I'm a poor Windows devil, not yet having found the time to move to a more advanced platform...) from NT- the files are dated 30.5-1999 so they are not old - and the problem persisted....wonder what I did wrong ?
R : Copyright 1999, The R Development Core Team
Version 0.64.0 Patched (May 3, 1999)
R is free software and comes with
2005 Jun 08
0
bug in predict.lme?
Dear All,
I've come across a problem in predict.lme. Assigning a model formula to a variable and then using this variable in lme (instead of typing the formula into the formula part of lme) works as expect. However, when performing a predict on the fitted model I gan an error messag - predict.lme (but not predictlm) seems to expect a 'properly' typed in formula and a cannot extract
1999 Nov 27
0
lme
Doug,
I thought perhaps that you might be interested in the comparison of
lme to the results for the same models fitted by Richard Jones' carma
(I just wrote the R interface to his Fortran code). The code to run
the example from the lme help and for the equivalent with carma is in
the file below.
The two main differences in results are
1. the random coefficients covariance matrix is quite
1999 Jul 01
1
lme
I am using rw0641.
In my continuing quest to understand repeated measures analysis, I again
return to lme. I exported the Potthoff and Roy data Orthodont.dat from
S-PLUS 4.5 to avoid capture errors and ran the examples in the R help. I
imported the data.frame with
data <- read.table("Orthodont.dat",header=T)
attach(data)
and created the objects
Orthodont.fit1 <-
2009 Mar 16
1
Please help! How do I change the class of a numeric variable in a grouped data object to a factor?
Hi all
I’m in desperate need of help. I’m working with a grouped data object, called Orthodont in the nlme package in R, and am trying to fit various models (learning methods for my thesis), but one of the variables in the object is numeric, (age) and I need it to be a factor. I’ve tried: as.factor(Orthodont$age)
as.factor(as.character(Orthodont$age))
and various other things, but when I then
2004 Aug 27
2
degrees of freedom (lme4 and nlme)
Hi, I'm having some problems regarding the packages
lme4 and nlme, more specifically in the denominator
degrees of freedom. I used data Orthodont for the two
packages. The commands used are below.
require(nlme)
data(Orthodont)
fm1<-lme(distance~age+ Sex,
data=Orthodont,random=~1|Subject, method="REML")
anova(fm1)
numDF DenDF F-value p-value
(Intercept) 1
2002 Jan 12
1
Question about mixed-effects models example (Pinheiro and Bates)
Hi all,
I'm trying to figure out the example about mixed models in the Pinheiro
and Bates book (Mixed-Effects Models in S and S-Plus, 2000, pp. 135-137).
One thing I don't understand is:
When I run the command
fm1Orth.lm <- lm( distance ~ age, Orthodont )
followed by
fm2Orth.lm <- update( fm1Orth.lm, formula = distance ~ Sex*age )
and then do
summary(fm2Orth.lm)
2005 Jul 12
1
nlme plot
Hello,
I am running this script from Pinheiro & Bates book in R Version 2.1.1 (WinXP).
But, I can't plot Figure 2.3.
What's wrong?
TIA.
Rod.
---------------------------------------------------------
>library(nlme)
> names( Orthodont )
[1] "distance" "age" "Subject" "Sex"
> levels( Orthodont$Sex )
[1] "Male"
2005 Jan 03
1
different DF in package nlme and lme4
Hi all
I tried to reproduce an example with lme and used the Orthodont
dataset.
library(nlme)
fm2a.1 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1 | Subject)
anova(fm2a.1)
> numDF denDF F-value p-value
> (Intercept) 1 80 4123.156 <.0001
> age 1 80 114.838 <.0001
> Sex 1 25 9.292 0.0054
or alternatively
2006 Jul 03
1
panel ordering in nlme and augPred plots
Hi,
I'm new at this, I'm very confused, and I think I'm missing something
important here. In our pet example we have this:
> fm <- lme(Orthodont)
> plot(Orthodont)
> plot(augPred(fm, level = 0:1))
which gives us a trellis plot with the females above the males,
starting with "F03", "F04", "F11", "F06", etc. I thought the point of
2006 May 27
1
Recommended package nlme: bug in predict.lme when an independent variable is a polynomial (PR#8905)
Full_Name: Renaud Lancelot
Version: Version 2.3.0 (2006-04-24)
OS: MS Windows XP Pro SP2
Submission from: (NULL) (82.239.219.108)
I think there is a bug in predict.lme, when a polynomial generated by poly() is
used as an explanatory variable, and a new data.frame is used for predictions. I
guess this is related to * not * using, for predictions, the coefs used in
constructing the orthogonal
2002 Dec 17
1
lme invocation
Hi Folks,
I'm trying to understand the model specification formalities
for 'lme', and the documentation is leaving me a bit confused.
Specifically, using the example dataset 'Orthodont' in the
'nlme' package, first I use the invocation given in the example
shown by "?lme":
> fm1 <- lme(distance ~ age, data = Orthodont) # random is ~ age
Despite the
2010 Jul 15
4
Sweave: infelicities with lattice graphics
In a paper I'm writing using Sweave, I make use of lattice graphics, but
don't want to explicitly show (or explain)
in the article text the print() wrapper I need in code chunks for the
graphs to appear.
I can solve this by including each chunk twice, with different options,
as in
<<ortho-xyplot1-code, keep.source=TRUE, eval=FALSE>>=
library(nlme)
library(lattice)
2011 Feb 28
3
Measuring correlations in repeated measures data
R-helpers:
I would like to measure the correlation coefficient between the repeated measures of a single variable that is measured over time and is unbalanced. As an example, consider the Orthodont dataset from package nlme, where the model is:
fit <- lmer(distance ~ age + (1 | Subject), data=Orthodont)
I would like to measure the correlation b/t the variable "distance" at
2007 Nov 09
1
Confidence Intervals for Random Effect BLUP's
I want to compute confidence intervals for the random effect estimates
for each subject. From checking on postings, this is what I cobbled
together using Orthodont data.frame as an example. There was some
discussion of how to properly access lmer slots and bVar, but I'm not
sure I understood. Is the approach shown below correct?
Rick B.
# Orthodont is from nlme (can't have both nlme and