Displaying 7 results from an estimated 7 matches similar to: "Regression by factor using "sapply""
2009 Sep 05
2
Anova over a list of models
I have a list object, in which I have stored n lme4-models. For example:
library(lme4);
myModels <- list();
myModels[1] <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
myModels[2] <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject),
sleepstudy)
Now I would like to perform an anova over all models in the list. However,
the anova function requires that every model is inserted
2007 Oct 10
3
save lm output into vectors
Hi,
May I ask how I can save the coefficients and the p values into a table?
thanks.
jiong
The email message (and any attachments) is for the sole...{{dropped:11}}
2008 Sep 15
1
Loop for running several models and retrieving outputs
Hi All:
I need to run a bunch of models one-by-one and retrieve the outputs (like
estimates, p values) accordingly. Some of models may not have outputs due to
singularity or even no observations. If this happens, assign NA to the
outputs.
For example,
#running models
fit.mod <- lm(xxxxxxxxxx) #model 1
fit.mod <- lm(xxxxxxxxxx) #model 2
.........
fit.mod <- lm(xxxxxxxxxx) #model 10
2006 Apr 21
1
Controller Model Modules loading
Is there a way to control which model modules are being loaded (e.g.
models/mymodels) -- all modules are automatically loaded. I want to
load them depending on what environment I am running (e.g. development
vs production)
Cheers,
Nicholas
2007 Jul 09
2
Accessing model objects directly in the view
Is there any general guidelines for accessing model objects directly
in the view?
It seems like it would be a potential problem - that it would be
better to keep model objects out of the view entirely. Instead, the
controller should extract whatever data is needed from the model and
put it into temporary objects, thus protecting the views from any
changes in the models and keeping them from
2006 Feb 01
4
exclude a column in save!
Hi all,
I have a column that peeks its value from a sequence (postgres) some
times. Other times, I set it to a certain value.
This column has a default value of "nextval(''the_sequence'')"... When I
want that this column peeks the value from the sequence, I do this:
obj = Mymodel.new
obj.some_column1 = blah
obj.some_column2 = blah
obj.some_column3 = blah
obj.save!
but
2006 May 17
8
Why can''t I change value of the primary key?
One should be able to change the value of a primary key, right? But it''s
not working for me. If I do this:
@drug = Drug.find(tid1)
@drug.id = tid2
@drug.category = ''Test2''
if @drug.save
savedok = ''Saved successfully''
else
savedok = ''Not saved''
end
I get ''Saved successfully''