boundedregressionestimator     package:sampling     R Documentation

_g-_w_e_i_g_h_t_s _o_f _t_h_e _r_e_g_r_e_s_s_i_o_n _e_s_t_i_m_a_t_o_r

_D_e_s_c_r_i_p_t_i_o_n:

     Compute the g-weights of the regression estimator.  The g-weights
     should lie in the specified bounds.

_U_s_a_g_e:

     boundedregressionestimator(Xs,piks,t,q=rep(1,times=length(piks)),LOW=0,UP=10)

_A_r_g_u_m_e_n_t_s:

      Xs: matrix of calibration variables.

    piks: vector of inclusion probabilities.

       t: vector of population totals.

       q: vector of weights for the distance. The variation of the
          g-weights is reduced for the small values of q. When a
          component of q is null, the corresponding g-weight remains
          equal to 1.

     LOW: smallest value for the g-weights.

      UP: largest value for the g-weights.

_R_e_f_e_r_e_n_c_e_s:

     Cassel, C.-M., Srndal, C.-E., and Wretman, J. (1976). Some
     results on generalized difference estimation and generalized
     regression estimation for finite population._Biometrika_,
     63:615-620. 
      Deville, J.-C. and Sarndal, C.-E. (1992). Calibration estimators
     in survey sampling. _Journal of the American Statistical
     Association_, 87:376-382.
      Deville, J.-C., Srndal, C.-E., and Sautory, O. (1993).
     Generalized raking procedure in survey sampling. _Journal of the
     American Statistical Association_, 88:1013-1020.

_S_e_e _A_l_s_o:

     'rakingratio', 'boundedregressionestimator',
     'regressionestimator', 'checkcalibration'

_E_x_a_m_p_l_e_s:

     ############
     ## Example 1
     ############
     # matrix of auxiliary variables
     Xs=cbind(
     c(1,1,1,1,1,0,0,0,0,0),
     c(0,0,0,0,0,1,1,1,1,1),
     c(1,2,3,4,5,6,7,8,9,10)
     )
     # inclusion probabilities
     piks=rep(0.2,times=10)
     # vector of totals
     t=c(24,26,290)
     # the Horvitz-Thompson estimator
     tHT=t(1/piks)%*%Xs
     # the g-weights
     g=boundedregressionestimator(Xs,piks,t,LOW=0.75,UP=1.2)
     # the regression estimator is equal to t
     tcal=t(g/piks)%*%Xs
     # the g-weights are between LOW and UP bounds
     g
     ############
     ## Example 2
     ############
     # Example of rakingratio, regresssion, boundedregression and boundedrakingratio estimators,
     # with the data of Belgian municipalities.
     # Firstly, a sample is selected by means of Poisson sampling.
     # Secondly, the g-weights and the calibration estimators are calculated.
     # the database of Belgian municipalities
     data(belgianmunicipalities)
     attach(belgianmunicipalities)
     X=cbind(
     Men03/mean(Men03),
     Women03/mean(Women03),
     Diffmen,
     Diffwom,
     TaxableIncome/mean(TaxableIncome),
     Totaltaxation/mean(Totaltaxation),
     averageincome/mean(averageincome),
     medianincome/mean(medianincome))
     # selection of a sample with expectation size equal to 200
     # by means of Poisson sampling
     # the inclusion probabilities are proportional to the average income 
     pik=inclusionprobabilities(averageincome,200)
     N=length(pik)               # population size
     s=UPpoisson(pik)            # sample
     Xs=X[s==1,]                 # matrix of calibration variables of the sample
     piks=pik[s==1]              # inclusion probabilities of the sample
     n=length(piks)              # sample size
     # vector of population totals of the auxiliary variables
     t=c(t(rep(1,times=N))%*%X)  
     # The Horvitz-Thompson estimators of auxiliary variables 
     c((1/piks) %*% Xs)
     # The true total 
     t
     # Computation of the g-weights
     # by means of different calibration methods.
     g1=regressionestimator(Xs,piks,t)
     g2=rakingratio(Xs,piks,t)
     g3=boundedregressionestimator(Xs,piks,t,LOW=0.5,UP=1.5)
     g4=boundedrakingratio(Xs,piks,t,LOW=0.5,UP=1.5)
     # In some cases, the calibration does not exist
     # particularly when bounds are used.
     # If the calibration is possible, the calibration estimators are the following
     if(checkcalibration(Xs,piks,t,g1)) c((g1/piks) %*% Xs) else print("error")
     if(checkcalibration(Xs,piks,t,g2)) c((g2/piks) %*% Xs) else print("error")
     if(checkcalibration(Xs,piks,t,g3)) c((g3/piks) %*% Xs) else print("error")
     if(checkcalibration(Xs,piks,t,g4)) c((g4/piks) %*% Xs) else print("error")

