Displaying 20 results from an estimated 2000 matches similar to: "predict.glm(..., type="response") loses names (was RE: [R] A sugg estion for predict function(s))"
2007 Dec 07
1
paradox about the degree of freedom in a logistic regression model
Dear all:
"predict.glm" provides an example to perform logistic regression when the
response variable is a tow-columned matrix. I find some paradox about the
degree of freedom .
> summary(budworm.lg)
Call:
glm(formula = SF ~ sex * ldose, family = binomial)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.39849 -0.32094 -0.07592 0.38220 1.10375
2008 Feb 12
1
Finding LD50 from an interaction Generalised Linear model
Hi,
I have recently been attempting to find the LD50 from two predicted fits
(For male and females) in a Generalised linear model which models the effect
of both sex + logdose (and sex*logdose interaction) on proportion survival
(formula = y ~ ldose * sex, family = "binomial", data = dat (y is the
survival data)). I can obtain the LD50 for females using the dose.p()
command in the MASS
2005 Apr 14
0
predict.glm(..., type="response") dropping names (and a propsed (PR#7792)
Here's a patch that should make predict.glm(..., type="response") retain the
names. The change passes make check on our Opteron running SLES9. One
simple test is:
names(predict(glm(y ~ x, family=binomial,
data=data.frame(y=c(1, 0, 1, 0), x=c(1, 1, 0, 0))),
newdata=data.frame(x=c(0, 0.5, 1)), type="response"))
which gives
[1]
2002 Jun 20
1
Psychometric curves, two altnerative force choice, glm, and budbworms
Dear R-Listers,
to measure the psychometric curve of pitch discrimination, one sequentially
presents two tones of slightly different pitch to an observer (animal will
do), and asks "which is higher". The pschometric curve is the fraction of
correct responses plotted against the pitch difference. It passes through
50% (pure guessing) at zero and normally approaches 100% at large
2006 Jul 30
1
Parametric links for glm?
At useR 2006 I mentioned that it would be nice to have a way to
specify binomial links
that involved free parameters and described some experience with a
Gosset link involving
a free degrees of freedom parameter, and a Tukey-lambda link with two
free parameters.
My implementation of this involved some rather kludgey modifications
of binomial,
make.link and glm that (essentially) added a
2006 Aug 21
2
Finney's fiducial confidence intervals of LD50
I am working with Probit regression (I cannot switch to logit) can anybody help me in finding out how to obtain with R Finney's fiducial confidence intervals for the levels of the predictor (Dose) needed to produce a proportion of 50% of responses(LD50, ED50 etc.)?
If the Pearson chi-square goodness-of-fit test is significant (by default), a heterogeneity factor should be used to calculate
2006 Oct 18
3
creating bins for a plot
Hi. I'm trying to plot the ratio of used versus unused bird houses
(coded 1 or 0) versus a continuous environmental gradient (proportion of
urban cover [purban2]) that I would like to convert into bins (0 -
0.25, 0.26 - 0.5, 0.51 - 0.75, 0.76 - 1.0) and I'm not having much luck
figuring this out. I ran a logistic regression and purban2 ends up
driving the probability of a box being
2010 Dec 30
1
Different results in glm() probit model using vector vs. two-column matrix response
Hi - I am fitting a probit model using glm(), and the deviance and residual degrees of freedom are different depending on whether I use a binary response vector of length 80 or a two-column matrix response (10 rows) with the number of success and failures in each column. I would think that these would be just two different ways of specifying the same model, but this does not appear to be the case.
2007 Jun 18
1
how to obtain the OR and 95%CI with 1 SD change of a continue variable
Dear all,
How to obtain the odds ratio (OR) and 95% confidence interval (CI) with
1 standard deviation (SD) change of a continuous variable in logistic
regression?
for example, to investigate the risk of obesity for stroke. I choose the
happening of stroke (positive) as the dependent variable, and waist
circumference as an independent variable. Then I wanna to obtain the OR
and 95% CI with
2005 Jan 07
4
glm fit with no intercept
Dear R-help list members,
I am currently trying to fit a generalized linear model using a binomial
with the canonical link. The usual solution is to use the R function glm()
in the package "stats". However, I run into problem when I want to fit a
glm without an intercept. It is indicated that the solution is in changing
the function glm.fit (also in "stats"), by specifying
2000 Feb 17
3
se from predict.glm
I am not sure whether it is a design decision or just an oversight.
When I ask for the standard errors of the predictions with
predict(budwm.lgt,se=TRUE)
where budwm.lgt is a logistic fit of the budworm data in MASS, I got
Error in match.arg(type) : ARG should be one of response, terms
If one is to construct a CI for the fitted binomial probability,
wouldn't it be more natural to do
2006 Oct 06
1
glm and plot.effects
Dear R-helpers,
I don't see a difference between the following two plots of effect
objects, which I understand should be different. What am I missing?
require(doBy)
require(effects)
data(budworm)
m1 <- glm(ndead/20 ~ sex + log(dose), data=budworm, weight=ntotal,
family=binomial)
m1.eff <- all.effects(m1)
plot(m1.eff, rescale.axis = FALSE, selection = 2, main = 'rescale =
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,
2007 May 01
0
[Fwd: Re: [R-downunder] Beware unclass(factor)] (PR#9641)
It really is unclear what is claimed to be a bug here. But see
https://stat.ethz.ch/pipermail/r-devel/2007-May/045592.html
for why the bug is not in R: your old and new data do not match.
Your fit is to a category.
[The problem with the web interface to R-bugs was reported last week: it
is being worked on.]
On Mon, 30 Apr 2007, r.darnell at uq.edu.au wrote:
> This is a multi-part
2004 Jan 20
0
nlminb function
Hello,
I've got a program written in S-plus which I think is converted successfully to R with the exception of part of the opt.param function written.
In S-plus it is:
nlminb(start=x0, obj=negllgamma.f, scale=1, lower=c(0.01,0.0001),
upper=c(10,0.9999), gamma=gamma, maxlik=maxlik,
y=ldose, s=lse, max.iter = 1000, max.fcal = 1000)$par
and so far with R I've got to:
optim(par=x0,
2010 Dec 12
0
[PATCH] Btrfs: pick the correct metadata allocation size on small devices
Josef''s fs_mark test
fs_mark -d /mnt/btrfs-test -D 512 -t 16 -n 4096 -F -S0
on a 2GB single metadata fs leaves about 400Mb of metadata almost unused.
This patch reduces metadata chunk allocations by considering the proper
metadata chunk size of 200MB in should_alloc_chunk(), not the default 256MB
which is set in __btrfs_alloc_chunk().
Signed-off-by: Itaru Kitayama
2012 Mar 02
1
Vector errors and missing values
Hi,
I am trying to run two Non-Gaussian regressions: logistic and probit. I am
receiving two different errors when I try to run these regressions and I am
not sure what they mean or how to fix my syntax.
Here is the logistic regression error:
Error in family$linkfun(mustart) :
Argument mu must be a nonempty numeric vector
Here is the probit regression error:
Error in pmax(eta, -thresh) :
2012 Mar 15
0
[PATCH] Btrfs: fix deadlock during allocating chunks
This deadlock comes from xfstests 251.
We''ll hold the chunk_mutex throughout the whole of a chunk allocation.
But if we find that we''ve used up system chunk space, we need to allocate a
new system chunk, but this will lead to a recursion of chunk allocation and end
up with a deadlock on chunk_mutex.
So instead we need to allocate the system chunk first if we find we''re
2013 Jul 01
1
Missing data problem and ROC curves
Hello all,
Trying to get this piece of code to work on my data set. It is from
http://www.itc.nl/personal/rossiter.
logit.roc <- function(model, steps=100)
{
field.name <- attr(attr(terms(formula(model)), "factors"),
"dimnames")[[1]][1]
eval(parse(text=paste("tmp <- ", ifelse(class(model$data) == "data.frame",
"model$data$",
2006 Aug 04
1
polychoric correlation error
Dear all,
I get a strange error when I find polychoric correlations with the ML method, which I have been able to reproduce using randomly-generated data.
What is wrong?
I realize that the data that I generated randomly is a bit strange, but it is the only way that I duplicate the error message.
> n<-100
> test.x<-rnorm(n, mean=0, sd=1)
> test.c<-test.x + rnorm(n, mean=0,