Re: [R] predict function type class vs. prob

2023-09-23 Thread Rolf Turner
On Fri, 22 Sep 2023 10:12:51 + "Milbert, Sabine (LGL)" wrote: > Dear R Help Team, In addition to other misapprehensions that others have pointed out, you seem to have a fundamental misunderstanding of R-help (and perhaps of R). There is no such thing as the "R Help Team". This is a *ma

Re: [R] predict function type class vs. prob

2023-09-23 Thread David Winsemius
That's embarrassing. Apologies for the garbles HTML posting. I'll see if this is more readable: On 9/23/23 05:30, Rui Barradas wrote: Às 11:12 de 22/09/2023, Milbert, Sabine (LGL) escreveu: Dear R Help Team, My research group and I use R scripts for our multivariate data screening routines.

Re: [R] predict function type class vs. prob

2023-09-23 Thread Ivan Krylov
В Fri, 22 Sep 2023 10:12:51 + "Milbert, Sabine (LGL)" пишет: > PS: If this is an issue based on the model training function of the > caret package and therefore not your responsibility, please let us > know. Indeed, as Rui Barradas said, predict() is a generic function. Calling it with your

Re: [R] predict function type class vs. prob

2023-09-23 Thread David Winsemius
On 9/23/23 05:30, Rui Barradas wrote: > Às 11:12 de 22/09/2023, Milbert, Sabine (LGL) escreveu: >> Dear R Help Team, >> >> My research group and I use R scripts for our multivariate data >> screening routines. During routine use, we encountered some >> inconsistencies within the predict() funct

Re: [R] predict function type class vs. prob

2023-09-23 Thread Rui Barradas
Às 11:12 de 22/09/2023, Milbert, Sabine (LGL) escreveu: Dear R Help Team, My research group and I use R scripts for our multivariate data screening routines. During routine use, we encountered some inconsistencies within the predict() function of the R Stats Package. Through internal research,

[R] predict function type class vs. prob

2023-09-22 Thread Milbert, Sabine (LGL)
Dear R Help Team, My research group and I use R scripts for our multivariate data screening routines. During routine use, we encountered some inconsistencies within the predict() function of the R Stats Package. Through internal research, we were unable to find the reason for this and have deci

Re: [R] Predict follow up time using parametric model in r

2018-11-20 Thread Israel Ortiz
You are right. Specifically, I need to predict the mean and median time to failure from a coxph model and several parametric models using new data. Thanks. El lun., 5 nov. 2018 a las 7:11, Therneau, Terry M., Ph.D. (< thern...@mayo.edu>) escribió: > First, type='expected' gives the expected cumu

Re: [R] Predict follow up time using parametric model in r

2018-11-03 Thread David Winsemius
On 11/3/18 12:59 PM, Israel Ortiz wrote: I am trying to predict follow-up time using several survival models, both parametric and semi-parametric. I achieve it for semi parametric models using predict.coxph function in R from survival package using type = "expected" as indicated in help. Howeve

Re: [R] Predict follow up time using parametric model in r

2018-11-03 Thread David Winsemius
On 11/3/18 12:59 PM, Israel Ortiz wrote: I am trying to predict follow-up time using several survival models, both parametric and semi-parametric. I achieve it for semi parametric models using predict.coxph function in R from survival package using type = "expected" as indicated in help. Howeve

[R] Predict follow up time using parametric model in r

2018-11-03 Thread Israel Ortiz
I am trying to predict follow-up time using several survival models, both parametric and semi-parametric. I achieve it for semi parametric models using predict.coxph function in R from survival package using type = "expected" as indicated in help. However, for parametric models, this option doesn't

Re: [R] Predict

2017-06-30 Thread David Winsemius
> On Jun 30, 2017, at 9:13 AM, Sarah Goslee wrote: > > Once again, you are over-writing your variable. This time, you are overwriting > the entirety of Stand_Height with the timeseries of height. > > Perhaps you should spend some time with one of the good introductory R > resources out there, a

Re: [R] Predict

2017-06-30 Thread Sarah Goslee
Once again, you are over-writing your variable. This time, you are overwriting the entirety of Stand_Height with the timeseries of height. Perhaps you should spend some time with one of the good introductory R resources out there, and think a bit more about your procedure. Sarah On Fri, Jun 30,

Re: [R] Predict

2017-06-30 Thread Bert Gunter
Seems like you need to start by learning R. Lots of good online tutorials exist -- have you spent time with any? And possibly also spend some time with a basic statistics text or a statistical expert to clarify your goals and methodology. Cheers, Bert Bert Gunter "The trouble with having an ope

Re: [R] Predict

2017-06-30 Thread Ahmed Attia
Sorry for the confusion, here is the edited question. The data= Stand_Height (attached) is recorded from 12/1/2009 to 12/31/2015 (25 observations) and the other dataset (leafbiom) is recorded from 10/7/2009 to 12/29/2016 (daily observations). I want to use the 25 observations of stand height to p

Re: [R] Predict

2017-06-30 Thread Sarah Goslee
There are a bunch of things wrong here, although without a reproducible example I can't really fix most of them. - You're overwriting SH within the loop. - You're running the regression 2641 times, even though the result never changes. - You're never predicting from your linear model using the oth

[R] Predict

2017-06-30 Thread Ahmed Attia
Hi folks, I have 25 stand height observations over 7 years period and daily leafbiomass data during this period. I want to use the 25 plant height observations as inputs and predict the daily stand height during the 7 years. SH=matrix(data=NA , nrow = 2641, ncol = 1) for (i in 1:2641) { SH<- p

Re: [R] Predict ARMA GARCH model with new data

2016-10-30 Thread David Winsemius
> On Oct 28, 2016, at 7:00 AM, Be Water wrote: > > How to add newdata to be predicted in an ARMA GARCH model with the fGARCH > package? > > ## R version 3.3.1 (2016-06-21) > ## Platform: x86_64-w64-mingw32/x64 (64-bit) > ## Running under: Windows >= 8 x64 (build 9200) > > library(fGarch) > >

[R] Predict ARMA GARCH model with new data

2016-10-29 Thread Be Water
How to add newdata to be predicted in an ARMA GARCH model with the fGARCH package? ## R version 3.3.1 (2016-06-21) ## Platform: x86_64-w64-mingw32/x64 (64-bit) ## Running under: Windows >= 8 x64 (build 9200) library(fGarch) ## Data simulation set.seed(345) ar.sim <- arima.sim(model=list(ar=c(.9

[R] "predict" values from object of type "list"

2016-02-17 Thread Steve Ryan
Hi Guys, I could need some help here. I have a set of 3d points (x,y,v). These points are not randomly scattered but lie on a surface. This surface can be taken as a calibration plane for x and y -values. My goal is to quantify this surface and than predict the v-values for given pairs of x- and y

Re: [R] predict() works with the design matrix but throws error with some rows of that matrix

2015-11-20 Thread Damir Cosic
Peter, this is extremely helpful. It is my first time using model.matrix() and I was not very clear about it.Thank you for clarifying it! It also helped me figure out how to do out-of-sample prediction. I add it here in case someone else needs help with this. oos.df<-data.frame(x=c(0,1), z=factor

Re: [R] predict() works with the design matrix but throws error with some rows of that matrix

2015-11-20 Thread Damir Cosic
Right on! I was using the expression for binomial logit. Thank you so much! On Fri, Nov 20, 2015 at 12:23 PM, peter dalgaard wrote: > > > On 20 Nov 2015, at 17:17 , Damir Cosic wrote: > > > > > > To do the same with matrix multiplication, I use the expression > 1/(1+exp(-xb)): > > > > head(1/(

Re: [R] predict() works with the design matrix but throws error with some rows of that matrix

2015-11-20 Thread peter dalgaard
> On 20 Nov 2015, at 17:17 , Damir Cosic wrote: > > > To do the same with matrix multiplication, I use the expression > 1/(1+exp(-xb)): > > head(1/(1+exp(-(cbind(c(1), mm) %*% coef(m)[2,] > > which should produce the third column above, but it doesn't: > I'm rusty on this, but I suspec

Re: [R] predict() works with the design matrix but throws error with some rows of that matrix

2015-11-20 Thread peter dalgaard
On 20 Nov 2015, at 10:07 , peter dalgaard wrote: >> >> On 20 Nov 2015, at 04:53 , Damir Cosic wrote: >> >> Hello, >> >> I am having problems with predict() after a multinomial logit regression by >> multinom(). I generate a design matrix with model.matrix() and use it to >> estimate the mode

Re: [R] predict() works with the design matrix but throws error with some rows of that matrix

2015-11-20 Thread peter dalgaard
> On 20 Nov 2015, at 04:53 , Damir Cosic wrote: > > Hello, > > I am having problems with predict() after a multinomial logit regression by > multinom(). I generate a design matrix with model.matrix() and use it to > estimate the model. Then, if I pass the entire design matrix to predict(), > it

[R] predict() works with the design matrix but throws error with some rows of that matrix

2015-11-19 Thread Damir Cosic
Hello, I am having problems with predict() after a multinomial logit regression by multinom(). I generate a design matrix with model.matrix() and use it to estimate the model. Then, if I pass the entire design matrix to predict(), it returns the same output as fitted(), which is expected. But if I

[R] Predict method of J48 in RWeka (Urgent)

2015-09-06 Thread Priyanka Garg
hi, I am new to R using package RWeka.Currently i am using J48 classifier for classification and prediction. My doubt is after building tree using J48, when i use the same for prediction on my test set it gives the predicted class names. How could i calculate accuracy, precision, recall and also o

Re: [R] Predict Function use with GLM

2015-08-12 Thread Ben Bolker
trisgutt hotmail.com> writes: > > I am currently using a GLM with Gaussian family to model fish depth~length + > distance from shore: > > model1 <- glm(Depth ~ length + distance from shore, > family=gaussian(link="log")) > > There are no zero depths. I would like to use the above model with t

[R] Predict Function use with GLM

2015-08-12 Thread trisgutt
I am currently using a GLM with Gaussian family to model fish depth~length + distance from shore: model1 <- glm(Depth ~ length + distance from shore, family=gaussian(link="log")) There are no zero depths. I would like to use the above model with the predict function in R to generate three lines

Re: [R] predict function in regression analysis

2015-05-06 Thread Stéphane Adamowicz
Maybe this is what you wanted : Data <- structure(list(y = c(4.5, 4.5, 4.7, 6.7, 6, 4.4, 4.1, 5.3, 4, 4.2, 4.1, 6.4, 5.5, 3.5, 4.6, 4.1, 4.6, 5, 6.2, 5.9, 3.9, 5.3, 6.9, 5.7), lot = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), duration = c(0

Re: [R] predict function in regression analysis

2015-05-05 Thread Bert Gunter
I think you want CI's for intercepts, not "means" (what is a "mean" for a line??). If so, the ?confint function will give this to you for the lot effect estimates when applied to a model fitted without an intercept: myfit <-lm(y~ lot-1+time) confint(myfit) Further discussion should be directed

[R] predict function in regression analysis

2015-05-05 Thread li li
Hi all, I have the following data in which there is one factor lot with six levels and one continuous convariate time. I want to fit an Ancova model with common slope and different intercept. So the six lots will have seperate paralell regression lines.I wanted to find the upper 95% confidence li

Re: [R] Predict in glmnet for Cox family

2015-04-23 Thread jitvis
Will I be able to do a prediction similar to above with random forest and compare both the predict survival time result from AFT model and the Survival Random forest model ? Sincerely, -- View this message in context: http://r.789695.n4.nabble.com/Predict-in-glmnet-for-cox-family-tp4706070p470

Re: [R] Predict in glmnet for Cox family

2015-04-22 Thread jitvis
Dear Terry, Thank you for your reply, I understood its difficult to predict survival time, in general. I have tried another approach and I would like to know whether my approach is correct. I have clustered my dataset based on some similarity and reduced the number of variables using LASSO and

Re: [R] Predict in glmnet for Cox family

2015-04-21 Thread Therneau, Terry M., Ph.D.
On 04/21/2015 05:00 AM, r-help-requ...@r-project.org wrote: Dear All, I am in some difficulty with predicting 'expected time of survival' for each observation for a glmnet cox family with LASSO. I have two dataset 5 * 450 (obs * Var) and 8000 * 450 (obs * var), I considered first one as t

[R] Predict in glmnet for cox family

2015-04-20 Thread jitvis
Dear All, I am in some difficulty with predicting 'expected time of survival' for each observation for a glmnet cox family with LASSO. I have two dataset 5 * 450 (obs * Var) and 8000 * 450 (obs * var), I considered first one as train and second one as test. I got the predict output and I

[R] predict model time series

2014-02-21 Thread Marlin Keith Cox
I am using a gam for a model predictor and need to forecast into the future based off data collected earlier. I would like to predict fish weight on day 10 from measures taken on a fish from day 2. This seems simple, but using predict, I have only been able to predict weight for a given day. A s

Re: [R] predict() from conditional logit model?

2013-09-14 Thread David Winsemius
ank you very much for your help. > Have a good day > Marine > >> CC: r-help@r-project.org >> From: dwinsem...@comcast.net >> To: marine.re...@hotmail.fr >> Subject: Re: [R] predict() from conditional logit model? >> Date: Thu, 12 Sep 2013 17:52:33 -0500 >&

Re: [R] predict() from conditional logit model?

2013-09-12 Thread David Winsemius
On Sep 12, 2013, at 3:31 PM, Marine Regis wrote: Hello everybody, I used the function clogit() (package survival) to build a conditional logit model. This is the R output of my model : coef exp(coef) se(coef) robust se z Pr(>|z|) anthro 2.14776 8.56565 0.09352 0.53989 3.978 6.94e-05 *** cor

[R] predict from tobit regression

2013-09-12 Thread didimayr
Dear R experts, I am currently working on a rather simple tobit regression, where the dependet variable is left-censored (>0). I would like to apply a Tobit regression and then use the parameters of this regression to make a prediction with new data. The intention behind this is to do an extrapola

[R] predict() from conditional logit model?

2013-09-12 Thread Marine Regis
Hello everybody, I used the function clogit() (package survival) to build a conditional logit model. This is the R output of my model : coef exp(coef) se(coef) robust se z Pr(>|z|) anthro 2.14776 8.56565 0.09352 0.53989 3.978 6.94e-05 *** cor 0.92365 2.51846 0.07757 0.41944 2.202 0.0

Re: [R] Predict function in Raster package

2012-11-28 Thread megmurr
I recieved this response from the package authors: This warning comes from the dismo package (predict with Mahanalobis object). You can ignore it. It will go away with the next version of dismo (you can get it from R-Forge). So the problem is in dismo which has not been updated since raster has

Re: [R] Predict function in Raster package

2012-11-28 Thread megmurr
Thank you. Yes I have raised this question with the authors. -- View this message in context: http://r.789695.n4.nabble.com/Predict-function-in-Raster-package-tp4651027p4651143.html Sent from the R help mailing list archive at Nabble.com. __ R-help@

Re: [R] Predict function in Raster package

2012-11-28 Thread floedan...@gmail.com
Hi, I am having the same problem. I am running MaxEnt and using the Raster package. But when i try to extract the BIL-file from one RasterLayer: str(pred@file@bandorder), and stack() this BIL-file with other environmental variables but get the same error.. “In layerNames(x): the layerNames func

Re: [R] Predict function in Raster package

2012-11-27 Thread David Winsemius
On Nov 27, 2012, at 2:33 PM, megmurr wrote: Hey, I am having troubles using the 'predict' function with in the Raster package. I am using pm<-predict(mm, predictors) where mm is the mahalanobis distance and the predictors are a stack of 6 raster layers containing environmental variables. Whe

Re: [R] Predict function in Raster package

2012-11-27 Thread David Winsemius
On Nov 27, 2012, at 2:33 PM, megmurr wrote: Hey, I am having troubles using the 'predict' function with in the Raster package. I am using pm<-predict(mm, predictors) where mm is the mahalanobis distance and the predictors are a stack of 6 raster layers containing environmental variables. Whe

[R] Predict function in Raster package

2012-11-27 Thread megmurr
Hey, I am having troubles using the 'predict' function with in the Raster package. I am using pm<-predict(mm, predictors) where mm is the mahalanobis distance and the predictors are a stack of 6 raster layers containing environmental variables. When I try to run the prediction I get the followin

[R] predict glm() with offset

2012-10-31 Thread Lucas Chaparro
Dear R friends. I have a question about running a glm( family= 'binomial', *offset=T*), (I know offset is a vector of values) My doubt is about predicting the values on a new data. Does the predict() function considers the offset? o should I especified something? Here is the model I´m using: *mod

Re: [R] predict arima

2012-09-11 Thread David Winsemius
On Sep 11, 2012, at 12:26 AM, Peter Jackson wrote: > Hello everybody, can someone please help me with this, please? Kind > regards,Fabian > From: schrot...@hotmail.com > To: r-help@r-project.org > Date: Mon, 10 Sep 2012 14:51:01 +0000 > Subject: [R] predict arima >

Re: [R] predict arima

2012-09-11 Thread Peter Jackson
Hello everybody, can someone please help me with this, please? Kind regards,Fabian From: schrot...@hotmail.com To: r-help@r-project.org Date: Mon, 10 Sep 2012 14:51:01 + Subject: [R] predict arima Hello, I have a question regarding the predict command for ARIMA models. Why do I not

[R] predict pixels of raster using caret-derived models

2012-09-10 Thread ollestrat
Is it somehow possible to use the the predict method of the raster package with a prediction model obtained using caret's train()? / predict(rasterStack, carettrain, filename="...", progress='text', format="BSQ", datatype='INT1U', type='response', overwrite=TRUE) / Thank you -- View t

[R] predict arima

2012-09-10 Thread Peter Jackson
Hello, I have a question regarding the predict command for ARIMA models. Why do I not have to give any input except the number of steps for the forecast? Which input value is used (in my case for “y(t)”)? Will the last parameter of the estimate vector be used (in my example “6”)? x <- c(1,2,3

Re: [R] predict rpart newdata - introduce only values variables used in the tree

2012-09-05 Thread RP
agent dunham hotmail.com> writes: > I've a tree which included at first 23 variables. Then I've pruned this > tree, and there are only 8 variables involved. Are you sure the others are not being considered as surrogate variables? > Is there a way to introduce only this 8 values? No. Why? See

[R] predict rpart newdata - introduce only values variables used in the tree

2012-09-04 Thread agent dunham
Dear community, I've a tree which included at first 23 variables. Then I've pruned this tree, and there are only 8 variables involved. I'd like to predict and only introduce in newdata the values of these 8 variables involved. However, as the tree was built with the 23, it asked me for 15 value

Re: [R] Predict in the package R2BayesX

2012-06-12 Thread Achim Zeileis
On Tue, 12 Jun 2012, Paul J Ossenbruggen wrote: I have the same question. This paper may help you. http://eeecon.uibk.ac.at/wopec2/repec/inn/wpaper/2012-10.pdf Thanks for posting this, Paul. The paper above describes the current state of affairs in "R2BayesX". But we are also working on exte

Re: [R] Predict in the package R2BayesX

2012-06-12 Thread Paul J Ossenbruggen
I have the same question. This paper may help you. http://eeecon.uibk.ac.at/wopec2/repec/inn/wpaper/2012-10.pdf Best of luck. Paul -- View this message in context: http://r.789695.n4.nabble.com/Predict-in-the-package-R2BayesX-tp4632618p4633145.html Sent from the R help mailing list archive at

Re: [R] Predict in the package R2BayesX

2012-06-12 Thread Paul J Ossenbruggen
I have the same question. This paper may help you. http://eeecon.uibk.ac.at/wopec2/repec/inn/wpaper/2012-10.pdf Best of luck. Paul -- View this message in context: http://r.789695.n4.nabble.com/Predict-in-the-package-R2BayesX-tp4632618p4633144.html Sent from the R help mailing list archive at

[R] Predict in the package R2BayesX

2012-06-06 Thread niandra
Hi all I'm using the function bayesx to estimate a simple model, for example: library(R2BayesX) ## generate some data set.seed(111) n <- 200 ## regressor dat <- data.frame(x = runif(n, -3, 3)) ## response dat$y <- with(dat, 1.5 + sin(x) + rnorm(n, sd = 0.6)) ## estimate models with ## bayesx

Re: [R] Using the R predict function to forecast a model fit with auto.arima function

2012-04-27 Thread R. Michael Weylandt
> > Can anybody help me or tell me how could I do to be able to generate the > predictions? > > Best regards, > > Paul > > -- > View this message in context: > http://r.789695.n4.nabble.com/Using-the-R-predict-function-to-forecast-a-model-fit-with-auto-arima-function-tp4

[R] Using the R predict function to forecast a model fit with auto.arima function

2012-04-26 Thread PaulJr
ies, I really do not understand the reason for that error message. Can anybody help me or tell me how could I do to be able to generate the predictions? Best regards, Paul -- View this message in context: http://r.789695.n4.nabble.com/Using-the-R-predict-function-to-forecast-a-model-fit-with-au

[R] predict GLM with offset MASS

2012-04-13 Thread smfa
Hi, I know this is probably a stupid question... But I don't seem to find the answer. I'm fitting a GLM with a Poisson family, using MASS, and then tried to get a look at the predictions, however the offset does seem to be taken into consideration: model_glm=glm(cases~rhs(data$year,2003)+lhs(d

Re: [R] predict () for LDA and GLM

2012-03-23 Thread Uwe Ligges
1. Not reproducible for me (gives an ERROR). 2. Please try to make examples "minimal", as the psoting guide suggests. 3. Please follow my advice and provide "A correct formula describing the model with separate variables with the data.frame passed to the data argument of the lda() function." T

Re: [R] predict () for LDA and GLM

2012-03-22 Thread palanski
Here is the full code. Look to the last part, denoted #(f) for the question being asked in this post: #(a) Split datapoints into training (70 points) and test (30 points) sets. #Read in ass4-data.txt and ass3-phodata.txt ass4data = read.delim('http://www.moseslab.csb.utoronto.ca/alan/ass4-data.txt

Re: [R] predict () for LDA and GLM

2012-03-22 Thread Uwe Ligges
On 22.03.2012 03:24, palanski wrote: Hi! I'm using GLM, LDA and NaiveBayes for binomial classification. My training set is 70 rows long with 32 features, and my test set is 30 rows long with 32 features. Using Naive Bayes, I can train a model, and then predict the test set with it like so: a

[R] predict () for LDA and GLM

2012-03-21 Thread palanski
Hi! I'm using GLM, LDA and NaiveBayes for binomial classification. My training set is 70 rows long with 32 features, and my test set is 30 rows long with 32 features. Using Naive Bayes, I can train a model, and then predict the test set with it like so: ass4q1.dLDA = lda(ass4q1.trainSet[,1]~ass4

[R] Predict function

2012-02-02 Thread Davg
I've created a linear model and am trying to use the predict function to predict the outcome of a sports game. I have four explanatory variables a,b,c,d. where a,b relate to the home team and c,d relate to the away team. i'd like to know the probability that the home team wins (assuming no draw

Re: [R] predict risk (% of death) at a certain time point

2011-12-19 Thread David Winsemius
On Dec 19, 2011, at 10:05 PM, Bill Hyman wrote: Dear all, Does any one know how to calculate the risk (death rate) at some time point (say 5 yrs) based on Kaplan-Meier curve in coxph model in R? I know how to fit the survival data with coxph. But need to calculate risk at some time point

[R] predict risk (% of death) at a certain time point

2011-12-19 Thread Bill Hyman
Dear all, Does any one know how to calculate the risk (death rate) at some time point (say 5 yrs) based on Kaplan-Meier curve in coxph model in R? I know how to fit the survival data with coxph. But need to calculate risk at some time point. Many thanks. Bill _

Re: [R] predict in lmer

2011-12-14 Thread Ben Bolker
arunkumar gmail.com> writes: > Please any one help in finding the predicted value for lmer function > > model<- lmer(formula =formula,data=data,verbose=TRUE,family = "gaussian") > > I need to get predicted value for this model. Please see the code at http://glmm.wikidot.com/faq , and di

[R] predict in lmer

2011-12-13 Thread arunkumar1111
Hi Please any one help in finding the predicted value for lmer function model<- lmer(formula =formula,data=data,verbose=TRUE,family = "gaussian") I need to get predicted value for this model. I'm not able to get the formula Please help Thanks in advance Arun -- View this message in context

Re: [R] predict lmer

2011-11-01 Thread Ben Bolker
Natalia Vizcaíno Palomar gmail.com> writes: > I've been reading for many days trying to predict with lmer but I haven't > managed to do it. > I've fitted an allometric model for trees where I have included climatic > variables and diameter in the fixed part and > in the random part I've included

Re: [R] predict for a cv.glmnet returns an error

2011-11-01 Thread Dennis Murphy
Hi: Here's what I got when I ran your code: library('glmnet') > x=matrix(rnorm(100*20),100,20) > y=rnorm(100) > cv.fit=cv.glmnet(x,y) > predict(cv.fit,newx=x[1:5,]) 1 [1,] 0.1213114 [2,] 0.1213114 [3,] 0.1213114 [4,] 0.1213114 [5,] 0.1213114 > coef(cv.fit) 21 x 1 sparse Matrix of cla

[R] predict for a cv.glmnet returns an error

2011-11-01 Thread asafw
Hi there, I am trying to use predict() with an object returned by cv.glmnet(), and get the following error: no applicable method for 'predict' applied to an object of class "cv.glmnet" What's wrong? my code: x=matrix(rnorm(100*20),100,20) y=rnorm(100) cv.fit=cv.glmnet(x,y) predict(cv.fit,newx=

[R] predict lmer

2011-11-01 Thread Natalia Vizcaíno Palomar
Dear all, I've been reading for many days trying to predict with lmer but I haven't managed to do it. I've fitted an allometric model for trees where I have included climatic variables and diameter in the fixed part and in the random part I've included the experimental sites where trees are and al

[R] predict() of garchFit

2011-09-20 Thread user84
Hi, could anyone tell me how predict() predicts the meanError or standardDerivation of a garchFit(1,1)-model, knowing the coefficients mu, omega, alpha1, beta1 and of course all datapoints? Thanks and sorry for my poor english. -- View this message in context: http://r.789695.n4.nabble.com/pred

Re: [R] predict() function on a list made up of a system of equations

2011-08-14 Thread Joshua Wiley
On Sun, Aug 14, 2011 at 7:55 PM, Darius H wrote: > > > > > > > > > The above whitespace comes about from posting to this list (which converts emails to plaintext) in HTML. Please set future emails to plain text (its under text formatting or something like that in hotmail). > Hi everyone, > > Do

[R] predict() function on a list made up of a system of equations

2011-08-14 Thread Darius H
Hi everyone, Does anyone know how I can use the predict() function or anything similar in a various packages to forecast future values of a system of equations in a list? I keep getting an error message when I try to use the predict function and I cannot find anything on the help arc

Re: [R] predict() and heteroskedasticity-robust standard errors

2011-07-25 Thread Achim Zeileis
On Mon, 25 Jul 2011, E Hofstadler wrote: Hello there, I have a linear regression model for which I estimated heteroskedasticity-robust (Huber-White) standard errors using the coeftest function in the lmtest-package. Now I would like to inspect the predicted values of the dependent variable for

[R] predict() and heteroskedasticity-robust standard errors

2011-07-24 Thread E Hofstadler
Hello there, I have a linear regression model for which I estimated heteroskedasticity-robust (Huber-White) standard errors using the coeftest function in the lmtest-package. Now I would like to inspect the predicted values of the dependent variable for particular groups and include a confidence

Re: [R] predict with model (rms package)

2011-06-08 Thread Mark Seeto
Thanks for your reply, Frank. I've noticed that the x.knots object doesn't actually have to be the vector of knots. Just having x.knots <- 0 or even x.knots <- "a" will allow predict to work. Mark Seeto Frank Harrell wrote: > > This is a consequence of predict.ols calling predictrms which relie

Re: [R] predict with model (rms package)

2011-06-08 Thread Frank Harrell
This is a consequence of predict.ols calling predictrms which relies on model.frame which re-issues the expression of x.knots. You would have the same problem if using update(fit object) in another session. For that reason you have to keep an external knots vector available in your environment.

[R] predict with model (rms package)

2011-06-07 Thread Mark Seeto
Dear R-help, In the rms package, I have fitted an ols model with a variable represented as a restricted cubic spline, with the knot locations specified as a previously defined vector. When I save the model object and open it in another workspace which does not contain the vector of knot locations,

Re: [R] predict witht he eha package

2011-06-03 Thread Terry Therneau
"Error in predict.coxph(f.ph.eha, newdata = mort, type = "lp") : Data is not the same size as it was in the original fit" This error message was added in a recent update to predict.coxph. If it needs to reconstruct some aspects from the original fit, such as the X matrix or strata vector, it ma

[R] predict with eha package

2011-06-02 Thread Mike Harwood
Hello list, and thank you in advance. I'm unable to generate predicted values when specifying newdata using phreg and aftreg models in the eha package, but I do not have the same problem with a proportional hazards model from coxph. Without the newdata argument the predicted values are returned,

Re: [R] predict a MA timeseries

2011-05-23 Thread Rolf Turner
On 24/05/11 01:24, user84 wrote: Hi, could anyone tell me how predict() predicts the new value(s), of a MA(1) arima-modell. its really easy to make it with an AR(1), knowing the last term, but how can i or R know the last error? I think what you're asking here is this: Suppose X_t = a_t +

[R] predict a MA timeseries

2011-05-23 Thread user84
Hi, could anyone tell me how predict() predicts the new value(s), of a MA(1) arima-modell. its really easy to make it with an AR(1), knowing the last term, but how can i or R know the last error? It would also help if somebody could tell me how to find the "open" source of the function predict().

Re: [R] predict 'expected' with eha package

2011-05-21 Thread Göran Broström
Mike, On Sat, May 21, 2011 at 10:15 PM, Mike Harwood wrote: > I am unsure what is being returned, and what is supposed to be > returned, when using 'predict' with "type='expected'" for an aftreg > survival model. I'm sorry, but there is no 'predict.aftreg'. The generic 'predict' "works" because

[R] predict 'expected' with eha package

2011-05-21 Thread Mike Harwood
I am unsure what is being returned, and what is supposed to be returned, when using 'predict' with "type='expected'" for an aftreg survival model. The code below first generates a weibull model, then uses predict to create a vector of the linear predictors, then attempts to create the 'expected'

Re: [R] predict

2011-04-15 Thread Paul Hiemstra
On 04/14/2011 10:49 PM, Serdar Akin wrote: > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal

[R] predict

2011-04-14 Thread Serdar Akin
Hi I'm trying to forecast an zoo-object the following exempel of code:: "dynlm(y_t = 1+ L(y_t, 1:5}}" but I cannot use predict() nor forecast() to make an forecast of the object. Regard Serdar [[alternative HTML version deleted]] __ R-help@r

Re: [R] predict()

2011-04-14 Thread Ivo Shterev
Dear Dr. Therneau, Thank you for your response. Just to point out that we didn't experience any problems with the lm() function under R version 2.12.2 (2011-02-25): > set.seed(123) > testdat=data.frame(y=rexp(10),event=rep(0:1,each=5),x=rnorm(10)) > testfm=as.formula('y~x') > > testfun=function

Re: [R] predict()

2011-04-14 Thread Terry Therneau
--- begin included message --- I am experimenting with the function predict() in two versions of R and the R extension package "survival". library(survival) set.seed(123) testdat=data.frame(otime=rexp(10),event=rep(0:1,each=5),x=rnorm(10)) testfm=as.formula('Surv(otime,event)~x') testfun=functio

[R] predict()

2011-04-13 Thread Ivo Shterev
Hi, I am experimenting with the function predict() in two versions of R and the R extension package "survival". library(survival) set.seed(123) testdat=data.frame(otime=rexp(10),event=rep(0:1,each=5),x=rnorm(10)) testfm=as.formula('Surv(otime,event)~x') testfun=function(dat,fm) { predict

Re: [R] predict ordered regresssion

2011-04-10 Thread Prof Brian Ripley
On Sun, 10 Apr 2011, Joe P King wrote: Is there a way to get confidence intervals around an ordered regression like polr() in the MASS package? Please don't both ask the author directly *and* post to a forum. The answer is the same as the one I sent you directly. - For what do you want CIs,

[R] predict ordered regresssion

2011-04-10 Thread Joe P King
Is there a way to get confidence intervals around an ordered regression like polr() in the MASS package? --- Joe King, M.A. Ph.D. Student University of Washington - Seattle 206-913-2912 j...@joepking.com --

[R] predict fGarch doubt

2011-04-07 Thread Luis Felipe Parra
Hello I am using the predict method in fGarch. I tried to replicate what I supposed it was doing when I estimated an ARMA(2,2)+GARCH(1,1) by doing: (temp is my ouput form garchFit) fit = temp@fit$par Nobs = length(temp@data) # Predecir media fit["mu"]+sum(fit[2:(2+2-1)]*temp@data[length(temp@dat

Re: [R] predict lm doubt

2011-03-18 Thread Henrique Dallazuanna
Your lm args are wrong: Try this: predict(lm(Dens_min ~ Velocity, dfTestes3sitesCriptic)) or predict(lm(Dens_min ~ Velocity_corrected, dfTestes3sitesCriptic)) On Fri, Mar 18, 2011 at 9:45 AM, barbara costa wrote: > Hello, >  does anyone knows this predict is not resulting? > > # lm predict >

[R] predict lm doubt

2011-03-18 Thread barbara costa
Hello, does anyone knows this predict is not resulting? # lm predict dfTestes3sitesCriptic$Velocity_corrected <- ifelse (dfTestes3sitesCriptic$Season == "A" & dfTestes3sitesCriptic$BeforeAfter == "Before", (dfTestes3sitesCriptic$Velocity * mVel3ABefAfter), (ifelse (dfTestes3sitesCriptic$Season ==

[R] predict not complete?

2011-02-16 Thread cosmokramer
take this code library(dynlm) test=dynlm(diff(log(y))~ lag(x, -1) + lag(z, -1)) fc=predict(test) fc when I run this and look at "fc", the values there only go as long as the sample (of y) goes, but it should be one further, right? since the other values are lagged. Is predict the wrong functi

Re: [R] predict and arima

2011-02-09 Thread Jose-Marcio Martins da Cruz
bryan wrote: Indeed, there was a bug ... my current play code looks like this ... H the bug seems to be there, still. >fit<- arima(x.ts, order=c(p,q,d), * >seas

Re: [R] predict and arima

2011-02-09 Thread bryan
Indeed, there was a bug ... my current play code looks like this ... get.best.arima <- function(x.ts, maxord=c(3,3,3,3)) { # function based on 'Introductory Time Series with R' # ... try and fit the best ARIMA(p,d,q,P,D,Q) model # using all permutations from 0 to max

  1   2   3   >