similar to: loop with model fitting pair of consecutive pair of variable: mailing all of you because it was last option

Displaying 20 results from an estimated 3000 matches similar to: "loop with model fitting pair of consecutive pair of variable: mailing all of you because it was last option"

2017 Jun 17
3
Prediction with two fixed-effects - large number of IDs
Dear all, I am running a panel regression with time and location fixed effects: ### reg1 <- lm(lny ~ factor(id) + factor(year) + x1+ I(x1)^2 + x2+ I(x2)^2 , data=mydata, na.action="na.omit") ### My goal is to use the estimation for prediction. However, I have 8,500 IDs, which is resulting in very slow computation. Ideally, I would like to do the following: ### reg2 <-
2017 Jun 17
0
Prediction with two fixed-effects - large number of IDs
I have no direct experience with such horrific models, but your formula is a mess and Google suggests the biglm package with ffdf. Specifically, you should convert your discrete variables to factors before you build the model, particularly since you want to use predict after the fact, for which you will need a new data set with the exact same levels in the factors. Also, your use of I() is
2006 Mar 11
1
Non-linear Regression : Error in eval(expr, envir, enclos)
Hi.. i have an expression of the form: model1<-nls(y~beta1*(x1+(k1*x2)+(k1*k1*x3)+(k2*x4)+(k2*k1*x5)+(k2*k2*x6)+(k3*x7)+(k3*k4*x8)+(k3*k2*x9)+(k3*k3*x10)+ (k4*x11)+(k4*k1*x12)+(k4*k2*x13)+(k4*k3*x14)+(k4*k4*x15)+(k5*x16)+(k5*k1*x17)+(k5*k2*x18)+(k5*k3*x19)+
2005 Oct 05
0
Ad: Re: Ad: Re: R crashes for large formulas in lm() (PR#8180)
Dette er en melding med flere deler i MIME-format. --=_alternative 004C4E4A00257091_= Content-Type: text/plain; charset="US-ASCII" Yes. so (x1*x2*x3*x4*x5*x6*x7*x8)^2 = (x1+x2+x3+x4+x5+x6+x7+x8)^8 ? and there is a difference in (x1*x2*x3*x4*x5*x6*x7*x8)^2 and (x1*x2*x3*x4*x5*x6*x7*x8) althoug the resulting formulas are the same, or? This fikses my problem, but R still crashes for the
2005 Oct 05
0
Ad: Re: R crashes for large formulas in lm() (PR#8180)
On Wed, 5 Oct 2005 Hallgeir.Grinde at elkem.no wrote: > And some more informastion I forgot. > R does not crash if I write out the formula: > > set.seed(123) > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <-
2005 Oct 05
0
Ad: Re: Ad: Re: R crashes for large formulas in lm() (PR#8181)
On Wed, 5 Oct 2005 Hallgeir.Grinde at elkem.no wrote: > Yes. > so (x1*x2*x3*x4*x5*x6*x7*x8)^2 = (x1+x2+x3+x4+x5+x6+x7+x8)^8 ? Yes in the sense that the simplified formula given by terms() is the same. > and there is a difference in > (x1*x2*x3*x4*x5*x6*x7*x8)^2 > and > (x1*x2*x3*x4*x5*x6*x7*x8) > althoug the resulting formulas are the same, or? The first is reduced to the
2005 Oct 05
1
Ad: Re: R crashes for large formulas in lm() (PR#8180)
Dette er en melding med flere deler i MIME-format. --=_alternative 004613C000257091_= Content-Type: text/plain; charset="US-ASCII" And some more informastion I forgot. R does not crash if I write out the formula: set.seed(123) x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <-
2005 Oct 05
0
Ad: Re: R crashes for large formulas in lm() (PR#8180)
> From: Peter Dalgaard > > Hallgeir.Grinde at elkem.no writes: > > > Dette er en melding med flere deler i MIME-format. > > --=_alternative 004613C000257091_= > > Content-Type: text/plain; charset="US-ASCII" > > > > And some more informastion I forgot. > > R does not crash if I write out the formula: > > > > set.seed(123)
2013 Apr 13
1
how to add a row vector in a dataframe
Hi, Using S=1000 and simdata <- replicate(S, generate(3000)) #If you want both "m1" and "m0" #here the missing values are 0 res1<-sapply(seq_len(ncol(simdata.psm1)),function(i) {x1<-merge(simdata.psm0[,i],simdata.psm1[,i],all=TRUE); x1[is.na(x1)]<-0; x1}) res1[,997:1000] #????? [,1]???????? [,2]???????? [,3]???????? [,4]??????? #x1??? Numeric,3000 Numeric,3000
2016 Apr 22
0
R2BayesX help
Hi, I wonder if anyone can help me with this issue. I am using R2BayesX. It seems that the model can maximally contain 20 interactions. When the number of interaction terms exceed 20, the code stops working. Here is a piece of toy code. rm(list=ls()) library(BayesX) library(R2BayesX) #data generating model f2<-function(x1,x2,x3,x4) { y<-2*sin(pi*x1)*1.5+exp(2*x2)/3+2 * sin(4 * pi * (x3
2011 Jul 18
0
cforest - keep.forest = false option?
Hi, I'm very new to R. I am most interested in the variable importance measures that result from randomForest, but many of my predictors are highly correlated. My first question is: 1. do highly correlated variables render variable importance measures in randomForest invalid? and 2. I know that cforest is robust to highly correlated variables, however, I do not have enough space on my
2011 Jul 20
0
cforest - keep.forest = false option? (fwd)
> ---------- Forwarded message ---------- > Date: Mon, 18 Jul 2011 10:17:00 -0700 (PDT) > From: KHOFF <kuphoff at gmail.com> > To: r-help at r-project.org > Subject: [R] cforest - keep.forest = false option? > > Hi, > > I'm very new to R. I am most interested in the variable importance > measures > that result from randomForest, but many of my predictors
2012 Nov 08
0
mirt vs. eRm vs. ltm vs. winsteps
Dear R-List, I tried to fit a partial credit model using the "pcmdat" from eRm-package comparing the results of mirt, eRm, ltm and winsteps. The results where quite different, though. I cannot figure out what went wrong and I do not know which result I can rely on. This is what I did in R library(mirt) #load(file="u3.RData")
2008 Dec 22
1
sem package fails when no of factors increase from 3 to 4
#### I checked through every 3 factor * 3 loading case. #### While, 4 factor * 3 loading failed. #### the data is 6 factor * 3 loading require(sem); cor18<-read.moments(); 1 .68 1 .60 .58 1 .01 .10 .07 1 .12 .04 .06 .29 1 .06 .06 .01 .35 .24 1 .09 .13 .10 .05 .03 .07 1 .04 .08 .16 .10 .12 .06 .25 1 .06 .09 .02 .02 .09 .16 .29 .36 1 .23 .26 .19 .05 .04 .04 .08 .09 .09 1 .11 .13 .12 .03 .05 .03
2017 Aug 22
1
boot.stepAIC fails with computed formula
SImplify your call to lm using the "." argument instead of manipulating formulas. > strt <- lm(y1 ~ ., data = dat) and you do not need to explicitly specify the "1+" on the rhs for lm, so > frm2<-as.formula(paste(trg," ~ ", paste(xvars,collapse = "+"))) works fine, too. Anyway, doing this gives (but see end of output)" bst <-
2011 Jun 23
0
Loops, Paste, Apply? What is the best way to set up a list of many equations?
Is there a way to apply paste to?list(form1 = EQ1, form2 = EQ2, form3 = EQ3, form4 = EQ4)?such that I don't have to write form1=EQ1 for all my models?(I might have a list of 20 or more)? I also need the EQs to read the formulas associated with them. For example, below, I was able to automate the name assignment but I could not figure out how to?to set up the list using?paste or other
2007 May 21
0
Is this a bug in cv.lm(DAAG) ?
Dear R-list, I'm not sure what I've found about a function in DAAG package is a bug. When I was using cv.lm(DAAG) , I found there might be something wrong with it. The problem is that we can't use it to deal with a linear model with more than one predictor variable. But the usage documentation hasn't informed us about this. The code illustrates my discovery: > library(DAAG)
2010 Apr 19
2
How to pass a list of parameters into a function
Does anyone know how to pass a list of parameters into a function? for example: somefun=function(x1,x2,x3,x4,x5,x6,x7,x8,x9){ ans=x1+x2+x3+x4+x5+x6+x7+x8+x9 return(ans) } somefun(1,2,3,4,5,6,7,8,9) # I would like this to work: temp=c(x3=3,x4=4,x5=5,x6=6,x7=7,x8=8,x9=9) somefun(x1=1,x2=2,temp) # OR I would like this to work: temp=list(x3=3,x4=4,x5=5,x6=6,x7=7,x8=8,x9=9)
2007 May 25
0
Help with complex lme model fit
Hi R helpers, I'm trying to fit a rather complex model to some simulated data using lme and am not getting the correct results. It seems there might be some identifiability issues that could possibly be dealt with by specifying starting parameters - but I can't see how to do this. I'm comparing results from R to those got when using GenStat... The raw data are available on the
2005 Jun 29
2
quick way to construct formula
Dear R users, I have a data with 1000 variables named "x1", "x2", ..., "x1000", and I want to construct a formula like this format: ~x1+x2+...+x1000+x1:x2+x1:x3+x999:x1000+log(x1)+...+log(x1000) That is: the base variables followed by all interaction terms and all base feature log-transformations. I know I can use several paste functions to construct it. But is