Displaying 20 results from an estimated 2000 matches similar to: "glm, poisson and negative binomial distribution and confidence interval"
2006 Sep 15
2
prediction interval for new value
Hi,
1. How do I construct 95% prediction interval for new x values, for example - x = 30000?
2. How do I construct 95% confidence interval?
my dataframe is as follows :
>dt
structure(list(y = c(26100000,
60500000, 16200000, 30700000, 70100000, 57700000, 46700000, 8600000,
10000000, 61800000, 30200000, 52200000, 71900000, 55000000, 12700000
), x = c(108000, 136000,
2012 Oct 08
6
How to use Lines function to draw the error bars?
fit lwr upr
1 218.4332 90.51019 346.3561
2 218.3906 90.46133 346.3198
3 218.3906 90.46133 346.3198
4 161.3982 44.85702 277.9394
5 192.4450 68.39903 316.4909
6 179.8056 56.49540 303.1158
7 219.5406 91.52707 347.5542
8 162.6761 46.65760 278.6945
9 193.8506 70.59838 317.1029
10 181.3816 58.11305 304.6502
11 221.2871 92.14366 350.4305
12 164.2947 47.91081 280.6785
13
2013 May 17
2
zigzag confidence interval in a plot
Dear All,
When I plot the values and linear regression line for one data set, it is fine. But for another one I see zigzags, when I plot the confidence interval
>cd
Depth CHAOsep12RNA
9,94 804
25,06 1476,833333
40,04 1540,561404
50,11 1575,166667
52,46 349,222222
54,92 1941,5
57,29 1053,507042
60,11 1535,1
70,04 2244,963303
79,97 1954,507042
100,31 2679,140625
>
2008 Nov 19
2
ggplot2; dot plot, jitter, and error bars
With this data
x <- c(0,0,1,1,2,2)
y <- c(5,6,4,3,2,6)
lwr <- y-1
upr <- y+1
xlab <- c("Low","Low","Med","Med","High","High")
mydata <- data.frame(x,xlab,y,lwr,upr)
I would like to make a dot plot and use lwr and upr as error bars.
Above 0=Low. I would like there to be
some space between the 5 and the 6 corresponding
2002 Jun 06
1
generating overdispersed poisson & negative binomial data
I would like to try a simple parametric bootstrap, but unfortunately
(stupidly?) my models are "overdispersed" gams & glms.
I'm hoping for a function that generates overdispersed poisson or negative
binomial data with a given mean, scale (& shape parameter).
The loose definition I'm using is overdispersed poisson produces integer
values with variance=const*mean &
2011 Apr 03
1
style question
Hi everyone,
I am trying to build a table putting standard errors horizontally. I
haven't been able to do it.
library(memisc)
berkeley <- aggregate(Table(Admit,Freq)~.,data=UCBAdmissions)
berk0 <- glm(cbind(Admitted,Rejected)~1,data=berkeley,family="binomial")
berk1 <-
glm(cbind(Admitted,Rejected)~Gender,data=berkeley,family="binomial")
berk2 <-
2013 Jan 30
2
How does predict() calculate prediction intervals?
For a given linear regression, I wish to find the 2-tailed t-dist
probability that Y-hat <= newly observed values. I generate prediction
intervals in predict() for plotting, but when I calculate my t-dist
probabilities, they don't agree. I have researched the issues with variance
of individual predictions and been advised to use the variance formula
below (in the code).
I presume my
2016 Apr 21
5
Calcular Error en modelo lineal
Enun ejemplo real estoy viendo como el intervalo de confianza usando lo que me comentas me ha salido mucho más pequeño de lo que la realidad luego refleja. ¿Cómo es esto posible??
Es decir, veo que para valores de 2,70 obtengo una respuesta de entre 2,69 y 2,90 y sin embargo luego en la realidad tengo valores entre 2,20 y 3
Gracias
Jesús
From: jorgeivanvelez en gmail.com
Date: Thu, 21 Apr
2013 Sep 22
2
colores
Como usas la función image puedes consultar la ayuda ?image o help(image) y
encontrarás el siguiente ejemplo donde se usa un diferente color Palette
(mencionada por pepeceb en su respuesta).
x <- 10*(1:nrow(volcano))
y <- 10*(1:ncol(volcano))
image(x, y, volcano, col = terrain.colors(100), axes = FALSE)
# O puedes usar directamente el número para indicar el color
image(x, y, volcano, col =
2012 Nov 13
2
Tukey test for subgroups in a data frame
Hello,
I have a data frame with the following columns: "date","name","value"
the name is the same for each date
I would like to get TukeyHSD p-value for the differences of "value" between
"name"s in each "date" separately I tried different ANOVA (aov()) but can
only get either tukey by "name" or by "data" but not
2009 Sep 04
1
predicting from segmented regression
Hello
I'm having trouble figuring out how to use the output of "segmented()"
with a new set of predictor values.
Using the example of the help file:
??set.seed(12)
xx<-1:100
zz<-runif(100)
yy<-2+1.5*pmax(xx-35,0)-1.5*pmax(xx-70,0)+15*pmax(zz-.5,0)+rnorm(100,0,2)
dati<-data.frame(x=xx,y=yy,z=zz)
out.lm<-lm(y~x,data=dati)
o<-## S3
2016 Apr 21
2
Calcular Error en modelo lineal
Buenas, una pregunta.
Si yo estoy calculando un modelo lineal, el caso más simple, 1 variable respuesta y una variable explicativa y creo un modelo, me da un R2 del 80% y quiero ver como es esa relacion entre las variables, para calcular el error de predicción del modelo, basta con ver el intervalo de confianza del modelo e irme a los extremos?
Por si no me he expresado bien, un ejemplo tonto:
2010 Jul 27
1
problem with zero-weighted observations in predict.lm?
In modelling functions some people like to use
a weight of 0 to drop an observation instead of
using a subset value of FALSE. E.g.,
weights=c(0,1,1,...)
instead of
subset=c(FALSE, TRUE, TRUE, ...)
to drop the first observation.
lm() and summary.lm() appear to treat these in the
same way, decrementing the number of degrees of
freedom for each dropped observation. However,
predict.lm() does
2017 Jun 12
2
plotting gamm results in lattice
Dear all,?
I hope that you can help me on this. I have been struggling to figure this out but I haven't found any solution.
I am running a generalised mixed effect model, gamm4, for an ecology project. Below is the code for the model:
model<-gamm4(LIFE.OE_spring~s(Q95, by=super.end.group)+Year+Hms_Rsctned+Hms_Poaching+X.broadleaved_woodland? ? ? ? ? ? ?+X.urban.suburban+X.CapWks,
2002 Nov 15
5
confidence interval in "predict.lm"
I am studying statistics using R and a book "Understandable Statistics", by
Brase and Brase. The book has two
worked examples for calculating a confidence interval around a predicted
value from a linear model. The answers
to the two examples in the book differ from those I get from R. The
regression line, the standard error, and the
predicted value in
R and the book all agree for the
2010 Apr 29
1
R Anova Analysis
Dear all,
I have a quite basic questions about anova analysis in R, sorry for
this, but I have no clue how to explain this result.
I have two datasets which are named: nmda123, nmda456. Each dataset has
three samples which were measured three times. And I would like to
compare means of them with Posthoc test using R, following please see
the output:
(CREB, mCREB and No virus are the name of
2007 Mar 02
4
significant anova but no distinct groups ?
Dear all,
I am studying a dataset using the aov() function.
The independant variable 'cds' is a factor() with 8 levels and here is
the result in studying the dependant variable 'rta' with aov() :
> summary(aov(rta ~ cds))
Df Sum Sq Mean Sq F value Pr(>F)
cds 7 0.34713 0.04959 2.3807 0.02777
Residuals 92 1.91635 0.02083
The dependant variable
2006 Mar 08
1
power and sample size for a GLM with Poisson response variable
Craig, Thanks for your follow-up note on using the asypow package. My
problem was not only constructing the "constraints" vector but, for my
particular situation (Poisson regression, two groups, sample sizes of
(1081,3180), I get very different results using asypow package compared
to my other (home grown) approaches.
library(asypow)
pois.mean<-c(0.0065,0.0003)
info.pois <-
2010 Oct 22
2
visualize TukeyHSD results
I am a new R user but a long time SAS user. I searched for a response to this question but no luck, so forgive me if this topic has been covered before. I am running a TukeyHSD post hoc test after running an ANOVA. I get the results of all pairwise comparisons, no problem. However, the output table is a little "busy", and I'd like to make the output easier to read. Specifically, I
2011 Apr 20
1
Error in dimnames(x) for Poisson EWMA model
I am attempting to run a Poisson EWMA model using Patrick Brandt's source code. I get the following error when I run the code:
Error in dimnames(x) <- dn :
length of 'dimnames' [1] not equal to array extent
Dimnames(x) looks like this:
[[1]]
NULL
[[2]]
[1] "mip" "div" "nom" "unity" "mood"