[R] cumVar and cumSkew

2011-09-15 Thread D_Tomas
Hi there, I need to do the same thing as cumsum but with the variance and skewness. I have tried to do a loop for like this: var.value - vector(mode = numeric, length = length(daily)) for (i in (1:length(daily))) { var.value[i] - var(daily[1:i]) } But because

[R] GLM and Neg. Binomial models

2011-10-13 Thread D_Tomas
Hi userRs! I am trying to fit some GLM-poisson and neg.binomial. The neg. Binomial model is to account for over-dispersion. When I fit the poisson model i get: (Dispersion parameter for poisson family taken to be 1) However, if I estimate the dispersion coefficient by means of:

[R] over-estimation Negative Binomial models

2011-10-17 Thread D_Tomas
Hi! I have fitted a Negative Binomial model (glm.nb) and a Poisson model (glm family=poisson) to some count data. Both have the same explanatory variables dataset When I call sum(fitted(model.poisson)) for my GLM-Poisson model, I obtain exactly the same number of counts as my data. However,

Re: [R] GLM and Neg. Binomial models

2011-10-18 Thread D_Tomas
Dear Ben, First of all, many thanks for your reply. I am highly appreciative of that. I am still unsure about some issues The dispersion parameter is that which is estimated by sum(residuals(fit,type=pearson)^2)/fit$df.res. This is what a quasipoisson model estimates. This corresponds

Re: [R] over-estimation Negative Binomial models

2011-10-18 Thread D_Tomas
Ben, this is a continuation of the query i posted on: http://r.789695.n4.nabble.com/GLM-and-Neg-Binomial-models-td3902173.html I cannot give you a direct example (big dataset) of what i did aside from what i have written: fitpoisson - glm((RESPONSE) ~ A + B + offset(log(LENGTH)) +

[R] Standard errors GLM

2012-03-13 Thread D_Tomas
Dear userRs, when applied the summary function to a glm fit (e.g Poisson) the parameter table provides the categorical variables assuming that the first level estimate (in alphabetical order) is 0. What is the standard error for that variable then? Are the standard errors calculated assuming

[R] glm-poisson fitting 400.000 records

2011-10-21 Thread D_Tomas
Hi, I am trying to fi a glm-poisson model to 400.000 records. I have tried biglm and glmulti but i have problems... can it really be the case that 400.000 are too many records??? I am thinking of using random samples of my dataset. Many thanks, -- View this message in context:

Re: [R] glm-poisson fitting 400.000 records

2011-10-21 Thread D_Tomas
My apologies for my vague comment. My data comprises 400.000 x 21 (17 explanatory variables, plus response variable, plus two offsets). If I build the full model (only linear) I get: Error: cannot allocate vector of size 112.3 Mb I have a 4GB RAM laptop... Would i get any improvemnt on a

Re: [R] glm-poisson fitting 400.000 records

2011-10-24 Thread D_Tomas
Many thanks for your replies. I appreciate that. I tried what you suggested and it did work for the Poisson model (glm, poisson familly). Unfortunately, the negative binomial (glm.nb) did not work as I work the following message: Warning messages: 1: In ifelse(y mu, d.res, -d.res) : Reached

[R] NB and poisson glm models: three issues

2011-11-18 Thread D_Tomas
Hi, I fit both Poisson and NB (negative binomial) models to some empirical data. Although models provide me with sensible parameters, in the case of the NB models i get three inconsistencites: - First, the total number of occurrences predicted by the model (i.e. fitted(fit)) is much greater

[R] offset glm.nb issues why so unstable?

2012-05-29 Thread D_Tomas
Hi, I am using the glm.nb model type to fit some count data with TWO offset variables. I have successfully used this approach to build scores of models for several datasets but I am having problems with two in particular. Depending on the model I try to fit for a given dataset, I obtain

[R] Gaussian model GLM summary(model)$dispersion

2012-07-26 Thread D_Tomas
Hi, I have some data that is log-normally distributed and I am using a glm, type Gaussian to fit the logs. I would like to know the expected values within the context of the lognormal model. I am unsure whether I have to use: Expected_values=