search for: svybi

Displaying 20 results from an estimated 25 matches for "svybi".

Did you mean: svyby
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: >
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
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 ...
2006 Apr 22
1
svyby example returns error
I get error trying to run examples from 'svyby' help page (?svyby in package "Survey"): # code data(api) dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc) svyby(~api99, ~stype, dclus1, svymean) # error message > Error in match.arg(vartype, several.ok = TRUE) : unused argument(s) (several.ok ...) Is this a version problem? I'm running R
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
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
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
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
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
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,
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,
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
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
2010 Aug 25
1
Surprising behaviour survey-package with missing values
Dear list, I got some surprising results when using the svytotal routine from the survey package with data containing missing values. Some example code demonstrating the behaviour is included below. I have a stratified sampling design where I want to estimate the total income. In some strata some of the incomes are missing. I want to ignore these missing incomes. I would have expected that
2011 Aug 18
1
Comparison of means in survey package
Dear list colleagues, I'm trying to come up with a test question for undergraduates to illustrate comparison of means from a complex survey design. The data for the example looks roughly like this: mytest<-data.frame(harper=rnorm(500, mean=60, sd=1), party=sample(c("BQ", "NDP", "Conservative", "Liberal", "None", NA), size=500,
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>
2009 Nov 14
4
Weighted descriptives by levels of another variables
I've noticed that R has a number of very useful functions for obtaining descriptive statistics on groups of variables, including summary {stats}, describe {Hmisc}, and describe {psych}, but none that I have found is able to provided weighted descriptives of subsets of a data set (ex. descriptives for both males and females for age, where accurate results require use of sampling
2006 Feb 17
3
Windows metafile problem
Hi All: I'm using win.metafile() to produce windows metafiles. When I use Word to insert the wmf picture, Word gives an error! I did my homework in posting this question, and couldn't find a fix. Any suggestions? Phil Smith CDC
2007 Sep 20
2
Package Survey
Hello, How I use the function as.svrepdesign without memory.size problems? desenho_npc_JK <- as.svrepdesign(desenho_npc,type="JKn") Error: cannot allocate vector of size 161.3 Mb In addition: Warning messages: 1: Reached total allocation of 1022Mb: see help(memory.size) 2: Reached total allocation of 1022Mb: see help(memory.size) 3: Reached total allocation of 1022Mb: