Description Usage Arguments Details Value Stratified samples
drill.svq
is the drill implementation for class svq
1 |
q |
a svq object |
by |
a factor to split |
strat |
an optional factor of strata for stratified samples |
N |
the vector of population values for each stratum |
The svq is split by the factor by
and cross sectional measurements
are made for for each subgroup. The measurement made is determined by the
type of the svq. "select one" questions generate cross tabulations of
responses in each subgroup and overall. One table will be generated for the
counts, a second for an estimate of the proportion of each subgroup
responding with each choice, and a third for the standard error of each
estimate. "select all that apply" (select_multi) questions are similar
but the proportions will not, in general, add up to one. "decimal" and
"integer" questions will generate a table with the mean, the standard
deviation, the standard error (others to be added). The last column in each
table will give the totals. "date" questions will
generate a table of frequencies.
Optionally, q
can be a list of svq
objects of the same length
and question type, and drill.svq
will return a list of results.
by
can also be a list of factors, with a similar result, but the
implementation of this is a little rough.
a list of class svqdrill
with the following elements:
typethe question type
for "select" types:
counts
proportion
margin of error
for "integer" and "decimal" types:
means
for "date" types:
counts
If the data was collected using stratified sampling, estimates and standard
errors can be calculated accordingly by setting strat
and N
.
strat
should be a factor of the same length as q that can be used to
split the data into the strata. N is a vector of length
length(levels(strat))
with the population size corresponding to each
stratum. If N
is specified as an integer and strat is NULL
,
the finite population correction will be applied to the error estimates.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.