Displaying 20 results from an estimated 10000 matches similar to: "Re: glm and data.frames (PR#108)"
2002 Oct 24
3
model.matrix (via predict) (PR#2206)
Full_Name: Glenn Stone
Version: 1.5.1 and 1.6.0
OS: win2000
Submission from: (NULL) (168.140.227.9)
The following code produces incorrect fitted values in version 1.5.1 and an
error in 1.6.0
Error in "contrasts<-"(*tmp*, value = "contr.treatment") :
contrasts apply only to factors
In addition: Warning message:
variable ihalf is not a factor in:
2007 Nov 25
2
Install repeated library
Hello -
I cannot get to
www.alpha.luc.ac.be/~jlindsey/rcode.html<http://www.alpha.luc.ac.be/%7Ejlindsey/rcode.html>to
obtain and install the repeated library for use of glmm(). Is the web
page not active? Can you give me an alternative location to obtain the
repeated library?
Thank you,
Becky Parker
[[alternative HTML version deleted]]
2020 Jan 19
2
rpois(9, 1e10)
Hello, All:
????? Consider:
Browse[2]> set.seed(1)
Browse[2]> rpois(9, 1e10)
NAs produced[1] NA NA NA NA NA NA NA NA NA
????? Should this happen?
????? I think that for, say, lambda>1e6, rpois should return rnorm(.,
lambda, sqrt(lambda)).
????? For my particular Monte Carlo, I have replaced my call to rpois
with a call to the following:
?rpois. <- function(n,
2006 Mar 08
2
fitting a distribution using glm
it is easy to fit a distribution using fitdistr
poisdata <- rpois(n = 100, lambda = 2)
poismle <- fitdistr(poisdata, "Poisson")
poismle
but i would like to know whether its possible to get an identical result
using glm. I use
poistab <- data.frame(table(poisdata))
colnames(poistab) <- c("width","freq");
poistab[,"width"] <-
2020 Jan 19
0
rpois(9, 1e10)
Crazy thought, but being that a sum of Poissons is Poisson in the sum, can
you break your ?big? simulation into the sum of a few smaller ones? Or is
the order of magnitude difference just too great?
On Sun, Jan 19, 2020 at 1:58 PM Spencer Graves <spencer.graves at prodsyse.com>
wrote:
> This issue arose for me in simulations to estimate confidence,
> prediction, and tolerance
2020 Jan 23
1
[External] Re: rpois(9, 1e10)
On 1/20/20 12:33 PM, Martin Maechler wrote:
>
> It's really something that should be discussed (possibly not
> here, .. but then I've started it here ...).
>
> The NEWS for R 3.0.0 contain (in NEW FEATURES) :
>
> * Functions rbinom(), rgeom(), rhyper(), rpois(), rnbinom(),
> rsignrank() and rwilcox() now return integer (not double)
> vectors.
2020 Jan 19
0
rpois(9, 1e10)
Floor (maybe round) of non-negative numerics, though. Poisson should never
have anything after decimal.
Still think it?s worth allowing long long for R64 bit, just for purity
sake.
Avi
On Sun, Jan 19, 2020 at 4:38 PM Spencer Graves <spencer.graves at prodsyse.com>
wrote:
>
>
> On 2020-01-19 13:01, Avraham Adler wrote:
>
> Crazy thought, but being that a sum of Poissons is
2020 Jan 19
0
rpois(9, 1e10)
Technically, lambda can always be numeric. It is the observations which
must be integral.
Would hitting everything larger than maxint or maxlonglong with floor or
round fundamentally change the distribution? Well, yes, but enough that it
would matter over process risk?
Avi
On Sun, Jan 19, 2020 at 11:20 AM Benjamin Tyner <btyner at gmail.com> wrote:
> So imagine rpois is changed, such
2009 Jun 11
1
standard error beta glm
Dear All,
The std. error of the estimated coefficients
obtained by the summary.lm function can be calculated
as:
y=rnorm(20)
x=y+rnorm(20)
fit <- lm(y ~ x)
summary(fit)
sqrt( sum(fit$resid**2)/fit$df.resid * solve(t(model.matrix(fit))%*%model.matrix(fit)) )
Is posible calculate Std. Error for glm as lm, using
cov(hat beta) = phi * solve(t(X) %*% hat W %*% X)^-1
on R? Who is hat W and
2012 Nov 06
1
glm fitting routine and convergence
What kind of special magic does glm have?
I'm working on a logistic regression solver (L-BFGS) in c and I've been
using glm to check my results. I came across a data set that has a very
high condition number (the data matrix transpose the data matrix) that when
running my solver does not converge, but the same data set with glm was
converging ( I love R :) ). I noticed that glm using
2020 Jan 20
0
[External] Re: rpois(9, 1e10)
>>>>> Spencer Graves
>>>>> on Sun, 19 Jan 2020 21:35:04 -0600 writes:
> Thanks to Luke and Avi for their comments.? I wrapped "round" around the
> call to "rnorm" inside my "rpois.".? For "lambda" really big, that
> "round" won't do anything.? However, it appears to give integers in
2020 Jan 20
0
[External] Re: rpois(9, 1e10)
R uses the C 'int' type for its integer data and that is pretty much
universally 32 bit these days. In fact R wont' compile if it is not.
That means the range for integer data is the integers in [-2^31,
+2^31).
It would be good to allow for a larger integer range for R integer
objects, and several of us are thinking about how me might get there.
But it isn't easy to get right, so
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 <-
2020 Jan 19
2
rpois(9, 1e10)
On 2020-01-19 09:34, Benjamin Tyner wrote:
>> ------------------------------------------------------------------------
>> Hello, All:
>>
>>
>> ? ????? Consider:
>>
>>
>> Browse[2]> set.seed(1)
>> Browse[2]> rpois(9, 1e10)
>> NAs produced[1] NA NA NA NA NA NA NA NA NA
>>
>>
>> ? ????? Should this happen?
>>
2020 Jan 19
2
rpois(9, 1e10)
So imagine rpois is changed, such that the storage mode of its return
value is sometimes integer and sometimes numeric. Then imagine the case
where lambda is itself a realization of a random variable. Do we really
want the storage mode to inherit that randomness?
On 1/19/20 10:47 AM, Avraham Adler wrote:
> Maybe there should be code for 64 bit R to use long long or the like?
>
> On
2004 Jun 15
1
AIC in glm.nb and glm(...family=negative.binomial(.))
Can anyone explain to me why the AIC values are so different when
using glm.nb and glm with a negative.binomial family, from the MASS
library? I'm using R 1.8.1 with Mac 0S 10.3.4.
>library(MASS)
> dfr <- data.frame(c=rnbinom(100,size=2,mu=rep(c(10,20,100,1000),rep(25,4))),
+ f=factor(rep(seq(1,4),rep(25,4))))
> AIC(nb1 <- glm.nb(c~f, data=dfr))
[1] 1047
>
2020 Jan 19
2
rpois(9, 1e10)
????? This issue arose for me in simulations to estimate confidence,
prediction, and tolerance intervals from glm(., family=poisson) fits
embedded in a BMA::bic.glm fit using a simulate.bic.glm function I added
to the development version of Ecfun, available at
"https://github.com/sbgraves237/Ecfun".? This is part of a vignette I'm
developing, available at
2020 Jan 19
0
rpois(9, 1e10)
Maybe there should be code for 64 bit R to use long long or the like?
On Sun, Jan 19, 2020 at 10:45 AM Spencer Graves <spencer.graves at prodsyse.com>
wrote:
>
>
> On 2020-01-19 09:34, Benjamin Tyner wrote:
> >> ------------------------------------------------------------------------
> >> Hello, All:
> >>
> >>
> >> Consider:
2001 Oct 10
2
Pearson residuals (PR#1123)
Full_Name: Carmen Fernandez
Version: 1.3.1
OS:
Submission from: (NULL) (138.251.202.115)
I think there is a problem when computing Pearson residuals, in that they seem
to be computed at the raw residuals divided by the square root of the
corresponding diagonal element of the weight matrix W evaluated at the last step
of the iterative model fitting procedure (IWLS), instead of dividing by the
2020 Jan 20
2
[External] Re: rpois(9, 1e10)
Thanks to Luke and Avi for their comments.? I wrapped "round" around the
call to "rnorm" inside my "rpois.".? For "lambda" really big, that
"round" won't do anything.? However, it appears to give integers in
floating point representation that are larger than
.Machine$integer.max.? That sounds very much like what someone would
want.?