Displaying 20 results from an estimated 329 matches for "model1".
Did you mean:
model
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...
2010 Apr 01
2
Adding regression lines to each factor on a plot when using ANCOVA
...m using a custom function to fit ancova models to a dataset. The data are
divided into 12 groups, with one dependent variable and one covariate. When
plotting the data, i'd like to add separate regression lines for each group
(so, 12 lines, each with their respective individual slopes). My 'model1'
uses the group*covariate interaction term, and so the coefficients to plot
these lines should be contained within the 'model1' object (there are 25
coefficients and it looks like I need the last 12). The problem is I can't
figure out how to extract the relevant coefficients from ...
2012 Mar 01
2
identifying a column name correctly to use in a formula
...I am struggling
to identify to the formula the name of the column in a way which is
meaningful to the formula. It errors becasue it is not evaluated proporly.
(below is a pilot with only 7 to 33 columns, my actual has 200,000 columns)
My attempts:
for (i in 7:33) {
label <- colnames(n)[i]
model1 <- glm(AS~label*interaction,family=binomial("logit"),data=n)
X <- summary(model1)$coefficients[2,1]
Y <- c(label,X)
vector <- rbind(vector,Y)
} #variable lengths differ
Error in model.frame.default(formula = AS ~ label, data = n,
drop.unused.levels = TRUE) :
variable le...
2010 Aug 10
1
extracting information from an object
I was working on a project involving a linear model, and wanted to
extract the standard error of a predictor. I am able to do so, but not
in the way I would expect.
I would have expected that if a created a model such as Model1 <-
lm(y~x,z,d), the object Model1 would contain that information even
though it does not print it out when I simply type Model1. I would also
have (wrongly) suspected that if I type summary(Model1) R would simply
look at the object Model1 and find whatever it needs. But it doesn't
work...
2009 Mar 05
2
Overriding contributed package functions
...amespace". The only solution I have found is to detach the TSA package,
(detach("package:TSA")) , which results in the loss of all the TSA specific
functions. Does anyone have another solution?
The following code illustrates the problem:
Y1<-arima.sim(n=100,list(ar=c(.95,-0.2)))
model1<-arima(Y1,order=c(2,0,0))
tsdiag(model1)
library(TSA)
tsdiag(model1)
stats::tsdiag(model1)
detach("package:TSA")
tsdiag(model1)
R Saba
2008 Aug 22
1
filtering out data
...ng to figure this out for a few days now (I'm quite new to R), have read manuals, list posts, etc., and not finding precisely what I need. I am accustomed to working in Stata, but I am currently working through the multilevel package right now. In Stata, I would include the statement "if model1 == 1" at the end of my regression statement, but I can't seem to find the correct syntax for doing the same thing in R.
I have successfully converted Stata datasets, merged, aggregated, run lm, etc., but this simple task is evading me entirely.
Here's what I have tried (and vario...
2006 Oct 08
1
Simulate p-value in lme4
...family = poisson, data = epil3.)
fit0 <- lmer(y ~ 1+(1 | subject),
family = poisson, data = epil3.)
chisq.sim[i] <- anova(fit0, fit1)[2, "Chisq"]
}
************simulation (MM)************
iter <- 10
chisq.sim <- rep(NA, iter)
Zt <- slot(model1,"Zt") # see ?lmer-class
n.grps <- dim(ranef(model1)[[1]])[1]
sd.ran.effs <- sqrt(VarCorr(model1)[[1]][1])
X <- slot(model1,"X") # see ?lmer-class
fix.effs <- matrix(rep(fixef(model1),dim(X)[1]), nrow=dim(X)[1],
byrow=T)
model.parms <- X*fix.eff...
2006 May 03
5
Multiple Scaffolds
I''d like to create scaffolds for each of the tables in my database, but
would like to access them below the path: localhost:3000/admin
For example localhost:3000/admin/table1
localhost:3000/admin/table2
Where table1 and table2 would be the controller names respectively,
calling their own list.rhtml, show.rhtml, edit.rhtml, etc..
Any recommendations on how/where to
2011 Sep 16
3
Help writing basic loop
...regressions, and 2)
compile the slopes of all regression into one vector. Sample input data
are:
y1<-rnorm(100, mean=0.01, sd=0.001)
y2<-rnorm(100, mean=0.1, sd=0.01)
x<-(c(10,400))
#I have gotten this far with the loop
for (i in 1:100) {
#create the linear model for each data set
model1<-lm(c(y1[i],y2[i])~x)
slope1<-model1$coefficients[2]
}
How can I compile the slopes from all 100 regressions into one vector?
Thanks,
Jake
[[alternative HTML version deleted]]
2007 Jun 29
1
extracting df and MS values from aov
Dear R users,
I would like to extract df and Mean Sq values. I tried several things (e.g.,
str(model1), names(model1)) but I can't find a way to extract these values.
I also tried to search using
RSiteSearch. Any help will be appreciated. Thanks Taka,
model1<-aov(dv~iv.1*iv.2*iv.3)
summary(model1)
Df Sum Sq Mean Sq
iv.1 1 3.200 3.200
iv.2...
2001 Sep 08
1
t.test (PR#1086)
...lm (binomial 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")
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-...
2006 Nov 17
1
Problems in "plot.lm" with option "which=5"
...e, (this example is just to show the problems in the plot and it doesn't make any sense the way I analyzed).
set.seed(3)
datos <-data.frame(fac.A=rep(c("bla","Ur2","pel","arb"),each=3),
y= c(rnorm(3,sd=0.5),rnorm(9,sd=2)))
model1 <- lm(y~fac.A,data=datos)
plot(model1,which=5) # plot1
# this plot1 show that level "arb" has less dispersion than the other levels,
# But if I do the plot by myself, look:
hii <- lm.influence(model1, do.coef = FALSE)$hat
s1 <- sqrt(deviance(model1)/df.residual(mo...
2012 Jun 19
1
Possible bug when using encomptest
...of encomptest 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...
2009 Jul 02
0
MCMCpack: Selecting a better model using BayesFactor
...ian at NSW Department of Commerce, Sydney.
I am using R 2.9.1 on Windows XP.
This has reference to the package “MCMCpack”. My objective is to
select a better model using various alternatives. I have provided here
an example code from MCMCpack.pdf.
The matrix of Bayes Factors is:
model1 model2 model3
model1 1.000 14.08 7.289
model2 0.071 1.00 0.518
model3 0.137 1.93 1.000
> PostProbMod(BF)
model1 model2 model3
0.82766865 0.05878317 0.11354819
I need assistance to interpret the results. If I am wrong, please
correct me.
1. By looking...
2009 Jun 30
1
fitting in logistic model
I would like to know how R computes the probability of an event in a
logistic model (P(y=1)) from the score s, linear combination of x and
beta.
I noticed that there are differences (small, less than e-16) between the
fitting values automatically computed in the glm procedure by R, and the
values "manually" computed by me applying the reverse formula
p=e^s/(1+e^s); moreover I noticed
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!
--...
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 w...
2003 Jul 08
2
NLME Fitted Values
...time with a total of 7,280 observations, 1,720 students nested witin 60 schools. The data set is not balanced.
The model was fit using
eg.model.1<-lme(math~year, random=~year|schoolid/childid, data=single).
When I call the random effects at all levels using
EB.1<-data.frame(ranef(eg.model1, level=1)) and EB.2<-data.frame(ranef(eg.model1, level=2)), I get the shrinkage estimators that I expect. That is, I get 2 random effects for each child (1 intercept and 1 slope) and 2 for each school (1 intercept and 1 slope).
However, when I call the fitted values using:
fitted<-data.fr...
2008 Feb 20
1
p-value for fixed effect in generalized linear mixed model
...with R yet, so forgive me if this question is irrelevant.
If I try to find the significance of the fixed factor "spikes" in a generalized linear mixed model, with "site" nested within "zone" as a random factor, I compare following two models with the anova function:
model1<-lmer(aphids~spikes+(1|zone:site), method="ML", family=quasipoisson)
model2<-lmer(aphids~(1|zone:site), method="ML", family=quasipoisson)
anova(model1,model2)
This gives me a p< 2.2e-16 ***, concluding that "spikes" has a highly significant effect on "ap...
2009 Feb 11
2
generalized mixed model + mcmcsamp
Hi,
I have fitted a generalized linear mixed effects model using lmer
(library lme4), and the family = quasibinomial. I have tried to obtain a
MCMC sample, but on calling mcmcsamp(model1, 1000) I get the following
error which I don't understand at all:
Error in .local(object, n, verbose, ...) : Update not yet written
traceback() delivers:
4: .Call(mer_MCMCsamp, ans, object)
3: .local(object, n, verbose, ...)
2: mcmcsamp(model1, n = 1000, verbose = FALSE)
1: mcmcsamp(model1,...