Learn R Programming

optimStrat (version 2.0)

gk: Computes the gk

Description

Compute the values of the function gk.

Usage

gk(x, Beta21, Beta22)

Arguments

x

a matrix or data.frame giving the values of the auxiliary variables.

Beta21

a numeric vector of length equal to the number of variables in x giving the coefficients of the spread term in the true superpopulation model (see ‘Details’).

Beta22

a numeric vector of length equal to the number of variables in x giving the exponents of the spread term in the true superpopulation model (see ‘Details’).

Value

A numeric vector giving the values of the function.

Details

Compute the values of $$g(x_{k}|\beta) = \sum_{j=1}^{J}\beta_{2,j}x_{jk}^{\beta_{2,J+j}}$$

The coefficients \(\beta_{2,j}\) (\(j=1,\cdots,J\)) are given by Beta21. The exponents \(\beta_{2,j}\) (\(j=J+1,\cdots,2J\)) are given by Beta22.

Examples

Run this code
# NOT RUN {
x1<- 1 + sort( rgamma(5000, shape=4/9, scale=108) )
x2<- 1 + sort( rgamma(5000, shape=4/9, scale=108) )
x3<- 1 + sort( rgamma(5000, shape=4/9, scale=108) )
x<- cbind(x1,x2,x3)
gk(x,Beta21=c(1,2,-1),Beta22=c(1,0.75,0.5))
# }

Run the code above in your browser using DataLab