Re: [R] Problems with "predict" function ii

2018-01-31 Thread Rui Barradas
Hello, First of all, your question is about 'predict' but you include graphic instructions that have nothing to do with it. They do not hurt, but the reproducible example should also be minimal. Second, whenever you use RNG's, you should start it with set.seed(). Now, I have edited your code

Re: [R] variable names in lm formula ~.

2018-01-31 Thread Ista Zahn
I poked at this a little bit and found that the issue exists in stats:::C_termsform (which is called by terms.formula). Here is a variation on the demonstrations provided by Vito and Bert earlier: d<-data.frame(y=rnorm(10,5,.5), age=rnorm(10), exp=rnorm(10),

Re: [R] Problems with "predict" function ii

2018-01-31 Thread PIKAL Petr
Hi First of all you should not post in HTML. Thank you for posting the code, however I do not understand wht exactly do you mean by that you get many lines. I get only one with your code. Other answers see in line -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On

Re: [R] Problems with "predict" function

2018-01-31 Thread Simmering, Jacob E
Your messages about masking come from attaching your data set to the R session. In general, that is bad practice as it leads to confusing code. It is typically better to use the “data” argument in things like lm() to accomplish this task. As near as I can tell, your second set of predictions is

Re: [R] Problems with "predict" function ii

2018-01-31 Thread Jeff Newmiller
This is the kind of thing that leads experienced R users to avoid attach for data analysis. Read "The R Inferno". Use the "data" argument to lm, and the "newdata" argument to predict.lm. -- Sent from my phone. Please excuse my brevity. On January 31, 2018 9:20:10 AM PST, WRAY NICHOLAS via R-hel

[R] Problems with "predict" function ii

2018-01-31 Thread WRAY NICHOLAS via R-help
I have realised that I should have used "detach" before attaching another dataframe, but even when I do this it's still giving me lots of lines, rather than just one: My code: m<-runif(1,0,1) m mres<-m*(seq(1,12)) mres ssd<-rexp(1,1) ssd devs<-rep(0,length(mres)) for(i in 1:length(mres)){devs[i

[R] Problems with "predict" function

2018-01-31 Thread WRAY NICHOLAS via R-help
Hello, I am synthesising some sales data over a twelve month period, and then trying to use the "predict" function, firstly to generate a thirteenth month forecast with upper and lower 95% confidence limits. So far so good But what I then want to do is add the upper sales value at the 95th confi

[R] Quantitative Risk Analysis with R Course 5/1/18 to 5/4/18

2018-01-31 Thread Barbara O'Neill
Quantitative Risk Analysis with R May 1-4, 2018 Fort Collins, Colorado, USA Join us this spring for our QRA with R training. Our class will focus on applied risk modeling methods using the R statistical language and will cover the core principles of QRA and Monte Carlo simulation modeling. Both

[R] using randomForest() with matrix() as input results to an Error: protect(): protection stack overflow

2018-01-31 Thread Nick Fikas
Hello, I'm trying to figure out a solution online but couldn't so far. I realized that others dealt with such an error but their suggestions didn't work for me. So, I'm trying to run the randomForest() using this command: rf = randomForest(classes~., data=as.matrix(train), mtry=5, ntree=2000, im

Re: [R] What is the default covariance structure in the glmmPQL function (MASS package)?

2018-01-31 Thread Bert Gunter
Suggestion: Post your query on the r-sig-mixed-models list, which is (obviously) focused on mixed models issues, and where you are likely to find both greater interest and expertise on such matters. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along

[R] Scraping info from a web site?

2018-01-31 Thread Spencer Graves
Hi, All:   What would you suggest one use to read the data on members of the US Congress and their positions on net neutrality from "https://www.battleforthenet.com/scoreboard"; into R?   I found recommendations for the "rvest" package to "Easily Harvest (Scrape) Web Pages".  I tri

[R] What is the default covariance structure in the glmmPQL function (MASS package)?

2018-01-31 Thread Gerda Börner
Hello, currently I am trying to fit a generalized linear mixed model using the glmmPQL function in the MASS package. I am working with the data provided by the book from Heck, Thomas and Tabata (2012) - https://www.routledge.com/Multilevel-Modeling-of-Categorical-Outcomes-Using-IBM-SPSS/Heck-T

Re: [R] Could the Odds represent weight in Generalized Linear Model?

2018-01-31 Thread Thierry Onkelinx
Dear Lenny, \beta_1 is the log odds ratio for age. If you want the odds ratio, then you need to calculate it. It looks like some reading up on glm won't harm you. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN