Displaying 20 results from an estimated 200 matches similar to: "fitting an exp model"
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
2005 Sep 15
1
Coefficients from LM
Hi everyone,
Can anyone tell me if its possibility to extract the coefficients from the
lm() command?
For instance, imagine that we have the following data set (the number of
observations for each company is actually larger than the one showed...):
Company Y X1 X2
1 y_1 x1_1 x2_1
1 y_2 x1_2 x2_2
1 y_3 x1_3 x2_3
(...)
2 y_4 x1_4 x2_4
2 y_5 x1_5 x2_5
2 y_6 x1_6 x2_6
(...)
n y_n x1_n x2_n
n
2005 Jul 11
2
CIs in predict?
Dear All,
I am trying to put some Confidence intervals on some regressions from a linear model with no luck. I can extract the fitted values using 'predict', but am having difficulty in getting at the confidence intervals, or the standard errors.
Any suggestions would be welcome
Cheers
Guy
Using Version 2.1.0 (2005-04-18) on a PC
vol.mod3 <-
2013 Nov 25
4
lmer specification for random effects: contradictory reults
Hi All,
I was wondering if someone could help me to solve this issue with lmer.
In order to understand the best mixed effects model to fit my data, I
compared the following options according to the procedures specified in many
papers (i.e. Baayen
<http://www.google.it/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDsQFjAA
2005 Aug 29
1
Different sings for correlations in OLS and TSA
Dear list,
I am trying to re-analyse something. I do have two time series, one
of which (ts.mar) might help explaining the other (ts.anr). In the
original analysis, no-one seems to have cared about the data being
time-series and they just did OLS. This yielded a strong positive
correlation.
I want to know if this correlation is still as strong when the
autocorrelations are taken into account.
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 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 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)
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 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 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
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
2011 Nov 24
3
The contrast and Design libraries
Dear all,
I have been using the contrast library in my teaching for the last couple
of years and am right in the middle of this year's round. In the last week
R has been updated to version 2.14.0 on our computers. This has had the
unfortunate effect of meaning the contrasts library no longer works, as
the Design library is no longer available. I wonder if anyone has a fix
for this...or
2010 Nov 15
1
Executing Command on Multiple R Objects
Hello Everyone -
I want to print a number of results from lme function objects out to a txt
file. How could I do this more efficiently than what you see here:
out2 <- capture.output(summary(mod2a))
out3 <- capture.output(summary(mod3))
out4 <- capture.output(summary(mod5))
out5 <- capture.output(summary(mod6))
out6 <- capture.output(summary(mod7))
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=';')
>
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 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)
2009 Aug 26
1
lme: how to nest a random factor in a fixed factor?
Dear all,
I have an experimental setup in which a random variable is nested within a fixed variable; however I have troubles specifying the correct LMM with lme. I have searched the lists but haven't been
able to find an example like my setup, which I unfortunately need to get this stuff right. Pinheiro & Bates is great but I still can't figure out how to do it.
My