Description Usage Arguments Value See Also Examples
Horvitz-Thompson estimator of means and totals for a large survey. The functions computes cell proportions and counts for factor variables. For surveys with replicate weights (sqlrepsurvey
) only, it is possible to use expressions involving mathematical functions, logical operations, %in%
, and cut
.
1 2 3 4 5 6 7 8 9 10 11 12 | ## S3 method for class 'sqlrepsurvey'
svymean(x, design, na.rm = TRUE, byvar = NULL, se = TRUE,
...)
## S3 method for class 'sqlrepsurvey'
svytotal(x, design, na.rm = TRUE, byvar = NULL, se = TRUE,
...)
## S3 method for class 'sqlsurvey'
svymean(x, design, na.rm = TRUE, byvar = NULL,
se = FALSE, keep.estfun = FALSE, ...)
## S3 method for class 'sqlsurvey'
svytotal(x, design, na.rm = TRUE, byvar = NULL,
se = FALSE, keep.estfun = FALSE, ...)
|
x |
model formula |
design |
|
na.rm |
Remove missing values (treat as domain) |
byvar |
Formula with grouping variables |
se |
Compute variance-covariance matrix? |
keep.estfun |
Keep the SQL table of estimating functions after the standard errors are computed. |
... |
For future expansion |
A data frame with a column for each variable and a row for each group,
with the covariance matrix in the "var"
attribute.
1 2 3 4 5 | ## Not run:
svytotal(~sex, acs, byvar=~st)
svymean(~wagp,subset(acs, wagp>0), byvar=~sex)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.