similar to: Surprising behaviour survey-package with missing values

Displaying 20 results from an estimated 4000 matches similar to: "Surprising behaviour survey-package with missing values"

2012 Oct 02
2
svyby and make.formula
Hello, Although my R code for the svymean () and svyquantile () functions works fine, I am stuck with the svyby () and make.formula () functions. I got the following error messages. - Error: object of type 'closure' is not subsettable # svyby () - Error in xx[[1]] : subscript out of bounds # make.formula () A reproducible example is appended below. I would appreciate if
2008 Oct 22
1
Package survey
Hi, I’m using the svyby for total statistics, for example: svyby(~p_igov,~div_a,desenho_nps,svytotal,drop.empty.groups=TRUE,vartype =c("se","var","cvpct")) In the numerical variable p_igov (and others) I have many non responses but if I maintain the NA it doesn’t work. summary(base_nps$p_igov) Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
2006 Jun 18
1
Post Stratification
Dear WizaRds, having met some of you in person in Vienna, I think even more fondly of this community and hope to continue on this route. It was great talking with you and learning from you. Thank you. I am trying to work through an artificial example in post stratification. This is my dataset: library(survey) age <- data.frame(id=1:8, stratum=rep(
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
2017 Jul 09
2
Help with ftable.svyby
Hi all, When I try the following with pkg Survey it returns the error below: ftable(svyby(~INCOME, ~AGECL+RACECL, svymean, design=q50), rownames=list(AGECL=c("<35", "35-44", "45-54", "55-64", "65-74", ">=75"), RACECL=c("white non hispanic", "non white or
2010 Jun 03
1
problem with 'svyby' function from SURVEY package
Hello, I'm using a complex survey dataset and my goal is to simply spit out a bunch of probability-weighted outcome variable means for the different levels of covariate. So I first define the structure of the study design (I'm using the CDC's NHANES data): dhanes <- svydesign(id=~PSU, strat=~STRATA, weight=~lab_weight, data=final, nest=TRUE) No problem there. Now I use the
2005 May 26
1
Survey and Stratification
Dear WizaRds, Working through sampling theory, I tried to comprehend the concept of stratification and apply it with Survey to a small example. My question is more of theoretic nature, so I apologize if this does not fully fit this board's intention, but I have come to a complete stop in my efforts and need an expert to help me along. Please help: age<-matrix(c(rep(1,5), rep(2,3),
2012 Apr 13
2
problem with svyby and NAs (survey package)
Hello I'm trying to get the proportion "true" for dichotomous variable for various subgroups in a survey. This works fine, but obviously doesn't give proportions directly: svytable(~SurvYear+problem.vandal, seh.dsn, round=TRUE) problem.vandal SurvYear FALSE TRUE 1995 8906 786 1997 17164 2494 1998 17890 1921 1999 18322 1669 2001 17623 2122 ...
2017 Jul 09
0
Help with ftable.svyby
try resetting your factor levels and re-run? q50 <- update( q50 , INCOME = factor( INCOME ) , AGECL = factor( AGECL ) , RACECL = factor( RACECL ) ) On Sun, Jul 9, 2017 at 2:59 PM, Orsola Costantini via R-help < r-help at r-project.org> wrote: > Hi all, > > When I try the following with pkg Survey it returns the error below: > > ftable(svyby(~INCOME, ~AGECL+RACECL,
2011 Mar 07
1
Risk differences with survey package
I'm trying to use the survey package to calculate a risk difference with confidence interval for binge drinking between sexes. Variables are X_RFBING2 (Yes, No) and SEX. Both are factors. I can get the group prevalences easily enough with result <- svyby(~X_RFBING2, ~SEX, la04.svy, svymean, na.rm = TRUE) and then extract components from the svyby object with SE() and coef() to do the
2012 Aug 10
1
Direct Method Age-Adjustment to Complex Survey Data
Hi everyone, my apologies in advance if I'm overlooking something simple in this question. I am trying to use R's survey package to make a direct method age-adjustment to some complex survey data. I have played with postStratify, calibrate, rake, and simply multiplying the base weights by the correct proportions - nothing seems to hit the published numbers on the nose. I am trying to
2006 Jul 07
2
Multistage Sampling
Dear WizaRds, dear Thomas, First of all, I want to tell you how grateful I am for all your support. I wish I will be able to help others along one day the same way you do. Thank you so much. I am struggling with a multistage sampling design: library(survey) multi3 <- data.frame(cluster=c(1,1,1,1 ,2,2,2, 3,3), id=c(1,2,3,4, 1,2,3, 1,2), nl=c(4,4,4,4, 3,3,3, 2,2), Nl=c(100,100,100,100,
2010 Aug 18
1
svyquantile w/ svyby is returning an error
svymean w/ svyby is working for me... > svyby(~visitcnt, ~agegrp3.f, svymean, design=svydes) agegrp3.f visitcnt se.visitcnt 18-44 18-44 8.755552 0.4953235 45-64 45-64 10.131555 0.5347806 65+ 65+ 9.588802 0.4323629 svyquantile is working for me... > svyquantile(~visitcnt, quantiles=c(.25, .5, .75), ties="rounded", design=svydes) 0.25
2008 Aug 15
2
Design-consistent variance estimate
Dear List: I am working to understand some differences between the results of the svymean() function in the survey package and from code I have written myself. The results from svymean() also agree with results I get from SAS proc surveymeans, so, this suggests I am misunderstanding something. I am never comfortable with "I did what the software" does mentality, so I am working to
2008 Sep 09
1
survey package
Version 3.9 of the survey package is now on CRAN. Since the last announcement (version 3.6-11, about a year ago) the main changes are - Database-backed survey objects: the data can live in a SQLite (or other DBI-compatible) database and be loaded as needed. - Ordinal logistic regression - Support for the 'mitools' package and multiply-imputed data - Conditioning plots,
2008 Sep 09
1
survey package
Version 3.9 of the survey package is now on CRAN. Since the last announcement (version 3.6-11, about a year ago) the main changes are - Database-backed survey objects: the data can live in a SQLite (or other DBI-compatible) database and be loaded as needed. - Ordinal logistic regression - Support for the 'mitools' package and multiply-imputed data - Conditioning plots,
2011 Aug 28
4
How do I get a weighted frequency table?
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110828/d35f51a1/attachment.pl>
2006 Aug 21
1
"vcov" error in svyby and svytable functions
Hi, I'm trying to compute survey svytable statistic on subsets by using the svyby function. Here is the code: b<-svyby(~V024+V751, by=~V025, design=strat2, svytable, round=TRUE) The vars, V024, V751 and V025 are factors. The by var has 2 levels, and hence there will be two subsets. strat2 is created by the svydesign function. It's giving me the following error: >
2009 Apr 03
1
Survey Package with Binary Data (no Standard Errors reported)
Hi, I'm trying to get standard errors for some of the variables in my data frame. One of the questions on my survey is whether faculty coordinate across curriculum to include Arts Education as subject matter. All the responses are coded in zeros and ones obviously. For some of the other variables I have a 2 for those that responded with "Don't Know". I'm getting NA for
2010 Feb 18
1
survey package question
Should the svyby function be able to work with svyquantile? I get the error below ... data(api) dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc) svyby(~api00, design=dclus1, by = ~stype, quantiles=c(.25,.5,.75), FUN=svyquantile, na.rm=T ) > Error in object$coefficients : $ operator is invalid for atomic vectors A