Displaying 20 results from an estimated 1000 matches similar to: "crosstable and regression for survey data (weighted)"
2008 Aug 06
1
Warning when using survey:::svyglm
Howdy,
Referencing the below exchange:
https://stat.ethz.ch/pipermail/r-help/2006-April/103862.html
I am still getting the same warning ("non-integer #successes in a
binomial glm!") when using svyglm:::survey. Using the API data:
library(survey)
data(api)
#stratified sample
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
2012 Oct 12
0
goodness of fit for logistic regression with survey package
I am making exploratory analyses on a complex survey data by using survey
package. Could you help me how to see the goodness of fit for the model
below? Should I use AIC, BIC, ROC, or what? What code would let me run a
goodness of fit test for the model? Here are my codes:
#incorporating design effects#
> mydesign <- svydesign(id=~clust, strata=~strat, weights=~sweight,
> data=mydata)
2013 May 02
1
Package survey: singularities in linear regression models
Hello,
I want to specify a linear regression model in which the metric outcome
is predicted by two factors and their interaction. glm() computes
effects for each factor level and the levels of the interaction. In the
case of singularities glm() displays "NA" for the corresponding
coefficients. However, svyglm() aborts with an error message. Is there a
possibility that svyglm()
2012 Feb 13
1
survey package svystat objects from predict()
Hello,
I'm running R 2.14.1 on OS X (x86_64-apple-darwin9.8.0/x86_64 (64-bit)), with version 3.28 of Thomas Lumley's survey package. I was using predict() from svyglm(). E.g.:
data(api)
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
out <- svyglm(sch.wide~ell+mobility, design=dstrat,
family=quasibinomial())
pred.df <-
2009 Nov 02
2
"object not found" within function
Hi,
I am trying to write a function to compute many cross-tabulations with the -svytable- command. Here is a simplified example of the structure of my code (adapted from the -svytable- help file):
data(api)
func.example<-function(variable){
dclus1<-svydesign(id=~1, weights=~pw,data=apiclus1, fpc=~fpc)
svytable(~ variable, dclus1)
}
When I call this function with:
2012 Jun 12
2
GEE with Inverse Probability Weights
Greetings,
I have a very, very, simple research question. I want to predict one
dichotomous variable using another dichotomous variable. Straightforward,
right? The issue is that the dataset has two issues causing some
complications for me.
1) The subjects are not independent -- they are sibling pairs. Every person
in the dataset has a sibling in the dataset. This needs to be treated a
2011 Oct 24
4
Problem with svyvar in survey package
I am facing a problem with a function in survey package. The function svyvar
gives the estimated population variance from a given sampling scheme. I am
working with a data having more than four continuous variables. In order to
have have population total for all those cont. variables I have written in
the following format
svyvar(~var1+var2+var3+var4+var5+var6,data) ; var1,var2,...,var6 are 6
2005 Jun 16
1
Survey - Cluster Sampling
Dear WizaRds,
I am struggling to compute correctly a cluster sampling design. I want
to do one stage clustering with different parametric changes:
Let M be the total number of clusters in the population, and m the
number sampled. Let N be the total of elements in the population and n
the number sampled. y are the values sampled. This is my example data:
clus1 <-
2007 Sep 06
3
Survey package
Good afternoon!
I'm trying to use the Survey package for a stratified sample which has 4 criteria on which the stratification is based. I would like to get the corrected weights and for every element i get a weight of 1
E.g: tipping
design <- svydesign (id=~1, strata= ~regiune + size_loc + age_rec_hhh + size_hh, data= tabel)
and then weights(design)
gives
2012 Dec 10
3
Warning message: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!
Hi there
I'm trying to fit a logistic regression model to data that looks very similar to the data in the sample below. I don't understand why I'm getting this error; none of the data are proportional and the weights are numeric values. Should I be concerned about the warning about non-integer successes in my binomial glm? If I should be, how do I go about addressing it?
I'm
2008 Dec 19
1
svyglm and sandwich estimator of variance
Hi,
I would like to estimate coefficients using poisson regression and then get
standard errors that are adjusted for heteroskedasticity, using a complex
sample survey data. Then I will calculate prevalence ratio and confidence
intervals.
Can sandwich estimator of variance be used when observations aren?t
independent? In my case, observations are independent across groups
(clusters), but
2006 Jul 18
1
Survey-weighted ordered logistic regression
Hi,
I am trying to fit a model with an ordered response variable (3 levels) and
13 predictor variables. The sample has complex survey design and I've used
'svydesign' command from the survey package to specify the sampling design.
After reading the manual of 'svyglm' command, I've found that you can fit a
logistic regression (binary response variable) by specifying the
2012 Oct 18
3
svyplot and svysmooth with hexbin
Hi all-
So sorry to bother you all with something pretty basic.
I am trying to add the lines method output from svysmooth to a svyplot with style="grayhex". However, the line either appears in the wrong place or if I am running in R Studio it causes the system to crash.
I know this is something to do with Lattice graphics, but for the life of me I can not figure out how. Dr. Lumley
2009 Mar 11
1
CI from svyquantile in survey package
I am having trouble understanding (i.e. getting) confidence intervals from
the survey package. I am using R version 2.8.1 (2008-12-22) and survey
package (3.11-2) on FC7 linux. To simplify my question I use an example from
that package:
R> data(api)
R> dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
R> (tst <- svyby(~api99, ~stype,
2012 Nov 23
1
problem with svyglm
I have this problem.
test <- svydesign(id=~1,weights=~peso)
logit <- svyglm(bach ~ job2 + mujer + egp4 + programa + delay + mdeo + str
+ evprivate, family=binomial,design=test)
then appear:
Error in svyglm.survey.design(bach ~ job2 + mujer + egp4 + programa + :
all variables must be in design= argument
I don't know what this mean...
Please help.
Pablo.
[[alternative HTML
2012 Jun 28
1
SVY: variance inflation factor VIF with complex survey
Hello,
Seeking a way to get the variance inflation factor VIF for a model of regression in complex survey, I have understood that without this package (SURVEY) RGui VIF obtained as follows:
fit <- lm(mpg~disp+hp+wt+drat, data=mtcars)
vif(fit)
But I want to know if survey, Vif is obtained so
vif( svyglm(api00~ell+meals+mobility, design=dstrat))
Thank you, happy day
2009 Apr 02
1
problem with svyglm()
Hello,
I'm trying to use the function svyglm in the library survey.
I create a data survey object:
data_svy<- svydesign(id=~PSU, strata=~sample_domain,
weights=~sample_weight, data=data, nest=TRUE)
and I try to use svyglm() with little success:
R<-svyglm(data_svy[,4]~(data_svy[,iCol]==listModality[[iVar]]
[iMod]),design=data_svy, family=binomial(link="logit")
Error in
2010 Mar 26
1
return.replicates in survey pkg
How do I retrieve the replicates estimates from a crosstab done using
svyby?
Here is an example from the help page for svyby in the package:
> data(api)
> dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
> rclus1<-as.svrepdesign(dclus1)
>
> a <- svyby(~api99, ~stype, rclus1, svymean, return.replicates=TRUE)
> a$replicates
NULL
But, compare to
> b
2010 Mar 10
1
Strange result in survey package: svyvar
Hi R users,
I'm using the survey package to calculate summary statistics for a large
health survey (the Demographic and Health Survey for Honduras, 2006), and
when I try to calculate the variances for several variables, I get negative
numbers. I thought it may be my data, so I ran the example on the help
page:
data(api)
## one-stage cluster sample
dclus1<-svydesign(id=~dnum, weights=~pw,
2012 Aug 02
1
summary(svyglm) Pr (> | t |) ?
Hello
I want to know if the summary of the logistic model with survey
Pr (> | t |) to test if the coefficient of the model is significant,
ie is the p_valor wald test for the model coefficients,
for I am interested to know if the three levels of the variable educational level are significant to the model (significance of handling 0.2),
I present below the results of my model