R/ratioest.r

Defines functions ratioest

Documented in ratioest

ratioest<-function(y,x,Tx,pik)
{if (any(is.na(pik))) 
        stop("there are missing values in pik")
    if (any(is.na(y))) 
        stop("there are missing values in y")
    if (any(is.na(x))) 
        stop("there are missing values in x")
    if (length(y) != length(pik) | length(x)!=length(pik) | length(x)!=length(y)) 
        stop("y, x and pik have different lengths")
    sum(y/pik)*Tx/sum(x/pik)
}

Try the sampling package in your browser

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

sampling documentation built on Nov. 2, 2023, 6:26 p.m.