Displaying 20 results from an estimated 1000 matches similar to: "The 'test.terms' argument in 'regTermTest' in package 'survey'"
2002 May 16
1
glm(y ~ -1 + c, "binomial") question
This is a question about removing the intercept in a binomial
glm() model with categorical predictors. V&R (3rd Ed. Ch7) and
Chambers & Hastie (1993) were very helpful but I wasn't sure I
got all the answers.
In a simplistic example suppose I want to explore how disability
(3 levels, profound, severe, and mild) affects the dichotomized
outcome. The glm1 model (see below) is
2002 Apr 30
1
MemoryProblem in R-1.4.1
Hi all,
In a simulation context, I'm applying some my function, "myfun" say, to a
list of glm obj, "list.glm":
>length(list.glm) #number of samples simulated
[1] 1000
>class(list.glm[[324]]) #any component of the list
[1] "glm" "lm"
>length(list.glm[[290]]$y) #sample size
[1] 1000
Because length(list.glm) and the sample size are rather large,
2008 Nov 19
1
F-Tests in generalized linear mixed models (GLMM)
Hi!
I would like to perform an F-Test over more than one variable within a
generalized mixed model with Gamma-distribution
and log-link function. For this purpose, I use the package mgcv.
Similar tests may be done using the function "anova", as for example in
the case of a normal
distributed response. However, if I do so, the error message
"error in eval(expr, envir, enclos) :
2008 May 08
2
poisson regression with robust error variance ('eyestudy
Ted Harding said:
> I can get the estimated RRs from
> RRs <- exp(summary(GLM)$coef[,1])
> but do not see how to implement confidence intervals based
> on "robust error variances" using the output in GLM.
Thanks for the link to the data. Here's my best guess. If you use
the following approach, with the HC0 type of robust standard errors in
the
2006 Mar 16
2
DIfference between weights options in lm GLm and gls.
Dear R-List users,
Can anyone explain exactly the difference between Weights options in lm glm
and gls?
I try the following codes, but the results are different.
> lm1
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
0.1183 7.3075
> lm2
Call:
lm(formula = y ~ x, weights = W)
Coefficients:
(Intercept) x
0.04193 7.30660
> lm3
Call:
2009 Feb 16
1
Overdispersion with binomial distribution
I am attempting to run a glm with a binomial model to analyze proportion
data.
I have been following Crawley's book closely and am wondering if there is
an accepted standard for how much is too much overdispersion? (e.g. change
in AIC has an accepted standard of 2).
In the example, he fits several models, binomial and quasibinomial and then
accepts the quasibinomial.
The output for residual
2011 Sep 21
1
Problem with predict and lines in plotting binomial glm
Problems with predict and lines in plotting binomial glm
Dear R-helpers
I have found quite a lot of tips on how to work with glm through this mailing list, but still have a problem that I can't solve.
I have got a data set of which the x-variable is count data and the y-variable is proportional data, and I want to know what the relationship between the variables are.
The data was
2007 Feb 14
1
how to report logistic regression results
Dear all,
I am comparing logistic regression models to evaluate if one predictor
explains additional variance that is not yet explained by another predictor.
As far as I understand Baron and Li describe how to do this, but my question
is now: how do I report this in an article? Can anyone recommend a
particular article that shows a concrete example of how the results from te
following simple
2010 Jun 03
1
compare results of glms
dear list!
i have run several glm analysises to estimate a mean rate of dung decay
for independent trials. i would like to compare these results
statistically but can't find any solution. the glm calls are:
dung.glm1<-glm(STATE~DAYS, data=o_cov, family="binomial(link="logit"))
dung.glm2<-glm(STATE~DAYS, data=o_cov_T12, family="binomial(link="logit"))
as
2004 May 07
1
contrasts in a type III anova
Hello,
I use a type III anova ("car" package) to analyse an unbalanced data design. I
have two factors and I would have the effect of the interaction. I read that
the result could be strongly influenced by the contrasts. I am really not an
expert and I am not sure to understand indeed about what it is...
Consequently, I failed to properly used the fit.contrast function (gregmisc
2006 Aug 31
1
NaN when using dffits, stemming from lm.influence call
Hi all
I'm getting a NaN returned on using dffits, as explained
below. To me, there seems no obvious (or non-obvious reason
for that matter) reason why a NaN appears.
Before I start digging further, can anyone see why dffits
might be failing? Is there a problem with the data?
Consider:
# Load data
dep <-
2006 Aug 27
1
refer to objects with sequential names
Dear Listers,
If I have several glm objects with names glm1, glm2.... and want to apply
new data to these objects. Instead of typing "predict(glm1, newdata)..." 100
times, is there way I could do so in a loop?
Thank you so much!
wensui
[[alternative HTML version deleted]]
2008 Feb 19
1
Referencing to an object within a function
I am encountering an error when I attempt to reference a glm model
within a function. The function uses the segmented.glm command
(package = segmented). Within the segmented.glm command one specifies
an object, in this case a logistic regression model, and specifies a
starting threshold term (psi). I believe this is an environment
problem, but I do not have a solution. Any assistance
2003 Feb 28
1
summary.glm() print problem(?) with cor = TRUE
Hi,
I've had a look the bug list and searched though the R documentation, email
lists etc. but didn't see anything on this:
when I do:
summary(species.glm1, correlation = TRUE)
I get a correlation matrix like this:
Correlation of Coefficients:
( p I(H C
pH * 1
I(pH^2) * B 1
Ca . . 1
I(Ca^2) . . B
attr(,"legend")
[1] 0 ` ' 0.3 `.'
2005 Aug 04
0
add1.lm and add1.glm not handling weights and offsets properly (PR#8049)
I am using R 2.1.1 under Mac OS 10.3.9.
Two related problems (see notes 1. and 2. below) are illustrated by
results of the following:
y <- rnorm(10)
x <- z <- 1:10
is.na(x[9]) <- TRUE
lm0 <- lm(y ~ 1)
lm1 <- lm(y ~ 1, weights = rep(1, 10))
add1(lm0, scope = ~ x) ## works ok
add1(lm1, scope = ~ x) ## error
lm2 <- lm(y ~ 1, offset = 1:10)
add1(lm0, scope = ~ z) ##
2005 Aug 05
0
(PR#8049) add1.lm and add1.glm not handling weights and
David,
Thanks.
The reason add1.lm (and drop1.lm) do not support offsets is that lm did
not when they were written, and the person who added offsets to lm did not
change them. (I do wish they had not added an offset arg and just used the
formula as in S's glm.) That is easy to add.
For the other point, some care is needed if 'x' is supplied and the upper
scope reduces the number
2009 Oct 09
1
svy / weighted regression
Dear list,
I am trying to set up a propensity-weighted regression using the
survey package. Most of my population is sampled with a sampling
probability of one (that is, I have the full population). However, for
a subset of the data I have only a 50% sample of the full population.
In previous work on the data, I analyzed these data using SAS and
STATA. In those packages I used a propensity weight
2011 Sep 06
1
Question about Natural Splines (ns function)
Hi - How can I 'manually' reproduce the results in 'pred1' below? My attempt
is pred_manual, but is not correct. Any help is much appreciated.
library(splines)
set.seed(12345)
y <- rgamma(1000, shape =0.5)
age <- rnorm(1000, 45, 10)
glm1 <- glm(y ~ ns(age, 4), family=Gamma(link=log))
dd <- data.frame(age = 16:80)
mm <- model.matrix( ~ ns(dd$age, 4))
pred1 <-
2007 May 07
0
Analyzing "Stacked" Time Series
I have a question about pooling or "stacking" several time series
?samples? (sorry in advance for the long, possibly confusing, message).
I'm sure I'm revealing far more ignorance than I'm aware of, but
that's why I'm sending this...
[Example at bottom]
I have regional migration flows (?samples?) from, say, regions A to B, A
to C, B to A, ?., C to B (Noted as
2004 Sep 20
1
Using eval() more efficiently?
Hi,
Suppose I have a vector:
> names.select
[1] "Idd13" "Idd14" "Idd8.12" "Idd7"
automatically generated by some selection criteria.
Now, if I have a data frame with many variables, of which the variables in
"names.select" are also variables from the data frame. e.g.
> all.df[1:5,]
Mouse Idd5 Idd6.19.20 Idd13 Idd14 Idd8.12