Displaying 20 results from an estimated 20000 matches similar to: "Standard Error for difference in predicted probabilities"
2012 May 03
1
overlapping confidence bands for predicted probabilities from a logistic model
Dear list,
I'm a bit perplexed why the 95% confidence bands for the predicted probabilities for units where x=0 and x=1 overlap in the following instance.
I've simulated binary data to which I've then fitted a simple logistic regression model, with one covariate, and the coefficient on x is statistically significant at the 0.05 level. I've then used two different methods to
2010 Sep 26
1
formatting data for predict()
I'm trying to get predicted probabilities out of a regression model,
but am having trouble with the "newdata" option in the predict()
function. Suppose I have a model with two independent variables, like
this:
y=rbinom(100, 1, .3)
x1=rbinom(100, 1, .5)
x2=rnorm(100, 3, 2)
mod=glm(y ~ x1 + x2, family=binomial)
I can then get the predicted probabilities for the two values of
2011 Aug 26
2
How to find the accuracy of the predicted glm model with family = binomial (link = logit)
Hi All,
When modeling with glm and family = binomial (link = logit) and response values of 0 and 1, I get the predicted probabilities of assigning to my class one, then I would like to compare it with my vector y which does have the original labels. How should I change the probabilities into values of zero and 1 and then compare it with my vector y to find out about the accuracy of my
2008 Jan 29
2
Using Predict and GLM
Dear R Help,
I read through the archives pretty extensively before sending this
email, as it seemed there were several threads on using predict with
GLM. However, while my issue is similar to previous posts (cannot
get it to predict using new data), none of the suggested fixes are
working.
The important bits of my code:
set.seed(644)
n0=200 #number of observations
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))
2007 Oct 17
3
how to repeat the results of a generated probabilities
hello,
I want to simulate 200 times the mean of a joint probability (y1) and 200
times the mean of another joint distribution (y2),
that is I'm expecting to get 200 means of y1 and 200 means of y2.
y1 and y2 are probabilities that I calculate from the marginal prob. (z1 and
z2 respectively) multiple by the conditional prob. (x1 and x2 respectively),
which I generaterd from the binomial
2009 Dec 02
1
Generate missing data patterns
Dear R-users,
i try to generate missing values in a matrix X according to a given
missingnes pattern R with the probabilities p per row.
X<-matrix(rnorm(3*100),ncol=3)
## indicator matrix for missingnes (1 observed, 0 missing)
R<-matrix(c(1,1,1,
0,0,1,
1,1,0,
0,1,1),ncol=3,byrow=TRUE)
## probabilities for row 1, row 2, row 3 and row 4
2010 Jun 23
1
Probabilities from survfit.coxph:
Hello:
In the example below (or for a censored data) using survfit.coxph, can
anyone point me to a link or a pdf as to how the probabilities appearing in
bold under "summary(pred$surv)" are calculated? Do these represent
acumulative probability distribution in time (not including censored time)?
Thanks very much,
parmee
*fit <- coxph(Surv(futime, fustat) ~ age, data = ovarian)*
2006 Feb 05
1
how to extract predicted values from a quantreg fit?
Hi,
I have used package quantreg to estimate a non-linear fit to the
lowest part of my data points. It works great, by the way.
But I'd like to extract the predicted values. The help for
predict.qss1 indicates this:
predict.qss1(object, newdata, ...)
and states that newdata is a data frame describing the observations
at which prediction is to be made.
I used the same technique I used
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
2012 Oct 20
1
Logistic regression/Cut point? predict ??
I am new to R and I am trying to do a monte carlo simulation where I
generate data and interject error then test various cut points; however, my
output was garbage (at x equal zero, I did not get .50)
I am basically testing the performance of classifiers.
Here is the code:
n <- 1000; # Sample size
fitglm <- function(sigma,tau){
x <- rnorm(n,0,sigma)
intercept <- 0
beta
2010 Feb 23
1
e1071: Cannot predict probabilities
Dear list.
I using the SVM-methods from the e1071, but I can't get the
probabilities when predicting.
Code:
x <- matrix(rbinom(100, 10, 0.3), ncol=2)
y <- apply(x, 1, sum)
fit <- svm(y ~ x, method = "C-classification", kernel = "radial",
probability = TRUE)
predict(fit, x, probability=TRUE)
Here predict doesn't containing any probabilities (not as attributes
2005 Mar 16
1
Code to replace nested for loops
Dear list members,
How can I replace the nested for loops at then end of the script
below with more efficient code?
# Begin script__________________________________________________
# Dichotomous scores for 100 respondents on 3 items with
# probabilities of a correct response = .6, .4, and .7,
# respectively
x1 <- rbinom(100,1,.6)
x2 <- rbinom(100,1,.4)
x3 <- rbinom(100,1,.7)
#
2011 Apr 06
2
glm predict on new data
I am aware this has been asked before but I could not find a resolution.
I am doing a logit
lg <- glm(y[1:200] ~ x[1:200,1],family=binomial)
Then I want to predict a new set
pred <- predict(lg,x[201:250,1],type="response")
But I get varying error messages or warnings about the different number of
rows. I have tried data/newdata and also to wrap in data.frame() but cannot
get
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
2011 Aug 06
1
help with predict for cr model using rms package
Dear list,
I'm currently trying to use the rms package to get predicted ordinal
responses from a conditional ratio model. As you will see below, my
model seems to fit well to the data, however, I'm having trouble
getting predicted mean (or fitted) ordinal response values using the
predict function. I have a feeling I'm missing something simple,
however I haven't been able to
2017 Aug 09
3
Plotting log transformed predicted values from lme
Hi,
I am performing meta-regression using linear mixed-effect model with the
lme() function that has two fixed effect variables;one as a log
transformed variable (x) and one as factor (y) variable, and two nested
random intercept terms.
I want to save the predicted values from that model and show the log curve
in a plot ; predicted~log(x)
mod<-lme(B~log(x)+as.factor(y),
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
2006 May 19
1
How to use lm.predict to obtain fitted values?
I am writing a function to assess the out of sample predictive capabilities
of a time series regression model. However lm.predict isn't behaving as I
expect it to. What I am trying to do is give it a set of explanatory
variables and have it give me a single predicted value using the lm fitted
model.
> model = lm(y~x)
> newdata=matrix(1,1,6)
> pred =
2005 Apr 13
3
A suggestion for predict function(s)
Maybe a useful addition to the predict functions would be to return the
values of the predictor variables. It just (unless there are problems)
requires an extra line. I have inserted an example below.
"predict.glm" <-
function (object, newdata = NULL, type = c("link", "response",
"terms"), se.fit = FALSE,