R/cdata.wgtrep.R

Defines functions cdata.wgtrep

## File Name: cdata.wgtrep.R
## File Version: 0.05

############################################
# BIFIEcdata format for replicate weights
cdata.wgtrep <- function( wgtrep ){
    N <- nrow(wgtrep)
    RR <- ncol(wgtrep)
    longwgtrep <- matrix( wgtrep, nrow=N*RR, ncol=1 )
    unique_wgt <- sort( unique( longwgtrep ) )
    indexwgtrep <- match( longwgtrep, unique_wgt )
    indexwgtrep <- matrix( indexwgtrep, nrow=N, ncol=RR )
    # list with compactly saved replicate weights
    wgtrep_list <- list( "unique_wgt"=unique_wgt, "indexwgtrep"=indexwgtrep )
    return(wgtrep_list)
        }

Try the BIFIEsurvey package in your browser

Any scripts or data that you put into this service are public.

BIFIEsurvey documentation built on April 5, 2022, 1:14 a.m.