search for: model2

Displaying 20 results from an estimated 226 matches for "model2".

Did you mean: model
2010 Feb 09
1
Missing interaction effect in binomial GLMM with lmer
...between the two factors. An expression reproducing the raw data is attached at the end of the post in case it is helpful. hatch.frame$success<-cbind(hatch.frame$Hatched,hatch.frame$Nothatched) model<-lmer(success~Origin*Treat+(1|Female),family=binomial,method="ML",data=hatch.frame) model2<-update(model,~.-Origin:Treat) anova(model,model2) Data: Models: model2: success ~ Origin + Treat + (1 | Female) model: success ~ Origin * Treat + (1 | Female) Df AIC BIC logLik Chisq Chi Df Pr(>Chisq) model2 4 94.707 105.857 -43.353 model 5 95.350 109.287...
2009 Aug 28
4
Objects in Views
Hi everyone, I have recently experienced a strange behavior (strange from my knowledge) in rails. In my controllers ''new'' action, I am creating a few instance variables in the following manner : @controllerModel = ControllerModel.new @model1 = Model1.all @model2 = Model2.all in my ''new'' view, I am using the @controllerModel to create the form for new and I am using the @model1 & @model2 within the form to populate 2 combo boxes in the following manner : f.select :model1_id, @model1.collect { |m1| [m1.name, m1.id] } f.select :model2...
2010 Apr 01
2
Adding regression lines to each factor on a plot when using ANCOVA
...a lgVar <- log10(variable) lgCov <- log10(covariate) # separate regression lines for each group model1 <- lm(lgVar ~ lgCov + group + lgCov:group) model1.summ <- summary(model1) model1.anv <- anova(model1) # separate regression lines for each group, but with the same slope model2 <- lm(lgVar ~ lgCov + group) model2.summ <- summary(model2) model2.anv <- anova(model2) # same regression line for all groups model3 <- lm(lgVar ~ lgCov) model3.summ <- summary(model3) model3.anv <- anova(model3) compare <- anova(model1, model2, model3) # compare...
2004 Oct 11
3
logistic regression
...,binomial) > anova(model0,model1,test="Chi") Analysis of Deviance Table Model 1: incidence ~ 1 Model 2: incidence ~ sun Resid. Df Resid. Dev Df Deviance P(>|Chi|) 1 299 332.94 2 298 287.19 1 45.74 1.349e-11 > qsun<-sun^2 > model2<-glm(incidence~sun+qsun,binomial) > anova(model1,model2,test="Chi") Analysis of Deviance Table Model 1: incidence ~ sun Model 2: incidence ~ sun + qsun Resid. Df Resid. Dev Df Deviance P(>|Chi|) 1 298 287.194 2 297 280.623 1 6.571...
2012 Jun 19
1
Possible bug when using encomptest
...st breaking when models are created via the ##nlme::lmList() function. ##Required libraries: library(nlme) library(lmtest) library(plyr) ##Create a noisy slope (spoofing real-world data): fakeData<-c(rnorm(10))+seq(0,5,length=10) ##Create a data frame of data to test. The columns ##model1 and model2 contain my basis functions modelFrame<-as.data.frame( list( srcData=fakeData, model1=seq(0,1,length=10), model2=c(rep(0,5),rep(1,5)) ) ) ##Create all data to be fitted allData<-ldply(1:2,function(x){modelFrame$modelFactor<-x;return(modelFrame)}) ##Apply models by factor:...
2011 Sep 08
1
predict.rma (metafor package)
...,.026,.0040, .049,.0051,.040,.034,.0042,.016) mod<-factor(c(rep(c(1,1,2,3),5))) # factor mid<-c(rep(1:5,4)) # covariate df<-data.frame(id, n.1,n.2, g, var.g,mod, mid) # Examples # Random Effects model1<-rma(g,var.g,mods=~mid,method="REML") # covariate model model2<-rma(g,var.g,mods=~mod,method="REML") # factor model model3<-rma(g,var.g,mods=~mid+mod,method="REML") # multiple # example matrix for predicting against model3 newdat<-expand.grid(c(1,2,3,4,5),c(1,2,3)) predict(model1,newmods=c(1,2,3,4,5)) predict(mode...
2007 Jan 03
1
problem with logLik and offsets
...the model in which there are no free parameters (model3 in the toy example below). Any help would be appreciated. Cheers, Jarrod x<-rnorm(100) y<-rnorm(100, 1+x) model1<-lm(y~x) logLik(model1) sum(dnorm(y, predict(model1), summary(model1)$sigma,log=TRUE)) # no offset - in agreement model2<-lm(y~offset(rep(1,100))+x-1) logLik(model2) sum(dnorm(y, predict(model2),summary(model2)$sigma,log=TRUE)) # offset and free parameters - in agreement model3<-lm(y~offset(rep(1,100))+offset(x)-1) logLik(model3) sum(dnorm(y, predict(model3),summary(model3)$sigma,log=TRUE)) # offset only - d...
2006 Mar 28
0
Help with the code
...pat,trt,status,site,time) data1=data.frame(data) #### Cox proportional hazard model stratified on site model1.cox=coxph(Surv(time,status) ~ trt + strata(site), data=data1, iter.max=500) model1.surv=survfit(model1.cox) #### Cox proportional hazard model with dummy covariates for site model2.cox=coxph(Surv(time,status) ~ trt + factor(site), data=data1, iter.max=500) model2.surv=survfit(model2.cox) beta.fun1 = function(dataname) { cox = coef(coxph(Surv(dataname$time,dataname$status) ~ dataname$trt+strata(dataname$site))) } beta.fun2 = function(dataname) { cox =coef(coxph...
2001 Sep 08
1
t.test (PR#1086)
...l errors) and anova is used two compare two competitive models one can use either an "F" or a "Chi" test. R always performs an F test (Although when test="Chi" the test is labeled as Chi, there isn't any difference between F and Chi test) Let us assume model1 and model2, where model2 a simplified version of model1 model1_glm(y~factor1*factor2,binomial) model2_update(model1,~.-factor2) anova(model1,model2,test="F")# will give the same result as anova(model1,model2,test="Chi") -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-....
2008 Sep 26
1
Type I and Type III SS in anova
...;)). However summary(model) gives the same results in both cases. Is this how it is set up? > local({pkg <- select.list(sort(.packages(all.available = TRUE))) + if(nchar(pkg)) library(pkg, character.only=TRUE)}) > options(contrasts=c("contr.helmert","contr.poly")) > model2<-aov(tdrate~temp*sex) > summary(model2) Df Sum Sq Mean Sq F value Pr(>F) temp 3 0.110137 0.036712 1005.6947 < 2e-16 *** sex 1 0.000141 0.000141 3.8593 0.05095 . temp:sex 3 0.000154 0.000051 1.4073 0.24206 Residuals 187 0.006826 0.000037...
2012 Mar 20
2
anova.lm F test confusion
I am using anova.lm to compare 3 linear models. Model 1 has 1 variable, model 2 has 2 variables and model 3 has 3 variables. All models are fitted to the same data set. anova.lm(model1,model2) gives me: Res.Df RSS Df Sum of Sq F Pr(>F) 1 135 245.38 2 134 184.36 1 61.022 44.354 6.467e-10 *** anova.lm(model1,model2,model3) gives me: Res.Df RSS Df Sum of Sq F Pr(>F) 1 135 245.38...
2006 Oct 09
7
multi_search problems, Never go away!
Hello, I am trying to use the multi_search method, but I keep getting type error on nil objects, I send it [Model1,Model2] and it seems as though the class names keep getting clobbered and turn to nil, somewhere along the multi_index area. I tried to trace what was going on, but I got nothing, also, this only happens when there are actually hits(thank god, most of the time). Perhaps some insight? Thank you! -- Poste...
2011 Sep 05
1
Power analysis in hierarchical models
...el for lmer as per Crawley, page 649 fake2$rep=fake2$Bleach:fake2$Temp:fake2$Rep#rep is used in the lmer model with(fake2,table(rep))#check that each rep contains 8 measurements # run alternative (?equivalent) models model1=aov(Growth~Bleach*Temp+Error(Bleach*Temp/Rep),data=fake2);summary(model1) model2=lmer(Growth~Bleach*Temp+(1|rep),data=fake2);summary(model2)#note: see above, rep<>Rep! ============ end of script ========== I'd like to get familiar with using lme4 because it is likely that the final results of the experiment will be unbalanced (which precludes the use of aov I think)....
2011 Sep 15
1
p-value for non linear model
Hello, I want to understand how to tell if a model is significant. For example I have vectX1 and vectY1. I seek first what model is best suited for my vectors and then I want to know if my result is significant. I'am doing like this: model1 <- lm(vectY1 ~ vectX1, data= d), model2 <- nls(vectY1 ~ a*(1-exp(-vectX1/b)) + c, data= d, start = list(a=1, b=3, c=0)) aic1 <- AIC(model1) aic2 <- AIC(model2) if (aic1 < aic2) print("Model1 is better") else print("Model2 is better") for example aic1 < aic2 I'am doing summary(model1) and I have p...
2011 Sep 23
2
converting object elements to variable names and making subsequent assignments thereto
This has got to be incredibly simple but I nevertheless can't figure it out as I am apparently brain dead. I just want to convert the elements of a character vector to variable names, so as to then assign formulas to them, e.g: z = c("model1","model2"); I want to assign formulas, such as lm(y~x[,1]) and lm(y~x[,2]), to the variables "model1" and "model2". There are of course, many more than 2 models involved, so brute force is the option of absolute last resort. Thanks for any help. -- Jim Bouldin, Research Ecologist...
2004 Oct 26
3
GLM model vs. GAM model
I have a question about how to compare a GLM with a GAM model using anova function. A GLM is performed for example: model1 <-glm(formula = exitus ~ age+gender+diabetes, family = "binomial", na.action = na.exclude) A second nested model could be: model2 <-glm(formula = exitus ~ age+gender, family = "binomial", na.action = na.exclude) To compare these two GLM models the instruction is: anova(model1,model2, test="F") Similarly for GAM models model3 <-gam(formula = exitus ~ s(age)+gender, family = "binomial&q...
2010 Mar 25
1
Selecting Best Model in an anova.
Hello, I have a simple theorical question about regresion... Let's suppose I have this: Model 1: Y = B0 + B1*X1 + B2*X2 + B3*X3 and Model 2: Y = B0 + B2*X2 + B3*X3 I.E. Model1 = lm(Y~X1+X2+X3) Model2 = lm(Y~X2+X3) The Ajusted R-Square for Model1 is 0.9 and the Ajusted R-Square for Model2 is 0.99, among many other significant improvements. And I want to do the anova test to choose the best one: H0: B1 = 0 H1: B1 != 0 Test = Anova(Model2,Model1) How do I know what model wins? (I'm using...
2006 Oct 08
1
Simulate p-value in lme4
...sum)) for(i in 1:iter) { rand.new <- as.vector(rnorm(grps,0, sd.ran.effs)) #grps should be n.grps? rand.vals <- as.vector(rand.new%*%Zt) # Assign random effects mu <- pred.vals+rand.vals # Expected mean resp <- rpois(length(mu), exp(mu)) sim.data <- data.frame(slot(model2,"frame"), resp) # Make data frame sim.model1 <- lmer(resp~1+(1|subject), data=sim.data, family="poisson") sim.model2 <- lmer(resp~pred+(1|subject), data=sim.data, family="poisson") chisq.sim[i] <- anova(sim....
2010 Feb 14
1
how to delete a parameter from list after running negative binomial error
...(ozone ~ ., data=climate.dat) summary(model1.glm.nb) model1AIC.glm.nb<-stepAIC(model1.glm.nb) When I run it, it doesn't give me any significance. So I run a second model, with my autocorrelation table, and remove one more variable that does not autocorrelate with other (anything below .07) model2.glm.nb2 <- update(model1.glm.nb, ~ . - rain, data=climate.dat) summary(model2.glm.nb2) Now, when I run a 3rd. model to remove rain, it shows after summary that rain has been removed. Once I do a forth model rain is again in it. How can I remove more than one variable in one go? I was thinking...
2006 Nov 25
2
predict and arima
...the statistical procedure is fine (with the residuals), but that's not my point right now) : mav.backcast.arima<-function(model,n.backcast,...) { if (class(model)[1]!="Arima") stop("argument <model> must be an object of class 'Arima' (see ?arima)") model2<-model model$residuals<-rev(model$residuals) if (is.ts(model2$residuals)) model$residuals<-ts(model$residuals,start=start(model2$residuals), frequency=frequency(model2$residuals)) pred.before<-predict(model,n.ahead=n.backcast,...) freq<-frequency(model$residu...