File: ratioest.r

package info (click to toggle)
r-cran-sampling 2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,336 kB
  • sloc: ansic: 21; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 423 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)
}