search for: model5

Displaying 14 results from an estimated 14 matches for "model5".

Did you mean: model
2008 Nov 25
4
glm or transformation of the response?
...em because it looks like the lm model (with sqrt-transformation) fits the data best: ## model1=lm(response~explanatory,poissondata) model2=lm(sqrt(response+0.5)~explanatory,poissondata) model3=lm(log(response+1)~explanatory,poissondata) model4=glm(response~explanatory,poissondata,family=poisson) model5=glm(response~explanatory,poissondata,family=quasipoisson) model6=glm.nb(response~explanatory,poissondata) model7=glm(response~explanatory,quasi(variance="mu",link="identity")) plot(explanatory,response,pch=16) lines(explanatory,predict(model1,explanatory=explanatory)) lines(ex...
2006 Sep 12
4
variables in object names
Is there any way to put an argument into an object name. For example, say I have 5 objects, model1, model2, model3, model4 and model5. I would like to make a vector of the r.squares from each model by code such as this: rsq <- summary(model1)$r.squared for(i in 2:5){ rsq <- c(rsq, summary(model%i%)$r.squared) } So I assign the first value to rsq then cycle through models 2 through 5 gathering there values. The %i%...
2010 Sep 29
1
Understanding linear contrasts in Anova using R
....e. 0 (intercept), .0425, 7.989, .3483, -6.66 # and these are not a linear (or other nice pretty) function of est. from R. # Just as a check, I forced intercept through zero with with deviation scores or -1 in model. # Now force intercept to 0 by using deviation scores devdv <- dv-mean(dv) model5 <- lm(devdv~order.group) summary(model5) #Same as above except intercept = 0 # Now do it by removing the intercept model6 <- lm(dv~order.group -1) summary(model6) # Weird because coeff = cell means # Estimate Std. Error t value Pr(>|t|) # order.group1 1.8025 0.4...
2005 Mar 01
3
packages masking other objects
...ry(nlme) but I still get an error message when I try to use getCovariateFormula. The line I use it in, and the error message is below: rownames(table)<-c((getCovariateFormula(model1)),(getCovariateFormula(model2)),(getCovariateFormula(model3)),(getCovariateFormula(model4)),(getCovariateFormula(model5)),(getCovariateFormula(model6)),(getCovariateFormula(modelnull))) Error in switch(mode(x), "NULL" = structure(NULL, class = "formula"), : invalid formula This line works fine when I run models with different structures that are not in the lme4 package. Does anyone ha...
2009 Mar 09
1
lme anova() and model simplification
...model4<-lme(awsm~adh31+orien,random=~1|viney,method="ML") > anova(model3,model4) Model df AIC BIC logLik Test L.Ratio p-value model3 1 6 41.47847 45.31281 -14.73924 model4 2 5 46.13353 49.32881 -18.06676 1 vs 2 6.655056 0.0099 > > > model5<-lme(awsm~awpm+orien,random=~1|viney,method="ML") > anova(model3,model5) Model df AIC BIC logLik Test L.Ratio p-value model3 1 6 41.47847 45.31281 -14.73924 model5 2 5 46.13124 49.32653 -18.06562 1 vs 2 6.652772 0.0099 > > model6<-lme...
2005 Jul 15
1
nlme and spatially correlated errors
...lme(GUAMAC ~ CRAS, random = GUAMAC ~ CRAS | TRANSECTO) > model4<-lme(GUAMAC ~ CRAS, random = GUAMAC ~ CRAS -1 | TRANSECTO) > AIC(model1,model2,model3,model4) df AIC model1 3 3730.537 model2 4 3698.849 model3 6 3702.408 model4 4 3704.722 > plot(Variogram(model2, form = ~ X + Y)) > model5<-update(model2,corr=corSpher(c(30,0.8), form = ~ X + Y, nugget = T)) > plot(Variogram(modelo7, resType = "n")) > summary(model5) In this case I obtain new F for the independent variable INSOLACION, new R2 for the whole model and new parameters for the linear model. I have al...
2010 Aug 03
2
Specifying interactions in rms package... error
I am encountering an error I do not know how to debug. The error arises when I try to add an interaction term involving two continuous variables (defined using rcs functions) to an existing (and working) model. The new model reads: model5 <- lrm( B_fainting ~ gender+ rcs(exactage, 7) + rcs(DW_nadler_bv, 7) + rcs(drawtimefrom8am, 7)+ DW_firsttime+ DW_race_eth + rcs(DW_BPS, 5)+ rcs(DW_BPD, 5)+ rcs(pulse3, 5)+ locat2+ (rcs(exactage, 3) * rcs(drawtimefrom8am, 3)) ) This gives rise to the following error:...
2007 Oct 17
1
problem with anova() and syntax in lmer
...D. Bates from Rnews vol5/1 and a book of Mr Galwey in addition to the lme4 package help). I have also tried lme (without the covariate) : But the denominator DF seem very strange to me considering the containment method that is used, so I wonder also if the syntax that I use is correct : > model5 <-lme(eclw~landsc + temp + landsc*temp , random= ~ > 1|region/pop/family ,method="REML", data=femr) > anova.lme(model5) numDF denDF F-value p-value (Intercept) 1 332 546.0825 <.0001 landsc 1 9 2.8841 0.1237 temp 1 332 25.7565...
2010 Oct 03
5
How to iterate through different arguments?
If I have a model line = lm(y~x1) and I want to use a for loop to change the number of explanatory variables, how would I do this? So for example I want to store the model objects in a list. model1 = lm(y~x1) model2 = lm(y~x1+x2) model3 = lm(y~x1+x2+x3) model4 = lm(y~x1+x2+x3+x4) model5 = lm(y~x1+x2+x3+x4+x5)... model10. model_function = function(x){ for(i in 1:x) { } If x =1, then the list will only add model1. If x =2, then the list will add both model1 and model2. If x=3, then the list will add model1 model 2 and model3 and so on. How do I translate this into code? -- View t...
2010 Mar 28
1
keeping track of who did what
hello everybody. i need to log "who did what" on some models. i was reading recipe 59 of rails recipes and i created something like that: class LogSweeper < ActionController::Caching::Sweeper observe :model1, :model2, :model3, :model4, :model5, ... after_save(model) save_log(model, "save") end after_destroy(model) save_log(model, "destroy) end private save_log(model, event, user_id = controller.session[:account_id]) #create the log entry, i want to save the id of the model, the id of the logged...
2011 Sep 28
2
GAMs in R : How to put the new data into the model?
I have 5 GAMs ( model1, model2, model3, model4 and model5) Before I use some data X(predictor -January to June data) to form a equation and calculate the expected value of Y (predictand -January to June). After variable selection, GAMs (Model 1)were bulit up! R-square :0.40 NOW, I want to use new X'( predictor -July - December data) and put into Mode...
2009 Feb 09
1
gee with auto-regressive correlation structure (AR-M)
...odel2 <- gee(y ~ x, family=poisson(),id=id, corstr="AR-M") # NOW 50 OBS FOR EACH OF 10 GROUPS id2 <- rep(1:10,each=50) model3 <- gee(y ~ x, family=poisson(),id=id2, corstr="exchangeable") model4 <- gee(y ~ x, family=poisson(),id=id2, corstr="AR-M") # ERROR model5 <- geeglm(y ~ x, family=poisson(),id=id2, corstr="ar1") ########################################################## Basically, it seems that the gee command (package gee) doesn't work when the id groups are large, as in my dataset (observations from several summer seasons, for whic...
2006 Apr 16
0
[S] Problems with lme and 2 levels of nesting:Summary
...compare models when you change the fixed-effects specificatio. However, this still doesn't explain to me why you want to retain the Treatment factor when you have judged it to be inert. > model4<- lme(DeathDay ~ Treatment, random=~ 1 | Clutch/Cup,method="ML") #Full model > model5<- lme(DeathDay ~ Treatment, random=~ 1 | Clutch,method="ML") # model minus Cup > model6<- lme(DeathDay ~ Treatment, random=~ 1 | Cup,method="ML") # model minus Clutch > model7<- lme(DeathDay ~ 1, random=~ 1 | Clutch/Cup,method="ML") #...
2009 Jul 30
0
randomized block design analysis PROBLEM
...taV ~ Block + Treatment + condition, data = A) residual<-residuals(model) # Only efect time model2 <- lm(residual ~ DateBTC, data=A) summary(model2) # Other case model3 <- lm(ThetaV ~ Treatment, data = A) summary(model3) model4 <- lm(ThetaV ~ condition+DateBTC, data = A) summary(model4) model5 <- lm(ThetaV ~ condition, data = A) summary(model5) -------------------------------------------------------------------------------------------------- In this particular case, the fixed-effect model and the RCB design will give the same p-values: bad.aov <- aov(ThetaV ~ Treatment + Bloc...