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
] On Behalf Of WRAY NICHOLAS
via R-help
Sent: Wednesday, January 31, 2018 6:20 PM
To: r-help
Subject: [R] Problems with "predict" function ii
I have realised that I should have used "detach" before attaching another
dataframe, but even when I do this it's still giving
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
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
4 matches
Mail list logo