relative_bias: Relative Bias

Description Usage Arguments Value Examples

View source: R/relative_bias.R

Description

Get the relative bias of a sample obtained from a claimr sampling function

Usage

1

Arguments

obj

An object obtained from a claimr sampling function

var

A variable for the relative bias computation

...

Extra arguments associated with the mean function

Value

A number obtained from computing the relative bias of var computed using the sample data frame and sample frame data frame from an object obtained from a claimr sampling function

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#Generate sampling frame  with an index id from 1 to N
df_sample_frame_num <- data.frame("sample_frame_sequence_id" = 1:1000,
                                 "score" = rnorm(1000))

#Get output and input in lists
score_audit_num <- rs_singlestage(df = df_sample_frame_num,
                                  seed_number = 100,
                                  audit_review = "Score Audit",
                                  quantity_to_generate = 100,
                                  quantity_of_spares = 3,
                                  frame_low = 1,
                                  frame_high = 1000)

#Compute relative bias of sample stored in score_audit_num

relative_bias(obj = score_audit_num, var = score)

mncube/claimr documentation built on Dec. 21, 2021, 8:07 p.m.