similar to: Why predicted values are fewer that the real?

Displaying 20 results from an estimated 7000 matches similar to: "Why predicted values are fewer that the real?"

2012 Feb 21
1
stepAIC error
i am trying to run stepwise regression for two models(lower,upper), family=gamma and i get the same error despite the models i use. Error in UseMethod("extractAIC") : no applicable method for 'extractAIC' applied to an object of class "formula" In addition: Warning message: In nobs.default(object, use.fallback = TRUE) : no 'nobs' method is available Any
2003 Aug 07
2
Strange predicted values ?
Hello I carried out a logistic regression and found predicted values. Then I want to see both predictors (var1,var2..) and predicted values in same matrix. In other words, I need to know each combinations and predicted values. I used: cbind(var1,var2,var3,var4,predict(glm.obj,type="resp")) I got a somewhat strange result: var1 var2 var3 var4 var5 var6 predicted vals ------
2006 Nov 28
3
Predicted values in lmer modeling
Dear All, I am working with linear mixed-effects models using the lme4 package in R. I created a model with the lmer function including some main effects, a two-way interaction and a random effect. Now I am searching for a way to save the predicted values for this model. As far as I can see, there is no command in lme4 to save the predicted values (like the predict(model) function in e.g.
2013 Jan 24
1
predicted HR in coxph with psline
Hi all, I have some questions about the predicted HR in coxph function including psline covariate. If just fitting covariate as linear form, by default, the reference value for each of predictions type (linear predictor, risk and terms) is the mean covariate within strata. If the psline is specified for the covariate, what's the reference value for the predictions? I did some test code
2007 Sep 25
2
Constraining Predicted Values to be Greater Than 0
I have a WLS regression with 1 dependent variable and 3 independent variables. I wish to constrain the predicted values (the fitted values) so that they are greater than zero (i.e. they are positive). I do not know how to impose this constraint in R. Please respond if you have any suggestions. There are some previous postings about constraining the coefficients, but this won't accomplish
2004 Feb 12
2
variances of values predicted using a lm object
Hi, is there a function in R that will give me the variances of a predicted values obtained using predict.lm(). If no function is available I would need to calculate them myself - which involves taking the inverse of X'X (' indicating transpose) where X is my model matrix. I know that calculating an inverse directly is not a good idea in general - could anybody suggest a way around
2009 Jun 26
1
predicted values after fitting gamma2 function
Question: after fitting a gamma function to some data, how do I get predicted values? I'm a SAS programmer, I new R, and am having problems getting my brain to function with the concept of "object as class ...". The following is specifics of what I am doing: I'm trying to determine the pdf from data I have created in a simulation. I have generated frequency counts
2012 Sep 25
1
Extrapolating Cox predicted risk
Dear all I generated predicted risk of death for each subject in the study by means of Cox proportional hazards model at 8 year of follow-up, a time point at which follow-up was more than 90% complete. It is possible to extrapolate to 10-year the predicted risk of each subjet by assuming an exponential distribution? Any help would be greatly appreciated. Thanks for your consideration.
2005 Oct 14
1
lattice with predicted values
Dear lattice wizards, I am trying to figure out how to plot predicted values in xyplot, where the intercept, but not the slope, varies among conditioning factor levels. I am sure it involves the groups, but I have been unsuccessful in my search in Pinhiero and Bate, in the help files, or in the archive, or in my attempts on my own. My example follows: FACT is a factor with levels a,b,c
2008 May 13
1
How to get predicted marginal (aka predicted mean) after multinomial logistic?
I tried to use the effect() to get predicted marginals for multinomial logistic as I did for general logistic regression, but failed. Is there anyway to do that? Thx! -- View this message in context: http://www.nabble.com/How-to-get-predicted-marginal-%28aka-predicted-mean%29-after-multinomial-logistic--tp17200114p17200114.html Sent from the R help mailing list archive at Nabble.com.
2012 Jul 09
3
Predicted values for zero-inflated Poisson
Hi all- I fit a zero-inflated Poisson model to model bycatch rates using an offset term for effort. I need to apply the fitted model to a datasets of varying levels of effort to predict the associated levels of bycatch. I am seeking assistance as to the correct way to code this. Thanks in advance! Laura [[alternative HTML version deleted]]
2002 Nov 18
1
Prediction from arima() object (library ts) (PR#2305)
Full_Name: Allan McRae Version: 1.6.0 OS: Win 2000 P Submission from: (NULL) (129.215.190.229) When using predict.Arima in library ts(), it appears differencing is only accounted for in the first step of prediction and so any trend is not apparent in the predictions. The example shows the difference between the predictions of an arima(1,1,1) model and the backtransformed predictions of an
2006 Jan 18
4
negative predicted values in poisson glm
Dear R helpers, running the following code of a glm model of the family poisson, gives predicted values < 0. Why? library(MASS) library(stats) library(mvtnorm) library(pscl) data(bioChemists) poisson_glm <- glm(art ~ fem + mar + kid5 + phd + ment, data = bioChemists, family = poisson) predicted.values = predict(poisson_glm) range(predicted.values) Thank you in advance for any hints.
2010 Feb 18
1
logistic regression - what is being predicted when using predict - probabilities or odds?
Dear gurus, I've analyzed a (fake) data set ("data") using logistic regression (glm): logreg1 <- glm(z ~ x1 + x2 + y, data=data, family=binomial("logit"), na.action=na.pass) Then, I created a data frame with 2 fixed levels (0 and 1) for each predictor: attach(data) x1<-c(0,1) x2<-c(0,1) y<-c(0,1) newdata1<-data.frame(expand.grid(x1,x2,y))
2005 Jul 20
1
predict.lm - standard error of predicted means?
Simple question. For a simple linear regression, I obtained the "standard error of predicted means", for both a confidence and prediction interval: x<-1:15 y<-x + rnorm(n=15) model<-lm(y~x) predict.lm(model,newdata=data.frame(x=c(10,20)),se.fit=T,interval="confidence")$se.fit 1 2 0.2708064 0.7254615
2004 Jan 15
2
plotting predicted values (lines) over data?
I've been trying to plot the predicted values, as a line, over the data for a simple nonlinear fit with the following commands: plot( hg ~ ht ) ... define some function hg ~ ht + junk ... ... blah, blah, obtain parameter estimates and predicted values, blah... ... then... lines( sort( $predicted ) ~ sort( ht ) ) which results in a line that isn't smooth (which I knew would happen).
2010 Nov 29
2
how to calculate standard error for the predicted value from geeglm?
Hello R-helpers, I would like to calculate the standard error for the predicted value from geeglm. As an example, I would like to calculate the GEE mean of treatments and their standard error. I first specified the model as mod <- geeglm(resp ~ trt, data=dat,id=id,family=Gaussian,corstr="ar1",weights=weight) Then I predicted the GEE mean and se using the following code
2010 Sep 24
1
Standard Error for difference in predicted probabilities
Is there a way to estimate the standard error for the difference in predicted probabilities obtained from a logistic regression model? For example, this code gives the difference for the predicted probability of when x2==1 vs. when x2==0, holding x1 constant at its mean: y=rbinom(100,1,.4) x1=rnorm(100, 3, 2) x2=rbinom(100, 1, .7) mod=glm(y ~ x1 + x2, family=binomial) pred=predict(mod,
2011 Jul 19
3
How to get predicted values of y for different x values?
Here is my model with interaction terms and control variables (I changed variables names for easy read): reg1 <- lm(y ~ x1*x2*x3 +control1 + control2 + control3) x1 ranges from 0 to 6; x2 from 0 to 5; and x3 from 0 to 4. All three are discrete ordinal variables; but I will treat them as continuous variables. (a) How can I see the predicted values of y for each of these scenarios (210
2008 May 06
1
question about se of predicted glm values
Hey, all. I had a quick question about fitting new glm values and then looking at the error around them. I'm working with a glm using a Gamma distribution and a log link with two types of treatments. However, when I then look at the predicted values for each category, I find for the one that is close to 0, the error (using se.fit=T with predicted) actually makes it overlap 0.