| R_indicator | R Documentation |
Calculates the R-Indicator of the (weighted) data frame.
R_indicator(
dfs,
response_identificators,
variables,
id = NULL,
weight = NULL,
strata = NULL,
get_r2 = FALSE
)
dfs |
A character vector containing the names of data frames to calculate the R indicator. |
response_identificators |
A character vector, naming response identificators
for every df. Response identificators should indicate if respondents are part
of the set of respondents |
variables |
A character vector with the names of variables that should be used in the model to calculate the R indicator. |
id |
A character vector that determines id variables that are used to weight the dfs with the help of the survey package. They have to be part of the respective data frame. If only one character is provided, the same variable is used to weight every df. |
weight |
A character vector that determines variables to weight the dfs. They have to be part of the respective data frame. If only one character is provided, the same variable used to weight every df. If a weight variable is provided also an id variable is needed. For weighting, the survey package is used. |
strata |
A character vector that determines strata variables that are used to weight the dfs with the help of the survey package. They have to be part of the respective data frame. If only one character is provided, the same variable is used to weight every df. |
get_r2 |
If true, Pseudo R-squared of the propensity model will be returned, based on the method of McFadden. |
A list containing the R-indicator, and its standard error for every data frame.
The calculated R-indicator is based on Shlomo et al., (2012). The calculation of its standard error is based on functions provided by Shouten & Schlomo (2015), and on Github (https://github.com/addinall/RISQ)
The related subfunctions (getVarianceRSampleBased, weightedVar & getTrace) are licensed under the MIT License (MIT)
Copyright (c) 2015 addinall
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Shlomo, N., Skinner, C., & Schouten, B. (2012). Estimation of an indicator of the representativeness of survey response. Journal of Statistical Planning and Inference, 142(1), 201–211. https://doi.org/10.1016/j.jspi.2011.07.008
Shouten B. & Shlomo, N. (2015) RISQ manual 2.1, https://hummedia.manchester.ac.uk/institutes/cmist/risq/RISQ-manual-v21.pdf
data("card")
# For the purpose of this example, we assume that only respondents living in
# the south or only white respondents have participated in the survey.
sampcompR::R_indicator(dfs=c("card","card"),
response_identificators = c("south","black"),
variables = c("age","educ","fatheduc","motheduc","wage","IQ"),
weight = c("weight","weight"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.