Displaying 20 results from an estimated 1000 matches similar to: "lme"
2010 Aug 05
4
Reducing a list of functions by composition fails
Hi All,
I'd like to be able to specify the ordered composition of several
functions. So I defined compose:
compose <- function(f,g){
function(x){f(g(x))}
}
and some simple test functions:
plus2 <- function(x){x+2}
plus3 <- function(x){x+3}
plus4 <- function(x){x+4}
> (compose(plus2,compose(plus3,plus4)))(3)
[1] 12
Works fine. But trying to reduce a list of functions by
1999 Jun 29
1
manova
I am using rw0641 with Windows 98. In the help for aov it states that the
formula can sepecify multiple responses for a "maov". The help doesn't give
an example, Venables and Ripley 1997:381 doesn't either. It isn't mentioned
in the scripts nor in the section R Complements nor in Rnotes. I tried
aov(c(y1,y2,y3)~x)
which seemed reasonable to me but doesn't work. How
2007 Nov 01
1
A question about lme object
I have a question about the lme function in R. My question is: After I got
the object from function lme, why the numIter value of the object is always
NULL? Following is my code:
jjww<-lme(y~x*zz,data=simul,random=~x|group,
control=lmeControl(returnObject=TRUE))
attributes(jjww)
jjww$numIter
the first 20 observation of data simul are:
> simul
y
1999 Jun 23
1
Influence.measures
I am using rw0641 with Windows 98. To list just the influential
repetitiones that result from "influence.measures", I am using the input
result <- lm(y~x)
and the code from the example in the help for "influence.measures"
INFLM <- function(result){
inflm <- influence.measures(result)
which(apply(inflm$is.inf,1,any))
}
It works fine up to now with the
1999 Jul 23
2
rw0642
Among other computers, I am using rw0642 on an IBM 300GL with 32MB RAM and
Windows98.
1. If after opening rw0642 the first command is to help such as "? par",
when the help window is closed by clicking X in the upper right corner of
the help window the following message is shown
This program has performed an illegal operation and will be shut down.
If the problem persists contact the
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
2018 Jul 28
1
possible bug in plot.intervals.lmList
Dear R-devel members,
I think I've found a minor bug in plot.intervals.lmList. ( The guide
https://www.r-project.org/bugs.html suggests to report it here, as I
do not have a bugzilla account.)
Here is a minimal reproducible example to demonstrate the problem:
fm1 <- lmList(distance ~ age | Subject, Orthodont)
plot(intervals(fm1),ylab="a")
This results in: "Error in
2004 May 01
1
changes to y-axis labels in lmList intervals plot
Dear List,
I am plotting lmList objects using plot(intervals()) in nlme
package. I want to make changes to the y-axis labels. When I
try to change cex of y-axis labels using the following:
fm1 <- lmList(distance ~ age | Subject, Orthodont)
plot(intervals(fm1), scales=list(y=list(cex = .7)))
I receive: Error in bwplot(formula = group ~ intervals | what,
data = structure(list( : formal
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
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
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
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
1999 Oct 05
2
for loops and counters
I am trying to assign values to a vector (pvalue). Similar code works in C
but not in R. What am I doing wrong?
r <- pvalue <- 0
for(i in (1:(k-1))){
for(j in (i+1):k){
r <- r+1
tstat <- (means[i]-means[j])/rms
pvalue[r] <- 2*(1-pt(abs(tstat),df))
}
}
Thank you.
Peter B.
--
Peter B. Mandeville mandevip at deimos.tc.uaslp.mx
Jefe del
2008 May 09
2
How can one make stepAIC and lme
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
1999 Jul 14
1
How to cite
I am updating my lab manual in Spanish. How should I cite your supplements
to Venables and Ripley 1997 and the scripts.
Thank you very much
Peter B.
--
Peter B. Mandeville mandevip at deimos.tc.uaslp.mx
Jefe del Depto. de Inform?tica y Bioestad?stica rpe1531 at pasteur.fmed.uaslp.mx
Facultad de Medicine Tel: 48 26-23-45 ext. 232
1999 Jun 07
0
How to superimpose a histogram and density plot
NCSS has a nice plot of the histogram and density plot superimposed. The
S-PLUS 4 Guide to Statistics on page 45 suggests the following code for a
general purpose density plot for a vector named data
iqd <- summary(data)[5]-summary(data)[2]
plot(density(data,width=2*iqd),xlab="x",ylab="",type="l")
Is it possible to superimpose the density plot on a histogram
2001 Jan 09
1
Chambers and Hastie Data Sets
Is there any place where the Chambers and Hastie 1993 Statistical Models in
S data sets can be found?
Thank you very much.
Peter B.
--
Peter B. Mandeville mandevip at deimos.tc.uaslp.mx
Jefe del Depto. de Inform?tica y Bioestad?stica rpe1531 at pasteur.fmed.uaslp.mx
Facultad de Medicine Tel: 48 26-23-45 ext. 232
Universidad Aut?noma de San
2001 Jan 17
1
panel argument in coplot
How can I add a least squares line to each panel in coplot?
Thank you very much.
Peter B.
--
Peter B. Mandeville mandevip at deimos.tc.uaslp.mx
Jefe del Depto. de Inform?tica y Bioestad?stica rpe1531 at pasteur.fmed.uaslp.mx
Facultad de Medicine Tel: 48 26-23-45 ext. 232
Universidad Aut?noma de San Luis Potos? Fax: 48 28-23-52
Av.
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)
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