Displaying 20 results from an estimated 800 matches similar to: "plotting RR, 95% CI as table and figure in same plot"
2011 May 04
1
hurdle, simulated power
Hi all--
We are planning an intervention study for adolescent alcohol use, and I
am planning to use simulations based on a hurdle model (using the
hurdle() function in package pscl) for sample size estimation.
The simulation code and power code are below -- note that at the moment
the "power" code is just returning the coefficients, as something isn't
working quite right.
The
2008 Dec 16
1
Prediction intervals for zero inflated Poisson regression
Dear all,
I'm using zeroinfl() from the pscl-package for zero inflated Poisson
regression. I would like to calculate (aproximate) prediction intervals
for the fitted values. The package itself does not provide them. Can
this be calculated analyticaly? Or do I have to use bootstrap?
What I tried until now is to use bootstrap to estimate these intervals.
Any comments on the code are welcome.
2010 Apr 26
1
Dropping "trailing zeroes" in longitudinal data
Background: Our research group collected data from students via the web
about their drinking habits (alcohol) over the last 90 days. As you
might guess, some students seem to have lost interest and completed some
information but not all. Unfortunately, the survey was programmed to
"pre-populate" the fields with zeroes (to make it easier for students to
complete).
Obviously, when
2010 May 20
1
Mixed Effects Model on Within-Subjects Design
Dear R Experts,
I am attempting to run a mixed effects model on a within-subjects repeated
measures design, but I am unsure if I am doing it properly. I was hoping
that someone would be able to offer some guidance.
There are 5 independent variables (subject, condition, difficulty,
repetition) and 1 dependent measure (value). Condition and difficulty are
fixed effects and have 3 levels each
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.
2024 Jan 04
1
Obtaining a value of pie in a zero inflated model (fm-zinb2)
Are you referring to the zeroinfl() function in the countreg package? If
so, I think
predict(fm_zinb2, type = "zero", newdata = some.new.data)
will give you pi for each combination of covariate values that you
provide in some.new.data
where pi is the probability to observe a zero from the point mass component.
As to your second question, I'm not sure that's possible, for any
2011 Oct 11
1
Count model prediction
Hello ;
I am doing a regression of count data (number of award and there are some
covariates)
I have estiamted the parameters of negative binomial distribuion (lambda is
a function of covaraites, GLM model) by glm.nb function and training
dataset.
Now I want to predict the number of award (for example y=0, y=1, y=2,) or
testing dataset. I dont know how to calculate this numbers?
I would be very
2012 Apr 26
2
Lambert (1992) simulation
Hi,
I am trying to replicate Lambert (1992)'s simulation with zero-inflated
Poisson models. The citation is here:
@article{lambert1992zero,
Author = {Lambert, D.},
Journal = {Technometrics},
Pages = {1--14},
Publisher = {JSTOR},
Title = {Zero-inflated {P}oisson regression, with an application to defects
in manufacturing},
Year = {1992}}
Specifically I am trying to recreate Table 2. But my
2008 Oct 01
1
Negative Binomial Predictions
Good Day All,
I have a negative binomial model which I have developed using the MASS
library. I now would like to develop some predictions from it.
Running the predict.glm (stats library) using type="response" gives me a
non-integer value which was rather puzzling. I would like to confirm
that this is actually the mean predicted value of the probability mass
function as opposed
2009 Mar 22
1
Multiple Comparisons for (multicomp - glht) for glm negative binomial (glm.nb)
Hi
I have some experimental data where I have counts of the number of
insects collected to different trap types rotated through 5 different
location (variable -location), 4 different chemical attractants [A, B,
C, D] were applied to the traps (variable - semio) and all were
trialled at two different CO2 release rates [1, 2] (variable CO2) I also
have a selection of continuous variables
2011 Apr 29
2
abline outside of plot region
Hi R people.
I ran into this problem: I created a plot with errbars, like this:
> errbar(x=c(1,2,3,4), y=c(2,1,3,3), yminus=c(1.5,0.5,2.5,2.5),
yplus=c(2.5,1.5,3.5,3.5))
Next, I wanted to accentuate some x value with an abline, like this:
> abline(v=2)
In one of my R sessions (which admittedly I have had open for quite a while
now), the abline draws outside of the plotting region
2013 Jan 10
2
Titles - main and subtitle won't plot with errbar
Hi, I'm struggling with errbar graphics.
I'm trying to plot an x-y graph with correct labelling, however can't seem
to get main and sub to show on my graph.
They do work when I use title(main="," etc...., but this will make it look
at lot messier,I'll have to blank out ylab=" " , and I need to try and get
the titles to update automatically according to my
2010 Apr 12
1
zerinfl() vs. Stata's zinb
Hello,
I am working with zero inflated models for a current project and I am
getting wildly different results from R's zeroinfl(y ~ x, dist="negbin")
command and Stata's zinb command. Does anyone know why this may be? I find
it odd considering that zeroinfl(y ~ x, dist="poisson") gives identical to
output to Stata's zip function.
Thanks,
--david
[[alternative
2010 Apr 21
1
Adding error bars to xyplot()
Hi,
I want to add error bars to a plot generated with xyplot. I've tried
both errbar() and plotCI(), but in both cases the points are not in the
same place. It's as if the two functions are using a different frame of
reference for the plotting area.
for example:
means <- c(92.5, 92.25, 90.9, 91.0, 94.15, 90.05) #means
time <- c(1,1,2,2,3,3) #occasion variable
group <-
2024 Jan 04
1
Obtaining a value of pie in a zero inflated model (fm-zinb2)
I am running a zero inflated regression using the zeroinfl function similar to the model below:
fm_zinb2 <- zeroinfl(art ~ . | ., data = bioChemists, dist = "poisson")
summary(fm_zinb2)
I have three questions:
1) How can I obtain a value for the parameter pie, which is the fraction of the population that is in the zero inflated model vs the fraction in the count model?
2) For
2012 May 05
0
Getting predicted values from a zero-inflated negative binomial using zeroinfl()
Hi,
I am a little confused at the output from predict() for a zeroinfl object.
Here's my confusion:
## From zeroinfl package
fm_zinb2 <- zeroinfl(art ~ . | ., data = bioChemists, dist = "negbin")
## The raw zero-inflated overdispersed data
> table(bioChemists$art)
0 1 2 3 4 5 6 7 8 9 10 11 12 16 19
275 246 178 84 67 27 17 12 1 2 1 1
2005 Jul 29
1
Errbar()-function, cap and logarithmic scaling
Hello!
If I use the errbar-function and have a logarithmic scale on the x-axis,
then the little horizontal bars at the end of the errbars (cap)
disappear. What can I do?
Thanks for helping!
Ute
2013 Jun 12
2
survreg with measurement uncertainties
Hello,
I have some measurements that I am trying to fit a model to. I also
have uncertainties for these measurements. Some of the measurements
are not well detected, so I'd like to use a limit instead of the
actual measurement. (I am always dealing with upper limits, i.e. left
censored data.)
I have successfully run survreg using the combination of well detected
measurements and limits,
2012 Jun 23
0
Using at.level() with a MCMCglmm zero-inflated poisson model
I have a question for users of MCMCglmm that have experience implementing
the zero-inflated poisson model.
I find that the documentation, and previous questions, do not offer a lot
of clear guidance on specifying and interpreting the zipoisson model. In
particular, I see a lot of zero-inflated poisson examples that use the
at.level(trait, x):variableName syntax.
Specifically, the MCMCglmm
2009 Jan 22
1
help using zeroinfl()
Hi all,
I have been trying to use zeroinfl() with the pscl package with R version 2.1.1. and with the newest versions of the contrib packages compatible with R 2.1.1.
I have read the examples, the vignette and all the posts relating to zeroinfl() but I am still confused as to how to structure the model.
Here is a small example; the error message is the same for big data sets