Displaying 20 results from an estimated 700 matches similar to: "lmer specification for random effects: contradictory reults"
2013 Nov 25
0
R: lmer specification for random effects: contradictory reults
Dear Thierry,
thank you for the quick reply.
I have only one question about the approach you proposed.
As you suggested, imagine that the model we end up after the model selection
procedure is:
mod2.1 <- lmer(dT_purs ~ T + Z + (1 +T+Z| subject), data =x, REML= FALSE)
According to the common procedures specified in many manuals and recent
papers, if I want to compute the p_values relative to
2010 Sep 08
4
coxph and ordinal variables?
Dear R-help members,
Apologies - I am posting on behalf of a colleague, who is a little puzzled
as STATA and R seem to be yielding different survival estimates for the same
dataset when treating a variable as ordinal. Ordered() is used to represent
an ordinal variable) I understand that R's coxph (by default) uses the Efron
approximation, whereas STATA uses (by default) the Breslow. but we
2011 Mar 19
1
strange PREDICTIONS from a PIECEWISE LINEAR (mixed) MODEL
Hi Dears,
When I introduce an interaciton in a piecewise model I obtain some quite
unusual results.
If that would't take u such a problem I'd really appreciate an advise from
you.
I've reproduced an example below...
Many thanks
x<-rnorm(1000)
y<-exp(-x)+rnorm(1000)
plot(x,y)
abline(v=-1,col=2,lty=2)
mod<-lm(y~x+x*(x>-1))
summary(mod)
yy<-predict(mod)
2012 Jul 30
1
te( ) interactions and AIC model selection with GAM
Hello R users,
I'm working with a time-series of several years and to analyze it, I?m using
GAM smoothers from the package mgcv. I?m constructing models where
zooplankton biomass (bm) is the dependent variable and the continuous
explanatory variables are:
-time in Julian days (t), to creat a long-term linear trend
-Julian days of the year (t_year) to create an annual cycle
- Mean temperature
2011 Nov 17
1
Log-transform and specifying Gamma
Dear R help,
I am trying to work out if I am justified in log-transforming data and specifying Gamma in the same glm.
Does it have to be one or the other?
I have attached an R script and the datafile to show what I mean.
Also, I cannot find a mixed-model that allows Gamma errors (so I cannot find a way of including random effects).
What should I do?
Many thanks,
Pete
--------------
2003 Feb 10
2
problems using lqs()
Dear List-members,
I found a strange behaviour in the lqs function.
Suppose I have the following data:
y <- c(7.6, 7.7, 4.3, 5.9, 5.0, 6.5, 8.3, 8.2, 13.2, 12.6, 10.4, 10.8,
13.1, 12.3, 10.4, 10.5, 7.7, 9.5, 12.0, 12.6, 13.6, 14.1, 13.5, 11.5,
12.0, 13.0, 14.1, 15.1)
x1 <- c(8.2, 7.6,, 4.6, 4.3, 5.9, 5.0, 6.5, 8.3, 10.1, 13.2, 12.6, 10.4,
10.8, 13.1, 13.3, 10.4, 10.5, 7.7, 10.0, 12.0,
2011 Apr 07
1
Automated Fixed Order Stepwise Regression Function
Greetings,
I am interested in creating a stepwise fixed order regression function. There's a function for this already called add1( ). The F statistics are calculated using type 2 anova (the SS and the F changes don't match SPSS's). You can see my use of this at the very end of the email.
What I want: a function to make an anova table with f changes and delt R^2.
I ran into
2003 Apr 28
2
stepAIC/lme problem (1.7.0 only)
I can use stepAIC on an lme object in 1.6.2, but
I get the following error if I try to do the same
in 1.7.0:
Error in lme(fixed = resp ~ cov1 + cov2, data = a, random = structure(list( :
unused argument(s) (formula ...)
Does anybody know why?
Here's an example:
library(nlme)
library(MASS)
a <- data.frame( resp=rnorm(250), cov1=rnorm(250),
cov2=rnorm(250),
2012 Aug 22
3
Question concerning anova()
Hi
I am comparing four different linear mixed effect models, derived from updating the original one. To
compare these, I want to use anova(). I therefore do the following (not reproducible - just to
illustration purpose!):
dat <- loadSPECIES(SPECIES)
subs <- expression(dead==FALSE & recTreat==FALSE)
feff <- noBefore~pHarv*year # fixed effect in the model
reff <-
2012 Jun 06
3
Sobel's test for mediation and lme4/nlme
Hello,
Any advice or pointers for implementing Sobel's test for mediation in
2-level model setting? For fitting the hierarchical models, I am using
"lme4" but could also revert to "nlme" since it is a relatively simple
varying intercept model and they yield identical estimates. I apologize for
this is an R question with an embedded statistical question.
I noticed that a
2006 Aug 29
2
lattice and several groups
Dear R-list,
I would like to use the lattice library to show several groups on
the same graph. Here's my example :
## the data
f1 <- factor(c("mod1","mod2","mod3"),levels=c("mod1","mod2","mod3"))
f1 <- rep(f1,3)
f2 <-
2011 Nov 26
2
simplify source code
Hi
I would like to shorten
mod1 <- nls(ColName2 ~ ColName1, data = table, ...)
mod2 <- nls(ColName3 ~ ColName1, data = table, ...)
mod3 <- nls(ColName4 ~ ColName1, data = table, ...)
...
is there something like
cols = c(ColName2,ColName3,ColName4,...)
for i in ...
mod[i-1] <- nls(ColName[i] ~ ColName1, data = table, ...)
I am looking forward to help
Christof
2012 Jan 19
3
fitting an exp model
Hello there,
I am trying to fit an exponential model using nls to some data.
#data
t <- c(0,15,30,60,90,120,240,360,480)
var <- c(0.36,9.72,15.50,23.50,31.44,40.66,59.81,73.11,81.65)
df <- data.frame(t, var)
# model
# var ~ a+b*(1-exp(-k*t))
# I'm looking for values of a,b and k
# formula
# mod <- nls(formula = var ~ a+b *(1-exp((-k)*t)), start=list(a=0, b=10,
2004 Apr 05
3
2 lme questions
Greetings,
1) Is there a nice way of extracting the variance estimates from an lme fit? They don't seem to be part of the lme object.
2) In a series of simulations, I am finding that with ML fitting one of my random effect variances is sometimes being estimated as essentially zero with massive CI instead of the finite value it should have, whilst using REML I get the expected value. I guess
2013 May 02
1
multivariate, hierarchical model
Sorry for the last email, sent too early.
I have a small data set that has a hierarchical structure. It has both temporal (year, months) and spatial (treatment code and zone code). The following explains the data:
WSZ_Code the
water supply zone code (1 to 8)
Treatment_Code the
treatment plant which supplies each water supply zone (1 to 4)
2009 Aug 13
2
glm.nb versus glm estimation of theta.
Hello,
I have a question regarding estimation of the dispersion parameter (theta)
for generalized linear models with the negative binomial error structure. As
I understand, there are two main methods to fit glm's using the nb error
structure in R: glm.nb() or glm() with the negative.binomial(theta) family.
Both functions are implemented through the MASS library. Fitting the model
using these
2008 Nov 20
1
gam and ordination (vegan and labdsv surf and ordisurf)
I have a general question about using thin plate splines in the surf
and ordisurf routines. My rudimentary knowledge of a gam is that with
each predictive variable there is a different smooth for each one and
then they are added together with no real interaction term (because
they don't handle this well?). Now, If I have two variables that
have a high D^2 score and a low GCV score (I am
2005 Jul 22
2
memory cleaning
Hi R Users,
After some research I haven't find what I want.
I'm manipulating a dataframe with 70k rows and 30 variables, and I run out of memory when exporting this in a *.txt file
after some computing I have used :
> memory.size()/1048576.0
[1] 103.7730
and I make my export :
> write.table(cox,"d:/tablefinal2.txt",row.names=F,sep=';')
>
2011 Mar 31
1
Sequential multiple regression
Hello,
In the past I have tended to reside more in the ANOVA camp but am trying to become more familiar with regression techniques in R. I would like to get the F change from a model as I take away factors:
SO...
mod1<-lm(y~x1+x2+x3).......mod2<-lm(y~x1,x2).......mod3<-lm(y~x1)
I can do this by hand by running several models in R and taking the MSr1/MSe1, MSr2/MSe2... This is
2007 Jun 20
1
nlme correlated random effects
I am examining the following nlme model.
asymporig<-function(x,th1,th2)th1*(1-exp(-exp(th2)*x))
mod1<-nlme(fa20~(ah*habdiv+ad*log(d)+ads*ds+ads2*ds2+at*trout)+asymporig(da.p,th1,th2),
fixed=ah+ad+ads+ads2+at+th1+th2~1,
random=th1+th2~1,
start=c(ah=.9124,ad=.9252,ads=.5,ads2=-.1,at=-1,th1=2.842,th2=-6.917),
data=pca1.grouped)
However, the two random effects (th1 and th2)