search for: mod3

Displaying 20 results from an estimated 34 matches for "mod3".

Did you mean: mod
2012 Jun 06
3
Sobel's test for mediation and lme4/nlme
...ude(NEWDAT) model1 <- lme(out ~ pred, random=~1|grpid,data = NEWDAT) model2 <- lme(out ~ pred + med, random=~1|grpid, data = NEWDAT) model3 <- lme(med ~ pred, random=~1|grpid, data = NEWDAT) mod1.out <- summary(model1)$tTable mod2.out <- summary(model2)$tTable mod3.out <- summary(model3)$tTable indir <- mod3.out[2, 1] * mod2.out[3, 1] effvar <- (mod3.out[2, 1])^2 * (mod2.out[3, 2])^2 + (mod2.out[3, 1])^2 * (mod3.out[2, 2])^2 serr <- sqrt(effvar) zvalue = indir/serr out <- list(Model.1 = mod1.out, Model.2 = mod2.out,...
2005 Jul 11
2
CIs in predict?
...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 <- lm(log.volume~log.area*lake,data=vol) summary(vol.mod3) plot(c(1.3,2.5),c(-0.7,0.45),type="n",xlab="Log area",ylab="Log volume") areapred.a <- seq(min(vol$log.area[vol$lake=="a"]), max(vol$log.area[vol$lake=="a"]), length=100) areapred.b...
2006 Nov 08
0
Mod3 Solaris Container Hosting
Has anyone tried the Solaris containers at http://www.mod3.co.uk for hosting a Rails application. How does it compare to Media Temple''s rails container? Tim Welsh --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this...
2005 Aug 29
1
Different sings for correlations in OLS and TSA
...;) print(m1$x.mean) par(mfrow=c(1,1)) } #now, the autocorrelations should be consistent with following processes: fun.tsa.mle(ts.mar) #following DAAG a p=2 AR fun.tsa.mle(ts.anr) #following DAAG a p=2 AR #I need to know, wether ts.anr can be explained with ts.mar, so #according to ar.mle: mod3<-arima(ts.anr,order=c(2,0,0),xreg=ts.mar,transform.pars=TRUE) fit3 <- gls(ts.anr ~ ts.mar,correlation = corARMA(value=c(mod3$coef[1],mod3$coef[2]),p=2)) summary(fit3) ts.plot(ts.anr,fit3$fitted,col=1:2) #the puzzling bit is the negative correlation. It ought to be positive, I think. #a simp...
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
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 <- factor(rep(c("g1","g2","g3"),each=3),levels=c("g1","g2","g3")) df <- data.frame(val=c(4,3,2,5,4,3,6,5,4), x=rep(c(1,2,3),3),f1=f1,f2=f2) ##...
2013 Nov 25
4
lmer specification for random effects: contradictory reults
...the fixed effects, and subject is the random effect. Random and fixed effects are crossed.: mod0 <- lmer(dT_purs ~ T + Z + (1|subject), data = x) mod1 <- lmer(dT_purs ~ T + Z + (1 +tempo| subject), data = x) mod2 <- lmer(dT_purs ~ T + Z + (1 +tempo| subject) + (1+ Z| subject), data = x) mod3 <- lmer(dT_purs ~ T * Z + (1 +tempo| subject) + (1+ Z| subject), data = x) mod4 <- lmer(dT_purs ~ T * Z + (1| subject), data = x) anova(mod0, mod1,mod2, mod3, mod4) Data: x Models: mod0: dT_purs ~ T + Z + (1 | subject) mod4: dT_purs ~ T * Z + (1 | subject ) mod1: dT_purs ~ T + Z +...
2011 Mar 19
1
strange PREDICTIONS from a PIECEWISE LINEAR (mixed) MODEL
...ata.frame(x,y,id)) summary(mod2) newframe<-data.frame( #fictious id id="fictious", x) newframe[1:5,] #predictions yy2<-predict(mod2,level=0, newdata=newframe) lines(x[order(x)],yy2[order(x)],col="blue",lwd=2) # add variable in the model z<-rgamma(1000,4,6) mod3<-lme(y~x+x*(x>-1)+z ,random=~x|id, data=data.frame(x,y,z,id)) summary(mod3) #new id newframe2<-data.frame( #fictious id id="fictious", x, z) #predict yy3<-predict(mod3,level=0, newdata=newframe2) lines(x[order(x)],yy3[order(x)],col="green",lwd=2) # ADD I...
2003 Feb 10
2
problems using lqs()
...ot;lms", nsamp="exact") mod2$coefficients x1 x2 35.4217275 0.4276641 -1.2834731 mod2$bestone [1] 6 14 15 The results are not the same (?!). Furthermore, if I create the design matrix without the column of 1's for the intercept: X <- cbind(x1, x2) mod3 <- lqs.default(X, y, intercept=T, method="lms", nsamp="exact") > mod3$coefficients (Intercept) x1 x2 35.5293489 0.4422742 -1.2944534 > mod3$bestone [1] 12 17 27 I get the same result I had using the formula (see mod1). This is confusing me! Anoth...
2003 Apr 28
2
stepAIC/lme problem (1.7.0 only)
...(250), cov2=rnorm(250), group=rep(letters[1:10],25) ) mod1 <- lme(resp~cov1, a, ~cov1|group, method="ML") mod2 <- stepAIC(mod1, scope=list(upper=~(cov1+cov2)^2, lower=~cov1) ) # it doesn't happen for normal linear models: mod3 <- lm(resp~cov1, data=a) mod4 <- stepAIC(mod3, scope=list(upper=~(cov1+cov2)^2, lower=~cov1) ) Thanks, Robert
2012 Jul 30
1
te( ) interactions and AIC model selection with GAM
.... I have several questions about it: - Should I use always the same type of smoothing basis (bs), the same type of smoother ( e.g te) and the same dimension of the basis (k)? Example: Option 1: a) mod1 <- gam (bm ~ t, data = data) b) mod2 <- gam (bm ~ te (t, k = 5, bs = ?cr?), data = data) c) mod3 <- gam (bm ~ te (t_year, k = 5, bs = ?cc?), data = data) d) mod4 <- gam (bm ~ te (t_year, temp_W, k = 5, bs = c(?cc?,?cr?)), data = data) e) mod5 <- gam (bm ~ te (t_year, temp_W, temp_sept, k = 5, bs = c(?cc?,?cr?,?cr?)), data = data). Here the limitation for k = 5, is due to mod5, I don?t...
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 --------------
2011 Apr 07
1
Automated Fixed Order Stepwise Regression Function
...running the latest version of R (2.12.2)on a windows 7 machine. DATASET mtcars full.model<-lm(mpg~cyl+disp+hp+drat, data=mtcars) CODE stepFO<-function(model) { m<-data.frame(model.frame(model)) num.of.var<-length(colnames(m)) mod1<-lm(m[,1]~m[,2]) mod2<-lm(m[,1]~m[,2]+m[,3]) mod3<-lm(m[,1]~m[,2]+m[,3]+m[,4]) mod4<-lm(m[,1]~m[,2]+m[,3]+m[,4]+m[,5]) #Comment 1--I don't know how to automated this process(above) of adding #...additional variables. Probably a loop is needed but I don't understand #...how to apply it here. Maybe update.model [1:num.ofvar]? a1&lt...
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,
2007 Feb 28
0
no df to test the effect of an interaccion on a lmer mixed model
...17 10495.0 10603.7 -5230.5 full model 18 10493.7 10608.8 -5228.8 3.3247 1 0.06824 . with this small value of p, I cannot eliminate A*S*t from the full model next I check for seasonal differences as S*t red.mod2 <- lmer(y ~ A*S*t - S:t + (S*t | id), data , method="ML") red.mod3 <- lmer(y ~ A*S*t + (S + t | id), data , method="ML") # to see if there are individual differences in their response to season anova (full.model, red.mod2, red.mod3) results Df AIC BIC logLik Chisq Chi Df Pr(>Chisq) red.mod3 14 10525.0 10614.5 -524...
2013 Nov 25
0
R: lmer specification for random effects: contradictory reults
...e the fixed effects, and subject is the random effect. Random and fixed effects are crossed.: mod0 <- lmer(dT_purs ~ T + Z + (1|subject), data = x) mod1 <- lmer(dT_purs ~ T + Z + (1 +tempo| subject), data = x) mod2 <- lmer(dT_purs ~ T + Z + (1 +tempo| subject) + (1+ Z| subject), data = x) mod3 <- lmer(dT_purs ~ T * Z + (1 +tempo| subject) + (1+ Z| subject), data = x) mod4 <- lmer(dT_purs ~ T * Z + (1| subject), data = x) anova(mod0, mod1,mod2, mod3, mod4) Data: x Models: mod0: dT_purs ~ T + Z + (1 | subject) mod4: dT_purs ~ T * Z + (1 | subject ) mod1: dT_purs ~ T + Z + (1...
2011 Nov 24
3
The contrast and Design libraries
...omeone can help. Here is a typical bit of code I'm currently running so you can see what I'm trying to do: exptime is a covariate and both infstat and status are factors mod<-glm(propalive~exptime+infstat+status+ infstat:status, data=dat) library(contrast) contrast(mod3, a = list(status = levels(dat$status), infstat="control", exptime=8230), b = list(status = levels(dat$status), infstat="infected",exptime=8230)) any help gratefully received, Jo Dr Joanne Lello Cardiff University School of Biosciences Organism and Environment Group Biom...
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)) cat(out2,file="out.txt",sep="\n",append=TRUE) cat(out3,file="out.txt",sep="\n",append=TRUE) cat(out4,file="out.txt",sep=&quo...
2005 Jul 22
2
memory cleaning
...ory.size()/1048576.0 [1] 103.7730 and I make my export : > write.table(cox,"d:/tablefinal2.txt",row.names=F,sep=';') > memory.size()/1048576.0 [1] 241.9730 I'm surprised so I try removing some objects : > rm (trait,tany,tnor,toth,suivauxdany,dnor,doth,mod1, mod2,mod3,lok1,lok2,lok3,aux,risque,risk) and check memory space : > memory.size()/1048576.0 [1] 242.1095 First, I don't understand why when removing objects the memory used increase ? Next, why the memory used double when I make an export ? I look forward to your reply Claude [[alternative HTML v...