[R] predict kernelmatrix

2007-08-13 Thread Nelson Hernandez Gonzalez
HI I got a problem in the predict function of the kernlab. I want to use ksvm and predict with kernelmatrix (S4 method for signature 'kernelMatrix') #executing the following sentences library(kernlab) # identity kernel k - function(x,y) { n-length(x) cont-0 for(i in 1:n){

[R] Predict using SparseM.slm

2007-08-01 Thread T. Balachander
Hi, I am trying out the SparseM package and had the a question. The following piece of code works fine: ... fit = slm(model, data = trainData, weights = weight) ... But how do I use the fit object to predict the values on say a reserved testDataSet? In the regular lm function I would do

Re: [R] Predict using SparseM.slm

2007-08-01 Thread roger koenker
If you are feeling altruistic you could write a predict method for slm objects, it wouldn't be much work to adapt what is already available and follow the predict.lm prototype. On the other hand if you are looking for something quick and dirty you can always resort to newX %*%

[R] Predict(); Warning rank deficient matrix

2007-02-18 Thread vinod gullu
I am trying to use lm() for resression followed by stepAIC function. Now when i try to use to predict for some input, predict() gives a warning : prediction from a Rank deficient matrix may be misleading. As I am new to R (or to statistics) How alarming this warning may be? Regards,

[R] predict on biglm class

2007-02-12 Thread Benilton Carvalho
Hi Everyone, I often use the 'safe prediction' feature available through glm(). Now, I'm at a situation where I must use biglm:::bigglm. ## begin example library(splines) library(biglm) ff - log(Volume)~ns(log(Girth), df=5) fit.glm - glm(ff, data=trees) fit.biglm - bigglm(ff, data=trees)

Re: [R] predict and arima

2006-11-25 Thread Prof Brian Ripley
Part of the fit is the Kalman filter state after running the model forwards. Try reversing your series, fitting and then forecasting. You might have more success in understanding arima0. On Sat, 25 Nov 2006, Franck Arnaud wrote: Hi all, Forecasting from an arima model is easy with predict.

[R] predict and arima

2006-11-24 Thread Franck Arnaud
Hi all, Forecasting from an arima model is easy with predict. But I can't manage to backcast : invent data from the model before the begining of the sample. The theory is easy : take your parameters, reverse your data, forecast, and then reverse the forecast I've tried to adapt the predict

Re: [R] predict with logistic regression

2006-09-19 Thread Anupam Tyagi
Jan Sabee jan.sabee at gmail.com writes: I know that is probability of predict for new dataset. My question is how can I know each probability according to class (sore). I mean that I need the result of predit something like (M=1, F=0): 1 2 3 4 5 6 7 8 9 10 1 0 0 0 1 0 1 1

[R] predict with logistic regression

2006-09-15 Thread Jan Sabee
I am learning about using logistic regression with glm. Suppose I have dataset: duration - c(45,15,40,83,90,25,35,65,95,35,75,45,50,75,30,25,20,60,70,30,60,61,65,15,20,45,15,25,15,30,40,15,135,20,40) type - c(0,0,0,1,1,1,rep(0,5),1,1,1,0,0,1,1,1,rep(0,4),1,1,0,1,0,1,0,0,rep(1,4)) sore -

[R] Predict with loess

2006-06-13 Thread Jouanin Celine
I want to do a nonparametric regression. I’m using the function loess. The variable are the year from 1968 to 1977 and the dependant variable is a proportion P. The dependant variable have missing value (NA). The script is : year - 1969:2002 length(year)

Re: [R] Predict with loess

2006-06-13 Thread Prof Brian Ripley
On Tue, 13 Jun 2006, Jouanin Celine wrote: I want to do a nonparametric regression. I’m using the function loess. The variable are the year from 1968 to 1977 and the dependant variable is a proportion P. The dependant variable have missing value (NA). The script is :

Re: [R] predict function does not provide SE estimates for multivariate timeseries VAR models?

2006-06-04 Thread Spencer Graves
The dse2 package contains functions forecast and forecastCov. Have you tried them? There may be functions to estimate vector autoregressive models in more than one package in R. If you'd like more help from this listserve, I would encourage you to submit another post after

[R] predict function does not provide SE estimates for multivariate timeseries VAR models?

2006-06-01 Thread Michael
What can I do? Thanks a lot! [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] predict function does not provide SE estimates for multivariate timeseries VAR models?

2006-06-01 Thread Berwin A Turlach
Michael == Michael [EMAIL PROTECTED] writes: Michael What can I do? Implement this feature and send it to the person responsible for the code for inclusion? Michael Thanks a lot! Indeed, you contribution would be very much appreciated. Cheers, Berwin

[R] Predict nls new data with se.fit snf intervals

2006-04-16 Thread Jiawei Yan
Using R to predict.nls() using new data, `se.fit' and `interval' are ignored. . Is there any update for this? Anybody has those routine or may advise me how to do that? Thanks [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch

[R] Predict function for 'newdata' of different dimension in svm

2006-03-31 Thread David Meyer
Sandra, hard to tell where the error message originates from without having the data at hand (perhaps you could provide that to me off-list?), but I am almost sure things will work when you train the model the standard way: cd1.svm-svm(Acode~EXT+TOF, data = boot.dist.dat, cost=100, gamma=20)

[R] Predict function for 'newdata' of different dimension in svm

2006-03-30 Thread mcbride
I am using the predict function on a support vector machine (svm) object, and I don't understand why I can't predict on a dataset with more observations than the training dataset. I think this problem is a generic predict problem, but I'm not sure. The original svm was fit on 50 observations.

[R] predict nbinomial glm

2005-08-16 Thread K. Steinmann
Dear R-helpers, let us assume, that I have the following dataset: a - rnbinom(200, 1, 0.5) b - (1:200) c - (30:229) d - rep(c(q, r, s, t), rep(50,4)) data_frame - data.frame(a,b,c,d) In a first step I run a glm.nb (full code is given at the end of this mail) and want to predict my response

Re: [R] predict nbinomial glm

2005-08-16 Thread Prof Brian Ripley
This is seems to be an unstated repeat of much of an earlier and unanswered post https://stat.ethz.ch/pipermail/r-help/2005-August/075914.html entitled [R] error in predict glm (new levels cause problems) It is nothing to do with `nbinomial glm' (sic): all model fitting

Re: [R] predict nbinomial glm

2005-08-16 Thread Sundar Dorai-Raj
Katharina, I agree with Prof. Ripley's assessment. But, perhaps one thing you may have overlooked is that subset.data.frame does not remove unused levels. So, subset_of_dataframe = subset(data_frame, (b 80 c 190)) levels(subset_of_dataframe$d) [1] q r s t table(subset_of_dataframe$d)

[R] Predict

2005-07-19 Thread Matthias Eggenberger
When I callculate a linear model, then I can compute via confint the confidencial intervals. the interval level can be chosen. as result, I get the parameter of the model according to the interval level. On the other hand, I can compute the prediction-values for my model as well with

Re: [R] Predict

2005-07-19 Thread Christoph Buser
Dear Matthias Can you provide an example to demonstrate what you did? Two remarks to your email. Maybe that answers already your question. 1) Using predict() you will get the estimated value for each observation or for new data. You can reproduce this value by using the coefficients from

[R] predict function for GLMM

2005-06-11 Thread weihong
I use predict for predictions from glm. I am wondering if there is a predict function for predictions from the results of GLMM model? Thanks ahead! Weihong Li Undergraduate Student in Statistics University of Alberta __ R-help@stat.math.ethz.ch

[R] predict() question

2005-05-17 Thread Weiwei Shi
Hi, there: Following yesterday's question ( i had a new level for a categorical variable occurred in validation dataset and predict() complains about it: i made some python code to solve the problem), but here, I am just curious about some details about the mechanism: I believed rpart follows

[R] predict problem

2005-05-16 Thread Weiwei Shi
Hi, there: I have a question on predict() function. I built a set of trees using rpart and when I do prediction, I got the following error: Error in model.frame.default(Terms, newdata, na.action = act, xlev = attr(object , : factor V19 has new level(s) 45 Execution halted I think the

[R] predict nlme syntax

2005-05-10 Thread Petr Pikal
Dear all Please help me with correct syntax of predict.nlme. I would like to predict from nlme object for new data. I used predict(fit.nlme6, data=newdata) but I have always got fitted values, no matter how I changed newdata. I have summary(fit.nlme6) Nonlinear mixed-effects model fit by

Re: [R] predict nlme syntax

2005-05-10 Thread Douglas Bates
Petr Pikal wrote: Dear all Please help me with correct syntax of predict.nlme. I would like to predict from nlme object for new data. I used predict(fit.nlme6, data=newdata) but I have always got fitted values, no matter how I changed newdata. I have The argument's name is newdata, not

[R] predict(arima)

2004-08-29 Thread Remigijus Lapinskas
Dear All, R 1.9.1, Windows When copying and pasting a few lines from the 'predict.Arima' help, I get an error message: data(lh) predict(arima(lh, order = c(3,0,0)), n.ahead = 12) Error in eval(expr, envir, enclos) : Object xreg not found On the other hand, the following is OK: data(lh)

Re: [R] predict(arima)

2004-08-29 Thread Prof Brian Ripley
Nothing is wrong with arima: those commands are part of make check, so your copy of R has been corrupted. Search for masked functions, and try starting R with --vanilla. On Sun, 29 Aug 2004, Remigijus Lapinskas wrote: Dear All, R 1.9.1, Windows When copying and pasting a few lines from

[R] predict( ..., type=terms)

2004-04-07 Thread Giovanni Petris
Hello, After reading the help for predict.lm and predict.glm, it is not clear to me what are the values returned by predict( ..., type=terms). Anybody willing to enlighten me? The example provided by Peter Dalgaard in a recent post unfortunately was enlightening only to the point of making me

Re: [R] predict( ..., type=terms)

2004-04-07 Thread Thomas Lumley
On Wed, 7 Apr 2004, Giovanni Petris wrote: Hello, After reading the help for predict.lm and predict.glm, it is not clear to me what are the values returned by predict( ..., type=terms). Anybody willing to enlighten me? For each term in the formula, extract its coefficients and the

RE: [R] predict( ..., type=terms)

2004-04-07 Thread BXC (Bendix Carstensen)
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Lumley Sent: Wednesday, April 07, 2004 5:44 PM To: Giovanni Petris On Wed, 7 Apr 2004, Giovanni Petris wrote: Hello, After reading the help for predict.lm and predict.glm, it is not

Re: [R] predict function

2004-02-14 Thread Rolf Turner
Uwe Ligges wrote: Thomas Jagoe wrote: I am using R to do a loess normalisation procedure. . . . However in 1.8.1 all goes well until the last step when I get an error: Error: couldn't find function predict.loess Can anyone help ? Use predict() instead of

RE: [R] predict function

2004-02-14 Thread Liaw, Andy
If you know what you're looking for, you can always get to non-exported function by using :::, e.g., modreg:::predict.loess will give you the function. Andy From: Rolf Turner Uwe Ligges wrote: Thomas Jagoe wrote: I am using R to do a loess normalisation procedure. . .

RE: [R] predict function

2004-02-14 Thread John Fox
Dear Roft and Andy, At 10:41 AM 2/14/2004 -0500, Liaw, Andy wrote: If you know what you're looking for, you can always get to non-exported function by using :::, e.g., modreg:::predict.loess will give you the function. and getS3method(predict, loess) or getAnywhere(predict.loess) will retrieve

Re: [R] predict function

2004-02-14 Thread Gabor Grothendieck
] Subject: Re: [R] predict function On Sat, 14 Feb 2004 10:41:41 -0500, you wrote: If you know what you're looking for, you can always get to non-exported function by using :::, e.g., modreg:::predict.loess will give you the function. Or getAnywhere('predict.loess') or getS3method

[R] predict function

2004-02-13 Thread Thomas Jagoe
I am using R to do a loess normalisation procedure. In 1.5.1 I used the following commands to normalise the variable logratio, over a 2d surface (defined by coordinates x and y): array - read.table(121203B_QCnew.txt, header=T, sep=\t) array$logs555-log(array$s555)/log(2)

Re: [R] predict function

2004-02-13 Thread Douglas Grove
You can't use this anymore. The function predict() has a method for loess objects, but there is no longer an available function called predict.loess. So just replace predict.loess with predict. On Fri, 13 Feb 2004, Thomas Jagoe wrote: I am using R to do a loess normalisation procedure. In

[R] predict for a model with a subset

2003-10-24 Thread Peter Flom
Hello running R 1.7.1 on Windows 2000 I have a model notmar1 - glm(yprisx~age+harddrug+sex, subset = marcom == 0, family = quasipoisson) and summary(notmar1) gives (as it should) 433 df for the null model but when I run predict(notmar1 - glm(yprisx~age+harddrug+sex, subset = marcom == 0,

Re: [R] predict for a model with a subset

2003-10-24 Thread Spencer Graves
Have you tried the following: notmar1 - glm(yprisx~age+harddrug+sex, subset = marcom == 0, family = quasipoisson), data=DF) predict(notmar1, newdata=DF[DF$marcom==0,]) I haven't tested this specific code, but I've gotten sensible results from constructs like this in the past. hope this

Re: [R] predict for a model with a subset

2003-10-24 Thread Prof Brian Ripley
example(predict.glm) fit - glm(SF ~ ldose, family=binomial, subset=sex==M) predict(fit) [1] -2.8185550 -1.5596055 -0.3006561 0.9582933 2.2172427 3.4761922 which is just the males. So, that example works correctly, and predict.glm as called by you should just return the fitted values, as

[R] predict for mlm does not work properly

2003-09-19 Thread ZABALZA-MEZGHANI Isabelle
Hello, I've just fitted a model with multi-responses, and I get an object of class lm mlm. My problem is that as soon as I invoke the predict method for a dataframe newdata, the methods runs and give me back prediction at the fitting points but not for newdata. Does someone has an explanation

RE: [R] predict for mlm does not work properly

2003-09-19 Thread Liaw, Andy
From: ZABALZA-MEZGHANI Isabelle Hello, I've just fitted a model with multi-responses, and I get an object of class lm mlm. My problem is that as soon as I invoke the predict method for a dataframe newdata, the methods runs and give me back prediction at the fitting points but not

[R] predict(lm(etc.),some_data) - numeric envir arg not of length one ???

2003-08-07 Thread Bruce LaZerte
I've got a data frame with two numeric variables, df$flow and df$flow1. tl - lm(flow~flow1,df,na.action=na.exclude) tlo - loess(flow~flow1,df,na.action=na.exclude) Both loess and a simple linear model fit the data well. summary(tl) and summary(tlo) seem reasonable. As do plots such as:

Re: [R] predict

2003-07-18 Thread Prof Brian Ripley
It uses the appropriate method for the generic function predict(). In your case it is predict.ar(), and you can examine it by getS3method(predict, ar) On Tue, 15 Jul 2003, ATHANASIA KAMARIOTIS wrote: Can you please tell me how R computes : predict(ar.x)$pred in : #let x be a vector

[R] predict

2003-07-15 Thread ATHANASIA KAMARIOTIS
Good afternoon, Can you please tell me how R computes : predict(ar.x)$pred in : #let x be a vector ar.x-ar(x) predict(ar.x)$pred Thank you Bye __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

[R] predict formula with variables

2003-06-25 Thread orkun
Hello On the subject of using predict formula with variables, I used cbind(var1,var2,var3,var4, predict(glm.obj,type=resp)) to find probability of each combinations. However,I am still hesitant whether I have done it correctly. Is it correct ? thanks in advance Ahmet Temiz Turkey