Displaying 20 results from an estimated 300 matches similar to: "Negative Binomial Predictions"
2010 Apr 14
2
Import ASCII data using a .sas program
Good Day,
I have several ASCII data files that I would like to import into R.
They all have a SAS import file which is used to bring the data into SAS
and I am hoping to use this to bring the data into R. There are lots of
variables involved and the ASCII data file is 2308 columns long so I
would certainly prefer to figure out a smart way of converting the data
to R.
The ASCII data is a
2008 Sep 24
2
Error message when calculating BIC
Hi All,
Could someone help me decode what this error means ?
> BIC(nb.80)
Error in log(attr(object, "nobs")) :
Non-numeric argument to mathematical function
>
BTW, nb.80 is a negative binomial glm model created using the MASS
library with the call at the bottom of the message
In the hopes of trying to figure this out I tried the following
workaround but it did not work
2009 Aug 07
1
Proper / Improper scoring Rules
Hi All,
I am working on some ordinal logistic regresssions using LRM in the
Design package. My response variable has three categories (1,2,3) and
after using the creating my model and using a call to predict some
values and I wanted to use a simple .5 cut-off to classify my
probabilities into the categories.
I had two questions:
a) first, I am having trouble directly accessing the
2011 Nov 16
0
Plotting series with no data in xyplot
Good Day All,
I am working on some xyplots using the Lattice Library. My X-axis is
the date and I am reproducing charts similar to those found in the R
Gallery (see here:
http://www.sr.bham.ac.uk/~ajrs/R/gallery/plot_midday_weather_profiles.txt)
However, the key difference is that some of my data is missing (not
collected at that time). For instance, I might have a whole month that
I do
2008 Sep 26
0
Cross Validation output
Good Day All,
I have a negative binomial model that I created using the function
glm.nb() with the MASS library and I am performing a cross-validation
using the function cv.glm() from the boot library. I am really
interested in determining the performance of this model so I can have
confidence (or not) when it might be applied elsewhere
If I understand the cv.glm() procedure correctly, the
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
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.
2011 Oct 19
1
hypothetical prediction after polr
Dear R-Help listers,
I am trying to estimate an proportional odds logistic regression model
(or ordered logistic regression) and then make predictions by
supplying a hypothetical x vector. However, somehow this does not
work. I guess I must have missed something here. I first used the polr
function in the MASS package, and I create a data frame and supply it
to the predict function (see below):
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.
2012 Jul 13
1
Vuong test
Dear All,
I am using the function vuong from pscl package to compare 2 non nested models NB1
(negative binomial I ) and Zero-inflated model.
NB1 <- glm(, , family = quasipoisson), it is an
object of class: "glm" "lm"
zinb <-
zeroinfl( dist = "negbin") is an object of class: "zeroinfl"
when applying vuong
function I get the following:
vuong(NB1,
2010 Apr 19
2
plotting RR, 95% CI as table and figure in same plot
Hi all--
I am in the process of helping colleagues write up a ms in which we fit
zero-inflated Poisson models. I would prefer plotting the rate ratios
and 95% CI (as I've found Gelman and others convincing about plotting
tables...), but our journals usually like the numbers themselves.
Thus, I'm looking at a recent JAMA article in which both numbers and
dotplot of RR and 95% CI are
2009 Aug 21
1
Question about validating predicted probabilities
Hello,
Frank was nice enough to point me to the val.prob function of the Design
library.
It creates a beautiful graph that really helps me visualize how well my
model is predicting probabilities.
By default, there are two lines on the graph
1) fitted logistic calibration curve
2) nonparametric fit using lowess
Right now, the nonparametric line doesn't look very good.
The
2007 May 18
1
A programming question
Dear Friends,
My problem is related to how to measure probabilities from a probit model by changing one independent variable keeping the others constant.
A simple toy example is like this
Range for my variables is defined as follows
y=0 or 1, x1 = -10 to 10, x2=-40 to 100, x3 = -5 to 5
Model
output <- glim(y ~ x1+x2+x3 -1, family=binomial(link="probit"))
outcoef <-
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
2013 Jan 12
2
Getting the R squared value in asymptotic regression model
Please help getting the R squared value in asymptotic regression model
I use the code below
model1<-nls(GN1~SSasymp (nrate,a,b,c), data = data.1 )
and R produced the modell coefficients without the R squared value?
--
Ahmed M. Attia
Research Assistant
Dept. Of Soil&Crop Sciences
Texas A&M University
ahmed <ahmedatia@zu.edu.eg>.attia@ag.tamu.edu
Cell phone:
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
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
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
2012 Dec 30
4
Starting with R
I have installed R on my machine.
Can anyone now suggest to me the best book/e-book from where I can learn
the R language most efficiently?
Thanks in advance
--
Siddhant Gupta
III Year
Department of Biotechnology
IIT Roorkee
India
[[alternative HTML version deleted]]
2007 Mar 26
4
Problem dropping rows based on values in a column
I am trying to drop rows of a dataframe based on values of the column PID, but my strategy is not working. I hope someoen can tell me what I am doing incorrectly.
# Values of PID column
> jdata[,"PID"]
[1] 16608 16613 16355 16378 16371 16280 16211 16169 16025 11595 15883 15682 15617 15615 15212 14862 16539
[18] 12063 16755 16720 16400 16257 16209 16200 16144 11598 13594 15419 15589