response.var: A character string with the name of the column indicating the response variable in the data set or a vector (either numeric or character string) with information of the response variable for all the units.
phat.var: A character string with the name of the column indicating the estimated probabilities in the data set or a numeric vector containing estimated probabilities for all the units.
weights.var: A character string indicating the name of the column with sampling weights or a numeric vector containing information of the sampling weights. It could be NULL if the sampling design is indicated in the design argument. For unweighted estimates, set all the sampling weight values to 1.
tag.event: A character string indicating the label used to indicate the event of interest in response.var. The default option is tag.event = NULL, which selects the class with the lowest number of units as event.
cutoff.value: A numeric value indicating the cut-off point to be used. No default value is set for this argument, and a numeric value must be indicated necessarily.
data: A data frame which, at least, must incorporate information on the columns response.var, phat.var and weights.var. If data=NULL, then specific numerical vectors must be included in response.var, phat.var and weights.var, or the sampling design should be indicated in the argument design.
design: An object of class survey.design generated by survey::svydesign indicating the complex sampling design of the data. If design = NULL, information on the data set (argument data) and/or sampling weights (argument weights.var) must be included.
Returns
The output of this function is a list of 4 elements containing the following information:
Sew: a numeric value indicating the weighted estimate of the sensitivity parameter.
tags: list containing one element with the following information:
tag.event: a character string indicating the label used to indicate event of interest.
basics: a list containing information of the following 6 elements:
n: a numeric value indicating the number of units in the data set.
n.event: a numeric value indicating the number of units in the data set with the event of interest.
n.event.class: a numeric value indicating the number of units in the data set with the event of interest that are correctly classified as events based on the selected cut-off point.
hatN: number of units in the population, represented by all the units in the data set, i.e., the sum of the sampling weights of the units in the data set.
hatN.event: number of units with the event of interest represented in the population by all the event units in the data set, i.e., the sum of the sampling weights of the units with the event of interest in the data set.
hatN.event.class: number of event units represented in the population by the event units in the data set that have been correctly classified as events based on the selected cut-off point, i.e., the sum of the sampling weights of the correctly classified event units in the data set.
call: an object saving the information about the way in which the function has been run.
Details
Let S indicate a sample of n observations of the vector of random variables (Y,X), and ∀i=1,…,n,yi indicate the ith observation of the response variable Y, and xi the observations of the vector covariates X. Let wi indicate the sampling weight corresponding to the unit i and p^i the estimated probability of event. Let S0 and S1 be subsamples of S, formed by the units without the event of interest (yi=0) and with the event of interest (yi=1), respectively. Then, the sensitivity parameter for a given cut-off point c is estimated as follows:
Sew(c)=∑i∈S1wi∑i∈S1wi⋅I(p^i≥c).
See Iparragirre et al. (2022) and Iparragirre et al. (2023) for more details.
Iparragirre, A., Barrio, I., Aramendi, J. and Arostegui, I. (2022). Estimation of cut-off points under complex-sampling design data. SORT-Statistics and Operations Research Transactions 46 (1), 137--158. (https://doi.org/10.2436/20.8080.02.121)
Iparragirre, A., Barrio, I. and Arostegui, I. (2023). Estimation of the ROC curve and the area under it with complex survey data. Stat 12 (1), e635. (https://doi.org/10.1002/sta4.635)