# TODO: Add comment # # Author: ianfellows ############################################################################### context("weights.R") test_that("compute.weights",{ data(faux) rdsi.wts <- c(2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612) rdsids.wts <- c(2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.63485835223612, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.54275540382339, 2.63485835223612) rdsii.wts <-c(2.39047483002056, 1.91237986401645, 2.24985866354876, 1.19523741501028, 2.73197123430921, 1.52990389121316, 0.889479006519277, 1.3659856171546, 3.47705429821172, 3.82475972803289, 1.4710614338588, 1.82131415620614, 1.3659856171546, 1.73852714910586, 1.73852714910586, 2.12486651557383, 1.66293901218821, 2.01303143580678, 1.31888266483893, 2.54983981868859, 1.52990389121316, 1.59364988668037, 2.54983981868859, 2.94212286771761, 0.980707622572536, 1.4710614338588, 2.24985866354876, 1.82131415620614, 2.39047483002056, 2.54983981868859, 1.82131415620614, 1.66293901218821, 2.01303143580678, 2.01303143580678, 2.73197123430921, 2.12486651557383, 1.06243325778691, 2.24985866354876, 1.12492933177438, 2.94212286771761, 2.24985866354876, 2.54983981868859, 2.12486651557383, 2.94212286771761, 2.24985866354876, 2.39047483002056, 1.91237986401645, 1.91237986401645, 1.4710614338588, 2.24985866354876, 1.82131415620614, 2.73197123430921, 2.73197123430921, 1.59364988668037, 1.41657767704922, 2.12486651557383, 1.91237986401645, 2.39047483002056, 2.39047483002056, 1.52990389121316, 4.78094966004111, 2.39047483002056, 1.12492933177438, 1.82131415620614, 1.19523741501028, 4.24973303114766, 2.54983981868859, 2.24985866354876, 2.01303143580678, 2.54983981868859, 1.23379346065577, 2.54983981868859, 2.01303143580678, 1.59364988668037, 1.66293901218821, 2.12486651557383, 2.94212286771761, 1.73852714910586, 2.12486651557383, 1.91237986401645, 1.23379346065577, 1.59364988668037, 2.12486651557383, 1.82131415620614, 2.73197123430921, 2.94212286771761, 1.91237986401645, 1.73852714910586, 4.78094966004111, 2.54983981868859, 1.73852714910586, 1.82131415620614, 2.54983981868859, 2.01303143580678, 2.94212286771761, 1.19523741501028, 1.82131415620614, 1.31888266483893, 0.889479006519277, 2.54983981868859, 1.31888266483893, 2.73197123430921, 3.18729977336074, 2.24985866354876, 1.91237986401645, 2.39047483002056, 2.39047483002056, 1.73852714910586, 1.41657767704922, 3.18729977336074, 7.64951945606578, 2.73197123430921, 2.94212286771761, 1.59364988668037, 2.01303143580678, 1.73852714910586, 1.82131415620614, 2.73197123430921, 4.78094966004111, 2.73197123430921, 2.73197123430921, 6.37459954672148, 6.37459954672148, 1.52990389121316, 1.31888266483893, 4.78094966004111, 2.12486651557383, 3.82475972803289, 4.24973303114766, 4.78094966004111, 2.73197123430921, 2.73197123430921, 1.66293901218821, 1.4710614338588, 4.78094966004111, 3.47705429821172, 1.31888266483893, 2.94212286771761, 2.12486651557383, 6.37459954672148, 3.47705429821172, 2.01303143580678, 1.73852714910586, 1.73852714910586, 4.24973303114766, 2.94212286771761, 2.94212286771761, 2.73197123430921, 1.91237986401645, 2.39047483002056, 3.82475972803289, 4.24973303114766, 1.82131415620614, 2.39047483002056, 1.66293901218821, 1.66293901218821, 2.54983981868859, 2.54983981868859, 2.73197123430921, 1.31888266483893, 3.18729977336074, 1.66293901218821, 5.46394246861841, 2.24985866354876, 2.73197123430921, 2.39047483002056, 2.12486651557383, 2.54983981868859, 2.73197123430921, 3.18729977336074, 9.56189932008223, 9.56189932008223, 1.73852714910586, 2.24985866354876, 3.82475972803289, 2.24985866354876, 2.12486651557383, 1.3659856171546, 1.2749199093443, 2.73197123430921, 1.73852714910586, 2.12486651557383, 3.47705429821172, 1.73852714910586, 3.18729977336074, 2.39047483002056, 3.18729977336074, 2.73197123430921, 1.82131415620614, 1.66293901218821, 1.3659856171546, 2.54983981868859, 2.12486651557383, 1.59364988668037, 4.24973303114766, 3.47705429821172, 1.3659856171546, 2.94212286771761, 2.39047483002056, 3.18729977336074, 1.52990389121316, 2.94212286771761, 3.47705429821172, 1.73852714910586, 2.12486651557383, 2.24985866354876, 2.39047483002056, 7.64951945606578, 2.73197123430921, 2.54983981868859, 2.24985866354876, 1.52990389121316, 3.18729977336074, 2.54983981868859, 1.52990389121316, 2.54983981868859, 3.18729977336074, 2.94212286771761, 2.54983981868859, 4.24973303114766, 2.94212286771761, 2.54983981868859, 1.00651571790339, 2.39047483002056, 3.82475972803289, 2.73197123430921, 2.54983981868859, 2.24985866354876, 1.59364988668037, 1.4710614338588, 1.91237986401645, 2.24985866354876, 2.94212286771761, 2.73197123430921, 1.82131415620614, 3.18729977336074, 2.24985866354876, 2.54983981868859, 2.24985866354876, 3.47705429821172, 2.73197123430921, 2.39047483002056, 3.18729977336074, 1.66293901218821, 2.73197123430921, 2.94212286771761, 5.46394246861841, 2.01303143580678, 3.47705429821172, 2.94212286771761, 2.54983981868859, 1.91237986401645, 2.39047483002056, 1.91237986401645, 1.73852714910586, 2.24985866354876, 1.59364988668037, 2.01303143580678, 2.39047483002056, 3.18729977336074, 1.66293901218821, 1.59364988668037, 1.91237986401645, 6.37459954672148, 2.94212286771761, 2.39047483002056, 1.91237986401645, 1.91237986401645, 2.39047483002056, 2.54983981868859, 2.73197123430921, 1.73852714910586, 2.54983981868859, 1.73852714910586, 2.24985866354876, 2.39047483002056, 4.24973303114766, 1.31888266483893, 1.41657767704922, 2.54983981868859, 2.73197123430921, 2.54983981868859, 1.91237986401645, 2.54983981868859, 2.94212286771761, 2.54983981868859, 2.24985866354876, 2.12486651557383, 2.54983981868859, 1.73852714910586, 2.24985866354876, 2.94212286771761, 2.94212286771761, 2.94212286771761, 3.47705429821172, 2.54983981868859, 4.24973303114766, 2.54983981868859, 2.73197123430921, 2.24985866354876, 2.73197123430921, 2.94212286771761, 2.94212286771761, 2.73197123430921, 3.47705429821172, 1.23379346065577, 2.24985866354876, 2.54983981868859, 2.94212286771761, 2.54983981868859, 3.18729977336074, 4.24973303114766, 2.39047483002056, 1.19523741501028, 2.24985866354876, 3.82475972803289, 1.91237986401645, 2.01303143580678, 3.82475972803289, 2.12486651557383, 2.24985866354876, 1.73852714910586, 4.24973303114766, 2.39047483002056, 2.12486651557383, 1.82131415620614, 4.24973303114766, 4.78094966004111, 2.01303143580678, 2.24985866354876, 3.18729977336074, 7.64951945606578, 3.82475972803289, 2.94212286771761, 2.39047483002056, 3.18729977336074, 4.24973303114766, 3.82475972803289, 2.12486651557383, 1.66293901218821, 2.24985866354876, 2.39047483002056, 2.01303143580678, 3.82475972803289, 4.78094966004111, 3.47705429821172, 2.24985866354876, 3.18729977336074, 2.12486651557383, 1.73852714910586, 3.47705429821172, 3.47705429821172, 1.66293901218821, 1.66293901218821, 2.39047483002056, 2.24985866354876, 1.82131415620614, 1.66293901218821, 3.47705429821172, 1.82131415620614, 2.39047483002056, 2.01303143580678, 9.56189932008223, 2.24985866354876, 2.39047483002056, 4.24973303114766, 2.39047483002056, 1.73852714910586, 1.41657767704922, 3.18729977336074, 3.47705429821172, 1.73852714910586, 2.54983981868859, 4.24973303114766, 1.59364988668037, 1.41657767704922, 1.91237986401645, 2.94212286771761, 3.47705429821172, 2.24985866354876, 2.94212286771761, 3.82475972803289, 2.12486651557383, 1.73852714910586, 2.12486651557383, 2.39047483002056, 1.52990389121316, 3.47705429821172, 2.12486651557383) gile.wts <- structure(c(2.43439535132526, 2.06264239672522, 2.31958142874284, 1.50939780983865, 2.66306096642275, 1.76806835398565, 1.33981767248718, 1.6334888106475, 3.29341477208004, 3.54002750199834, 1.72845726958708, 1.99073333292842, 1.6334888106475, 1.91460092295191, 1.91460092295191, 2.22446812486855, 1.8947448233209, 2.1468860118508, 1.63052784025235, 2.53508406952916, 1.76806835398565, 1.8207882698508, 2.53508406952916, 2.85945054771878, 1.36476432306482, 1.72845726958708, 2.31958142874284, 1.99073333292842, 2.43439535132526, 2.53508406952916, 1.99073333292842, 1.8947448233209, 2.1468860118508, 2.1468860118508, 2.66306096642275, 2.22446812486855, 1.44759683978263, 2.31958142874284, 1.46381443711093, 2.85945054771878, 2.31958142874284, 2.53508406952916, 2.22446812486855, 2.85945054771878, 2.31958142874284, 2.43439535132526, 2.06264239672522, 2.06264239672522, 1.72845726958708, 2.31958142874284, 1.99073333292842, 2.66306096642275, 2.66306096642275, 1.8207882698508, 1.69033876925473, 2.22446812486855, 2.06264239672522, 2.43439535132526, 2.43439535132526, 1.76806835398565, 4.29821535164131, 2.43439535132526, 1.46381443711093, 1.99073333292842, 1.50939780983865, 3.87047786984813, 2.53508406952916, 2.31958142874284, 2.1468860118508, 2.53508406952916, 1.5627722513722, 2.53508406952916, 2.1468860118508, 1.8207882698508, 1.8947448233209, 2.22446812486855, 2.85945054771878, 1.91460092295191, 2.22446812486855, 2.06264239672522, 1.5627722513722, 1.8207882698508, 2.22446812486855, 1.99073333292842, 2.66306096642275, 2.85945054771878, 2.06264239672522, 1.91460092295191, 4.29821535164131, 2.53508406952916, 1.91460092295191, 1.99073333292842, 2.53508406952916, 2.1468860118508, 2.85945054771878, 1.50939780983865, 1.99073333292842, 1.63052784025235, 1.33981767248718, 2.53508406952916, 1.63052784025235, 2.66306096642275, 3.05443442492895, 2.31958142874284, 2.06264239672522, 2.43439535132526, 2.43439535132526, 1.91460092295191, 1.69033876925473, 3.05443442492895, 6.38455712638357, 2.66306096642275, 2.85945054771878, 1.8207882698508, 2.1468860118508, 1.91460092295191, 1.99073333292842, 2.66306096642275, 4.29821535164131, 2.66306096642275, 2.66306096642275, 5.48896993495661, 5.48896993495661, 1.76806835398565, 1.63052784025235, 4.29821535164131, 2.22446812486855, 3.54002750199834, 3.87047786984813, 4.29821535164131, 2.66306096642275, 2.66306096642275, 1.8947448233209, 1.72845726958708, 4.29821535164131, 3.29341477208004, 1.63052784025235, 2.85945054771878, 2.22446812486855, 5.48896993495661, 3.29341477208004, 2.1468860118508, 1.91460092295191, 1.91460092295191, 3.87047786984813, 2.85945054771878, 2.85945054771878, 2.66306096642275, 2.06264239672522, 2.43439535132526, 3.54002750199834, 3.87047786984813, 1.99073333292842, 2.43439535132526, 1.8947448233209, 1.8947448233209, 2.53508406952916, 2.53508406952916, 2.66306096642275, 1.63052784025235, 3.05443442492895, 1.8947448233209, 4.8604415969412, 2.31958142874284, 2.66306096642275, 2.43439535132526, 2.22446812486855, 2.53508406952916, 2.66306096642275, 3.05443442492895, 8.07852429943211, 8.07852429943211, 1.91460092295191, 2.31958142874284, 3.54002750199834, 2.31958142874284, 2.22446812486855, 1.6334888106475, 1.60534777745125, 2.66306096642275, 1.91460092295191, 2.22446812486855, 3.29341477208004, 1.91460092295191, 3.05443442492895, 2.43439535132526, 3.05443442492895, 2.66306096642275, 1.99073333292842, 1.8947448233209, 1.6334888106475, 2.53508406952916, 2.22446812486855, 1.8207882698508, 3.87047786984813, 3.29341477208004, 1.6334888106475, 2.85945054771878, 2.43439535132526, 3.05443442492895, 1.76806835398565, 2.85945054771878, 3.29341477208004, 1.91460092295191, 2.22446812486855, 2.31958142874284, 2.43439535132526, 6.38455712638357, 2.66306096642275, 2.53508406952916, 2.31958142874284, 1.76806835398565, 3.05443442492895, 2.53508406952916, 1.76806835398565, 2.53508406952916, 3.05443442492895, 2.85945054771878, 2.53508406952916, 3.87047786984813, 2.85945054771878, 2.53508406952916, 1.39907404068377, 2.43439535132526, 3.54002750199834, 2.66306096642275, 2.53508406952916, 2.31958142874284, 1.8207882698508, 1.72845726958708, 2.06264239672522, 2.31958142874284, 2.85945054771878, 2.66306096642275, 1.99073333292842, 3.05443442492895, 2.31958142874284, 2.53508406952916, 2.31958142874284, 3.29341477208004, 2.66306096642275, 2.43439535132526, 3.05443442492895, 1.8947448233209, 2.66306096642275, 2.85945054771878, 4.8604415969412, 2.1468860118508, 3.29341477208004, 2.85945054771878, 2.53508406952916, 2.06264239672522, 2.43439535132526, 2.06264239672522, 1.91460092295191, 2.31958142874284, 1.8207882698508, 2.1468860118508, 2.43439535132526, 3.05443442492895, 1.8947448233209, 1.8207882698508, 2.06264239672522, 5.48896993495661, 2.85945054771878, 2.43439535132526, 2.06264239672522, 2.06264239672522, 2.43439535132526, 2.53508406952916, 2.66306096642275, 1.91460092295191, 2.53508406952916, 1.91460092295191, 2.31958142874284, 2.43439535132526, 3.87047786984813, 1.63052784025235, 1.69033876925473, 2.53508406952916, 2.66306096642275, 2.53508406952916, 2.06264239672522, 2.53508406952916, 2.85945054771878, 2.53508406952916, 2.31958142874284, 2.22446812486855, 2.53508406952916, 1.91460092295191, 2.31958142874284, 2.85945054771878, 2.85945054771878, 2.85945054771878, 3.29341477208004, 2.53508406952916, 3.87047786984813, 2.53508406952916, 2.66306096642275, 2.31958142874284, 2.66306096642275, 2.85945054771878, 2.85945054771878, 2.66306096642275, 3.29341477208004, 1.5627722513722, 2.31958142874284, 2.53508406952916, 2.85945054771878, 2.53508406952916, 3.05443442492895, 3.87047786984813, 2.43439535132526, 1.50939780983865, 2.31958142874284, 3.54002750199834, 2.06264239672522, 2.1468860118508, 3.54002750199834, 2.22446812486855, 2.31958142874284, 1.91460092295191, 3.87047786984813, 2.43439535132526, 2.22446812486855, 1.99073333292842, 3.87047786984813, 4.29821535164131, 2.1468860118508, 2.31958142874284, 3.05443442492895, 6.38455712638357, 3.54002750199834, 2.85945054771878, 2.43439535132526, 3.05443442492895, 3.87047786984813, 3.54002750199834, 2.22446812486855, 1.8947448233209, 2.31958142874284, 2.43439535132526, 2.1468860118508, 3.54002750199834, 4.29821535164131, 3.29341477208004, 2.31958142874284, 3.05443442492895, 2.22446812486855, 1.91460092295191, 3.29341477208004, 3.29341477208004, 1.8947448233209, 1.8947448233209, 2.43439535132526, 2.31958142874284, 1.99073333292842, 1.8947448233209, 3.29341477208004, 1.99073333292842, 2.43439535132526, 2.1468860118508, 8.07852429943211, 2.31958142874284, 2.43439535132526, 3.87047786984813, 2.43439535132526, 1.91460092295191, 1.69033876925473, 3.05443442492895, 3.29341477208004, 1.91460092295191, 2.53508406952916, 3.87047786984813, 1.8207882698508, 1.69033876925473, 2.06264239672522, 2.85945054771878, 3.29341477208004, 2.31958142874284, 2.85945054771878, 3.54002750199834, 2.22446812486855, 1.91460092295191, 2.22446812486855, 2.43439535132526, 1.76806835398565, 3.29341477208004, 2.22446812486855), N = 1000, estimateN = 1000) expect_equal(compute.weights(faux,"RDS-I",outcome.variable="X",N=1000), rdsi.wts) expect_equal(compute.weights(faux,"RDS-I (DS)",outcome.variable="X",N=1000), rdsids.wts) expect_equal(compute.weights(faux,"RDS-II",N=1000), rdsii.wts) set.seed(1) g <- compute.weights( faux, "Gile's SS", N=1000, number.ss.samples.per.iteration = 1000, number.ss.iterations = 5) s <- mean(abs(g-gile.wts)) expect_true(s<.02) }) test_that("hcg.weights",{ data(fauxtime) hcg.weights(fauxtime,"var1",N=3000) f2 <- fauxtime f2$NETWORK[c(1,100,40,82,77)] <- NA expect_warning(hcg.weights(f2,"var1",N=3000)) f2 <- fauxtime f2$var1[c(1,100,40,82,77)] <- NA hcg.weights(f2,"var1",N=3000) })