Displaying 20 results from an estimated 20000 matches similar to: "error on predict"
2013 Dec 17
1
ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula
With ggplot2, I can plot the glm stat_smooth for binomial data when the
response is binary or
a two-level factor as follows:
data("Donner", package="vcdExtra")
ggplot(Donner, aes(age, survived)) +
geom_point(position = position_jitter(height = 0.02, width = 0)) +
stat_smooth(method = "glm", family = binomial, formula = y ~ x,
alpha = 0.2, size=2)
But how can I
2017 Sep 24
2
predict y tree
Estimados compañeros hace unos días instale la versión última de R
(3.4.1) en windows 10 y hoy me tiene loco el siguiente error cuando
ejecuto predict para un árbol de clasificación-regresión. El problema da
incluso con el ejemplo del comando predict
library(tree)
data(shuttle, package="MASS")
shuttle.tr <- tree(use ~ ., shuttle, subset=1:253,
mindev=1e-6,
2009 Jan 18
6
read a xls file
Hello,
i have a xls file. I will read it in r, what library-command i use for
this??
any ideas??
Thanks
Michele
[[alternative HTML version deleted]]
2012 Dec 12
2
help with predict.glm, and charting with factors
Dear R Wizards,
After much frustration and days of confusion I have finally broken down and
am asking for help, which I don’t like doing, but I just can’t figure this
one out on my own. I’ve conducted a laboratory experiment testing the
effects of temperature and salinity on whether or not a biological event
will occur (Go or NoGo). I’ve coded the factors temperature and salinity
as factors for
2008 Oct 15
2
apply model predictions over larger area with predict()
Dear all,
I have built glm models based on presences/absences and a number of
predictor maps and would like to compute habitat suitability based on
the modelled coefficients.
I thought this is pretty straight forward and wanted to use predict()
and supply the new data in a data frame, with one column for each
predictor.
However, I do get an error msg warning me that the number of rows for
2017 Sep 24
2
predict y tree
Gracias Carlos miraré el fix y en su defecto intentaré mandar un mensaje
al autor. De todas las maneras espero que alguien lo pruebe en windows 10
Saludos,
Juan
El 24/09/2017 a las 20:32, Carlos Ortega escribió:
> Hola Juan Antonio,
>
> Acabo de instalar "tree" en Mac OSX y no aparece este error...
>
> > shuttle1 <- shuttle[254:256, ] # 3 missing cases
>
2007 Dec 11
1
Using predict()?
I'm trying to solve a homework problem using R. The problem gives a list
of cricket chirps per second and corresponding temperature, and asks to
give the equation for the linear model and then predict the temperature
to produce 18 chirps per second. So far, I have:
> # Homework 11.2.1 and 11.3.3
> chirps <- scan()
1: 20
2: 16
3: 19.8
4: 18.4
5: 17.1
6: 15.5
7: 14.7
8: 17.1
9: 15.4
2005 May 10
2
predict nlme syntax
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 maximum likelihood
Model: konverze ~ SSfpl(tepl, A, B, xmid, scal)
Data: limity.gr
AIC
2019 Dec 05
3
Coeficientes GLM binomial
Un ejemplo con un modelo más simple:
He especificado este modelo:
>formula(m2.pile)
ger ~ tem + pot + time
Si hago predict me da:
>predict(m2.pile,newdata=data.frame(tem=25,pot=0,time=3),type="response")
0.08243262
Extraigo los coeficientes:
> coef(m2.pile)
(Intercept) tem pot time
-1.89521331 -0.02303313 4.74499714 0.02043222
Ahora calculo la
2000 May 04
1
logistic regression example from Devore5
I maintain the Devore5 package for R. This package provides the data
sets from Jay Devore's text "Probability and Statistics for
Engineering and the Sciences (5th ed)". I am having difficulty
reproducing some logistic regression results from the textbook.
Perhaps this is because I am not using the glm function correctly.
The data from Example 13.5 (page 559 for those with a copy
2010 Dec 25
2
predict.lrm vs. predict.glm (with newdata)
Hi all
I have run into a case where I don't understand why predict.lrm and
predict.glm don't yield the same results. My data look like this:
set.seed(1)
library(Design); ilogit <- function(x) { 1/(1+exp(-x)) }
ORDER <- factor(sample(c("mc-sc", "sc-mc"), 403, TRUE))
CONJ <- factor(sample(c("als", "bevor", "nachdem",
2009 Feb 26
1
using predict method with an offset
Hi,
I have run into another problem using offsets, this time with
the predict function, where there seems to be a contradiction
again between the behavior and the help page.
On the man page for predict.lm, it says
Offsets specified by offset in the fit by lm will not be included in
predictions, whereas those specified by an offset term in the formula
will be.
While it indicates nothings about
2009 Jan 16
1
specifying model terms when using predict
I've recently encountered an issue when trying to use the predict.glm
function.
I've gotten into the habit of using the dataframe$variablename method of
specifying terms in my model statements. I thought this unambiguous
notation would be acceptable in all situations but it seems models
written this way are not accepted by the predict function. Perhaps
others have encountered this
2012 May 03
1
warning with glm.predict, wrong number of data rows
Hi,
I split a data set into two partitions (80 and 42), use the first as the training set in glm and the second as testing set in glm predict. But when I call glm.predict, I get the warning message:
Warning message:
'newdata' had 42 rows but variable(s) found have 80 rows
---------------------
s = sample(1:122)
2019 Nov 28
4
Coeficientes GLM binomial
Estimad en s errer en s
He hecho este modelo glm
m1.pile<-glm(ger~tem+pot+time+I(tem^2)+I(tem^2):pot
,family="binomial"
,data=long.PILE
)
Que nos da la probabilidad de germinación de una semilla en función de tem
(Temperatura), pot (Humedad del suelo) y time (Tiempo que la semilla pasa
en esas condiciones).
Ahora quiero, para diferentes tem, pot
2010 Jan 16
2
predict.glm
Hi,
See below I reply your message for <https://stat.ethz.ch/pipermail/r-help/2008-April/160966.html>[R] predict.glm & newdata posted on Fri Apr 4 21:02:24 CEST 2008
You say it ##works fine but it does not: if you look at the length of yhat2, you will find 100 and not 200 as expected. In fact predict(reg1, data=x2) gives the same results as predict(reg1).
So I am still looking for
2006 Sep 01
1
difference between ns and bs in predict.glm
I am fittling a spline to a variable in a regression model, I am then using
the predict.glm funtion to make some predictions. When I use bs to fit the
spline I don't have any problems using the predict.glm function however when
I use ns I get the following error:
Error in model.frame(formula, rownames, variables, varnames, extras,
extranames, :
variable lengths differ (found for
2010 Mar 04
1
Setting graphical parameters
Hi guys... I have problem with this excersise...
Consider the pressure data frame again.
(a) Plot pressure against temperature, and use the following
command to pass a curve through these data:
> curve((0.168 + 0.007*x)?(20/3), from=0, to=400, add=TRUE)
(b) Now, apply the power transformation y3/20 to the pressure data values.
Plot these transformed values against temperature. Is a linear
2010 Sep 21
1
package gbm, predict.gbm with offset
Dear all,
the help file for predict.gbm states that "The predictions from gbm do not
include the offset term. The user may add the value of the offset to the
predicted value if desired." I am just not sure how exactly, especially for
a Poisson model, where I believe the offset is multiplicative ?
For example:
library(MASS)
fit1 <- glm(Claims ~ District + Group + Age +
2014 Jan 13
1
predict.glm line 28. Please explain
I imitated predict.glm, my thing worked, now I need to revise. It would
help me very much if someone would explain predict.glm line 28, which says
object$na.action <- NULL # kill this for predict.lm calls
I want to know
1) why does it set the object$na.action to NULL
2) what does the comment after mean?
Maybe I need a pass by value lesson too, because I can't see how changing
that