Type: | Package |
Title: | Processing Survey Data with Confidence Intervals Like 'SPSS' Software |
Version: | 1.1.2 |
Description: | Processes survey data and displays estimation results along with the relative standard error in a table, including the number of samples and also uses a t-distribution approach to compute confidence intervals, similar to 'SPSS' (Statistical Package for the Social Sciences) software. |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
LazyData: | true |
Author: | Asy-Syaja'ul Haqqul Amin [aut, cre] |
Maintainer: | Asy-Syaja'ul Haqqul Amin <haqqul.amin06@gmail.com> |
RoxygenNote: | 7.3.2 |
Depends: | R (≥ 2.10) |
Imports: | survey |
Suggests: | testthat (≥ 3.0.0) |
NeedsCompilation: | no |
Packaged: | 2025-02-18 11:45:24 UTC; Haqqul Amin |
Repository: | CRAN |
Date/Publication: | 2025-02-19 14:40:02 UTC |
ctablerseh
Description
Processes survey data and displays the estimation results along with the relative standard error in the form of a table that includes the number of samples with a t-distribution approach to produce confidence intervals as in SPSS.
Usage
ctablerseh(
numerator,
denominator,
disaggregation,
survey.design,
survey.data,
survey.type
)
Arguments
numerator |
is a variable that contains the numerator value or main value of the observation, the estimated value of which will then be calculated, either in the form of a proportion, ratio or average. |
denominator |
is a variable that contains the denominator or divisor value which is usually all observations for proportion cases, or observations with different conditions for ratio cases, or is given the NA value if you only want to calculate the average. |
disaggregation |
is a variable that contains the grouping code for each observation, which can be the smallest group such as district, province or if you want to produce one aggregate estimate value, you can use the same grouping code for all observations. |
survey.design |
is a parameter that contains the survey design created with the "svydesign" function from the "survey" package. |
survey.data |
is the data used in calculating the estimated survey results. |
survey.type |
is a parameter that contains the survey type options, namely proportion (output in percentage form) by selecting "prop", or ratio (output in percentage form) by selecting "ratio" or average by selecting "mean". |
Value
This function returns a dataframe containing the estimated value, standard error, relative standard error, confidence interval, number of samples, and the population represented.
Examples
susenas.design = survey::svydesign(id=~psu, strata=~strata, data = datex, weights=~FWT)
ctablerseh(numerator = INDI, denominator = denom, disaggregation = R101,
survey.design = susenas.design, survey.data = datex, survey.type = "prop")
example data containing "INDI" variable, disaggregation, denominator and weighting for RSE calculation with the ctablerseh package
Description
example data containing "INDI" variable, disaggregation, denominator and weighting for RSE calculation with the ctablerseh package
Usage
data(datex)
Format
dataframe with 8117 rows and 6 columns:
- R101
is the provincial area code for each observation
- denom
is the denominator value of the indicator where each observation is 100
- psu
is the cluster component in the sample design which is equivalent to the cluster in SPSS
- strata
is the stratum component in the sample design which is equivalent to the strata in SPSS
- FWT
is a weighting component that states the number of populations represented by each observation
- INDI
is the value of the interest variable which has a value of 100 or 0 to calculate the estimate in percentage form and also its RSE