
\documentclass{beamer}
\input{bepackage}
\usepackage{color}

% Define the footline template to display the authors' names on the right side
\setbeamertemplate{footline}{%
  \hfill%
  \scriptsize{\insertauthor}%
  \hspace*{0.5cm}%
  \insertframenumber/\inserttotalframenumber%
  \hspace*{0.5cm}%
}


% Title, subtitle, and other information
\title{Stat472/572 Sampling: Theory and Practice}
%\subtitle{Slides are intended for a course based on the book: \textit{Sampling: Design and Analysis, Third Edition} by Sharon L. Lohr}
\author[Yan Lu]{Instructor: Yan Lu}
\institute[UNM]{University of New Mexico}
\date{}

% Declare the logo
\pgfdeclareimage[height=2.0cm]{logoUNM}{./plots/unmlog} 

% Begin the document
\begin{document}

% Set bullet and enumeration styles
\setbeamertemplate{itemize items}[triangle]
\setbeamertemplate{itemize subitem}[square]
\setbeamertemplate{itemize subsubitem}[circle]
\setbeamertemplate{enumerate items}[default]
\setbeamertemplate{enumerate subitem}[square]
\setbeamertemplate{enumerate subsubitem}[circle]

% Set captions to be numbered
\setbeamertemplate{caption}[numbered]

% Title slide
\begin{frame}[plain] % Use plain to remove header/footer on the title slide
    \titlepage
    \vspace{-1cm} % Add space between the title page and chapter information
    \centering
    \textbf{\Large Chapter 4: Ratio and Regression Estimation} % Emphasize chapter title

      % Adjusted Logo Position
    \begin{textblock*}{2.0cm}(0.0cm,-3.5cm) % Move slightly left and down to fit on the slide
        \pgfuseimage{logoUNM}
    \end{textblock*}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Chapter 4}
\begin{frame}
{\bf Ratio Estimation}

Two quantities $y_i$ and $x_i$ are measured on each sample
unit
\bi
\item $y_i$: response variable, $x_i$: auxiliary variable, or subsidiary variable
\item Let $t_y = \sum\limits_{i=1}^N y_i$ and $t_x =
\sum\limits_{i=1}^N
x_i$ and their ratio be $$B= \ds\frac{t_y}{t_x} =\ds\frac{\bar
y_U}{\bar x_U}$$
\ei
Example 4.1: Suppose the population consists of
agricultural fields of different sizes. Let\\
 $y_i$ = bushels of
grain
harvested in field $i$\\
 $x_i$ = acreage of field $i$\\
  then $B$ = average
yield in bushels per acre\\
$\bar y_U$ = average yield in bushels per field \\
$t_y$ = total yield in bushels
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
 If an SRS is taken, natural estimators for $B, t_y$, and $\bar
y_U$ are: $$\hat B
 =\ds\frac {\bar y}{\bar x}, \quad \hat t_{yr} = \hat B t_x \quad \hat{\bar y}_r =\hat B \bar
 x_U$$
\bi
\item Ratio estimation take advantage of the correlation of $x$ and
$y$ in the population; the higher the correlation, the better they
work. Define the population correlation coefficient of $x$ and $y$
 be
$$R = \ds\frac{\sum\limits_{i=1}^N (x_i - \bar x_U) (y_i - \bar
y_U)}{(N-1) S_x S_y}$$

---- $S_x$ is the population standard deviation of the $x_i$'s\\
---- $S_y$ is the population standard deviation of the $y_i$'s\\
---- $R$ is simply the pearson correlation coefficient of $x$ and $y$ for
the $N$ units 
\ei

\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
 Why use ratio estimation?
 \bi
 \item[1.] Want to estimate a ratio\\
{\large Example: interested in the percentage of pages in Good
Housekeeping
 magazines that contain at least one advertisement
\item Take an SRS of 10 issues
\item let $x_i$ be the total number of pages in issue $i$
\item let $y_i$ be the total number of pages in issue $i$ that
contain at least one advertisement \item $\hat B
=\ds\frac{\sum\limits_{i \in S} y_i}{\sum\limits_{i\in S} x_i}$}
\ei
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\bi
\item[2.] Want to estimate a population total, but population size $N$
is unknown
\item $\hat t_y = N \bar y$, but $N$ is unknown
\item $N= \ds\frac {t_x}{\bar x_U}$
\item $\hat t_y =\ds\frac{t_x}{\bar x_U} \bar y$
\item $\hat t_{yr} = \ds\frac{t_x}{\bar x} \bar y = \ds\frac{\bar y}{\bar x} t_x = \hat B t_x$
\ei
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Example:} Apple Juice

For a juice company, the price they are paid for apples in large
shipments is based on the amount of apple juice from the load.
\bi
\item Need to determine the amount of apple juice in the whole load prior
to extraction.
\item  We can sample $n$ apples and find $y_1, \cdots
y_n$, the amount of apple juice in those apples.
\item $N \bar y$ is
hard to get in this case because $N$ is hard to count. But total weight of apple is easy to get. \\
-----use the relationship between weight of the load and
weight of the apple juice one obtains\\
-----let $x$ be the weight of each apple in the sample, $\bar x$ is the
average weight of each apple in the sample.\\
-----number of apples is estimated by $t_x/\bar x$

The total weight $t_x$ is easy to get for the entire shipment. We
can thus estimate the total apple juice by:

$$\hat t_{yr} = \ds\frac {\bar y}{\bar x} t_x$$
\ei
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Example:} Want to estimate the total \# of fish in a haul that are
longer than 12 cm
\bi
\item Take an SRS, estimate the proportion and multiply
by the total \# of fish $N$. But $N$ is unknown
\item Take an SRS, consider the fact that having a length of more than 12 cm ($y$)
is related to weight ($x$), introduce an auxiliary variable $x_i$:
weight of fish
\item $y_i$: fishes longer than 12cm, \\
$x_i$: weight of fish, \\
$t_x$: total weight of
haul, \\
$t_y =?$
\item $\hat t_{yr} = \hat B t_x= \ds\frac {\bar y}{\bar x} t_x$
\ei
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\bi
\item[3.] Ratio estimation is often used to increase the precision of estimated means and
totals\\
Let $y_i$ be the \# of persons in commune $i$\\
and $x_i$ be the \# of registered births in commune $i$\\
want to estimate \# of persons in France
\item Randomly select 30 communes
\item Estimator 1 = $N \bar y = \ds\frac{t_x}{\bar x_U} \bar y$ \\
\# of communes in France $*$ average number of persons in the
30 communes
\item Estimator 2= $\hat B t_x =\ds\frac{\bar y}{\bar x} t_x = \ds\frac
 {t_x}{\bar x} \bar y$
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

\bi
\item When $\bar y$ and $\bar x$ are positively correlated, the sampling distribution of $\ds\frac{\bar y}{\bar x}$ exhibits less variability compared to the sampling distribution of $\ds\frac{\bar y}{\bar x_U}$.  
\item Consequently, the ratio estimator (Estimator 2) has a smaller Mean Squared Error (MSE), i.e., $\text{MSE}(\text{Estimator 2}) < \text{MSE}(\text{Estimator 1})$.
\ei

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{frame}
\bi
\item[4.] Adjust estimators from the sample so that they reflect demographic totals.\\
{\bf Example:} An SRS of 400 students is taken at a university with a total of 4,000 students.  
The sample contains:
\bi
\item 240 women and 160 men  
\item 84 women and 40 men in the sample plan to pursue careers in teaching  
\ei
We aim to estimate the total number of students who plan to become teachers.
\item Estimator 1: Using only the information from the SRS,
$$N\bar y = 4000 \times \ds\frac{124}{400} = 1240$$
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\bi
\item Estimator 2: Incorporating demographic information (college has 2,700 women and 1,300 men), a better estimate is:
$$\ds\frac{84}{240} \times 2700 + \ds\frac{40}{160} \times 1300 = 1270$$
\item Highlights:
\bi
\item Ratio estimation is applied within each gender.
\item In the sample, 60\% are women, but women comprise 67.5\% of the population. The estimator is adjusted accordingly to better reflect the demographic proportions.
\ei
\ei
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\bi
 \item[5.] Adjust for nonresponse\\
 Example: a sample of businesses, \\
 $y_i$: amount spent on health insurance by
 business $i$\\
 $x_i$: number of employees in business $i$, $x_i$ known\\
 want to estimate total insurance expenditures
 \item Estimator 1: $N \bar y$\\
 ---companies with few employees are less likely
 to respond to the survey\\
 ---$y_i$ is proportional to $x_i$\\
 ---Estimator 1 overestimate the total insurance expenditures $t_y$
 \item Estimate 2: $t_x \ds\frac{\bar y}{\bar x}$\\
 --- $\ds\frac{t_x}{\bar
 x}<N$, since companies with many employees are more likely to respond to
 the survey\\
 ---Thus a ratio estimate of total heath care insurance expenditures
 may help to compensate for the nonresponse of companies with few
 employees
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Example 4.2}
\bi
\item Dataset: SRS of $n = 300$ counties selected from a total of $N = 3078$ counties (U.S. Census of Agriculture, file \texttt{agsrs.dat}).  
\item Context:  
\bi
\item Total acreage for 1987 is known.  
\item 1992 acreage data is only available for the sampled 300 counties.  
\item Goal: Estimate the population total $\hat{t}_y$ and mean $\hat{\bar{y}}$ for 1992.
\ei
\item Estimate 1: Using only the SRS data from 1992,  
$$\hat{t}_{y,\text{srs}} = N \bar{y} = 3078 \cdot \bar{y} = 916,927,110$$
\ei
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{figure}[!htp]
       \centering
       \includegraphics[width=0.90\textwidth,
       height=0.8\textheight]{./plots/acres8792.jpg}
\caption{A scatter plot of 1992 acreage (y-axis) against 1987 acreage (x-axis) for a simple random sample (SRS) of 300 counties. }
       \label{fig:acreage92vs87}
     \end{figure}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
As shown in Figure \ref{fig:acreage92vs87}, the line of best fit passes through the origin with a slope of $\hat{b} = 0.9866$, demonstrating a strong positive correlation between 1992 and 1987 acreages. We will now apply ratio estimation using 1987 acreage as an auxiliary variable.
\bi
 \item Estimate 2: ratio estimation\\
---$y_i$ = total acreage of farms in county $i$ in 1992\\
---$x_i$ = total acreage of farms in county $i$ in 1987\\
---For 1987, $t_x = 964,470,625$, $\bar x_U = 964,470,625/3078 = 313343.3$\\
---$$\hat B =\ds\frac{\bar y}{\bar x} = \ds\frac{297897.0467}{301953.7233}
 =.986565$$
 $$\hat{\bar y}_r = \hat B \bar x_U =309,133.6$$
 $$\hat t_{yr} = \hat B t_x = .986565\times 964470625 = 951,513,191$$
\ei
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}

{\bf Comments:}
\bi
\item When the same quantity is measured at different times, the response 
of interest at an earlier time often serves as an excellent auxiliary variable.
\item The sample mean $\bar x$ is slightly smaller than the true population mean $\bar x_U$, indicating that the SRS of size 300 slightly underestimates the true population mean of the $x$'s.
\item Since $x$ and $y$ are positively correlated, it is reasonable to expect that $\bar y$ may also underestimate the true population mean $\bar y_U$.
\item Ratio estimation improves the precision of $\bar y_U$ by adjusting $\bar y$ with the factor $\bar x_U / \bar x$.
\ei
\end{frame}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}

{\bf Properties of Ratio Estimators} 
\bi
\item For an SRS, $\bar y$ is unbiased:\\
--- If we calculate $\bar y_S$ for every possible sample, the average of all the sample means will equal the population mean $\bar y_U$.
\item For the ratio estimator, $\hat{\bar y}_r = \ds\frac{\bar y}{\bar x} \bar x_U$:\\
--- The bias of the ratio estimator arises because $\bar y$ is adjusted by the factor $\bar x_U / \bar x$.\\
--- If we compute $\hat{\bar y}_r$ for all possible samples, the average of these estimates will generally be close to $\bar y_U$, but not exactly equal to it.
\item For large samples, the sampling distributions of both $\bar y$ and $\hat{\bar y}_r$ are approximately normal.
\item Ratio estimators are biased but typically have smaller variance compared to $\bar y$.
\ei
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\normalsize Bias of $\hat B$
\begin{eqnarray*}
\mbox{Bias}[\hat B] & =& E[\hat B] -B = E\left[\ds\frac{\bar y}{\bar x} - \ds\frac{\bar y_U}{\bar x_U}\right]\\
&=& E\left[\ds\frac{\bar y}{\bar x_U} \times \ds\frac {\bar
x_U}{\bar x}
-\ds\frac{\bar y_U}{\bar x_U}\right]\\
&=& E\left[\ds\frac{\bar y}{\bar x_U} \times \left(1-\ds\frac {\bar
x - \bar
x_U}{\bar x}\right) -\ds\frac{\bar y_U}{\bar x_U}\right]\\
&=& -E\left[\ds\frac{\bar
y(\bar x - \bar x_U)}{\bar x_U \bar x}\right]\\
& \vdots&\\
 &\approx & \ds\frac 1 {\bar x_U^2} [B V(\bar x) -\mbox{Cov}(\bar x,
\bar
y)]\\
 &=& \left(1-\ds\frac n N\right)\ds\frac 1 {n \bar x_U^2} (B S_x^2 -R S_x
S_y)
\end{eqnarray*}
where $ R$ is the correlation between $x$ and $y$.}
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}

\begin{align*}
\text{Bias}[\hat{\bar y}_r] &= E[\hat{\bar y}_r - \bar{y}_U] \\
&= E[\hat{B} \bar{x}_U - B \bar{x}_U] \\
&= \bar{x}_U E[\hat{B} - B] \\
&\approx \frac{1}{\bar{x}_U} \left[B V(\bar{x}) - \text{Cov}(\bar{x}, \bar{y})\right] \\
&= \left(1 - \frac{n}{N}\right) \frac{1}{n \bar{x}_U} \left(B S_x^2 - R S_x S_y\right)
\end{align*}

{\bf Bias of $\hat{\bar y}_r$ is small if:}
\bi
\item The sample size $n$ is large.
\item The sampling fraction $n/N$ is large.
\item The standard deviation $S_x$ is small.
\item The correlation $R$ is close to 1.\\
{\bf Note:} If all $x$ values are identical ($S_x = 0$), the ratio estimator becomes equivalent to the SRS estimator $\bar{y}$, and the bias is zero.
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf MSE of $\hat B$}
{\scriptsize
\begin{eqnarray*}
E[(\hat B -B)^2] &=& E\left[\left(\ds\frac{\bar y}{\bar x} -B \ds\frac{\bar
x}{\bar x}\right)^2\right]\\
&=& E\left[\left(\ds\frac{\bar y -B \bar x}{\bar x}\right)^2\right]\\
&=& E\left[\left(\ds\frac{\bar y - B \bar x }{\bar x_U}\right)\left(1-\ds\frac{\bar
x-\bar x_U}{\bar x}\right)\right]^2\\
&=& E\left[\left(\ds\frac{\bar y - B \bar x}{\bar x_U}\right)^2  + \left(\ds\frac{\bar y
- B \bar x}{\bar x_U}\right)^2 
\times \left(-2 \ds\frac{\bar x -\bar x_U}{\bar x} + \left(\ds\frac{\bar
x-\bar
x_U}{\bar x}\right)^2\right)\right]\\
&\approx & E\left[\left(\ds\frac{\bar y- B\bar x}{\bar x_U}\right)^2\right]\\
&=& \ds\frac 1 {\bar x_U^2} E[(\bar y -B\bar x)^2]
\end{eqnarray*}
where the approximation is from the fact that the second and third
term is negligible relative to the first term.}
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\normalsize
Let
\bi 
\item $d_i = y_i -B x_i$
\item $e_i =\hat d_i = y_i -\hat B x_i$
\item $\bar d = \bar y- B\bar x$
\ei
\begin{eqnarray*}
 MSE(\hat B) &\approx &\ds\frac 1 {\bar x_U^2} E[(\bar y -B\bar
x)^2]\\
&=& \ds\frac 1 {\bar x_U^2} E\left[\ds\frac 1 n \sum\limits_{i\in S} (y_i
-B x_i)\right]^2\\
&=& \ds\frac 1 {\bar x_U^2} V(\bar d)\\
&=& \ds\frac 1 {\bar x_U^2} \left(1-\ds\frac n N\right)\ds\frac{S_d^2}{n}
\end{eqnarray*}
 So
$$\widehat{MSE} (\hat B) \approx \ds\frac 1 {\bar x^2} \left(1-\ds\frac n
N\right)\ds\frac{s_e^2}n$$}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Variance of $\hat B$}

 In large sample, bias of $\hat B$ is
typically small relative to $V(\hat B)$, $MSE(\hat B) \approx V(\hat
B)$
$$V(\hat B) \approx \ds\frac 1 {\bar x_U^2} \left(1-\ds\frac n
N\right)\ds\frac{S_d^2}n$$
$$\hat V(\hat B) \approx \ds\frac 1 {\bar x^2} \left(1-\ds\frac n
N\right)\ds\frac{s_e^2}n$$
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Variance of $\hat{\bar y}_r$}

\begin{eqnarray*}
\hat V(\hat {\bar y}_r) &=& \bar x_U^2 \hat V(\hat B)\\
&\approx& \left(1-\ds\frac n N\right) \ds\frac{s_e^2}n
\end{eqnarray*}
Variance of $\hat V(\hat {\bar y}_r)$ is small if
\bi
\item the sample size $n$ is large
\item the sampling fraction $n/N$ is large
\item the deviations $y_i - Bx_i$ are small
\item the correlation $R$ is close to 1
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Compare ratio estimator to SRS estimator}

$$V(\hat {\bar y}_r)
\approx\left(1-\ds\frac n N\right) \ds\frac{S_d^2}n$$
 $$V(\bar y_{srs}) =
\left(1-\ds\frac n N\right)\ds\frac{S_y^2} n$$ If
$S_d^2 < S_y^2$ then $V(\hat {\bar y}_r)<V(\bar y_{srs})$, ratio estimation is more efficient
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\small
\begin{eqnarray*}
(N-1) S_d^2 &=& \sum_{i=1}^{N} (y_i - B x_i)^2 \\
&=& \sum_{i=1}^{N} \left( (y_i - \bar y_U) + (\bar y_U - B x_i) \right)^2 \\
&=& \sum_{i=1}^{N} (y_i - \bar y_U)^2 + \sum_{i=1}^{N} \left( B \bar x_U - B x_i \right)^2 \\
& & + 2 \sum_{i=1}^{N} (y_i - \bar y_U)(B \bar x_U - B x_i) \\
&=& (N-1) S_y^2 + (N-1) B^2 S_x^2 \\
& & - 2 (N-1) B R S_x S_y
\end{eqnarray*}
Where $R$ is the population correlation coefficient, defined as:
$$ R = \frac{\sum_{i=1}^{N} (x_i - \bar x_U)(y_i - \bar y_U)}{(N-1) S_x S_y} $$
}
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}

{\small
\begin{eqnarray*}
V(\hat {\bar y}_r) &\approx& \left( 1 - \frac{n}{N} \right) \frac{1}{n} \ds\frac{\sum_{i=1}^{N} (y_i - B x_i)^2}{N-1} \\
&=& \left( 1 - \frac{n}{N} \right) \frac{1}{n} \left( S_y^2 + B^2 S_x^2 - 2 B R S_x S_y \right)
\end{eqnarray*}

The variance for the simple random sample (SRS) estimator is given by:
$$V(\bar y_{srs}) = \left( 1 - \frac{n}{N} \right) \frac{S_y^2}{n}$$

Ratio estimation is more efficient when:
$$ S_y^2 + B^2 S_x^2 - 2 B R S_x S_y < S_y^2 $$

This simplifies to:
$$ B^2 S_x^2 < 2 B R S_x S_y, \quad B S_x < 2 R S_y $$

Or equivalently:
$$ \frac{\bar y_U}{\bar x_U} S_x < 2 R S_y, \quad \frac{S_x}{\bar x_U} < 2 R \frac{S_y}{\bar y_U} $$

}
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}

Thus, for ratio estimation to be more efficient:
$$ R > \frac{\frac{S_x}{\bar x_U}}{2 \frac{S_y}{\bar y_U}} = \frac{\mbox{CV}(\bar x)}{2 \mbox{CV}(\bar y)} $$
\bi
\item $ \mbox{CV}(\bar y) = \frac{Sd(\bar y)}{\bar y_U} $
\item $ \mbox{CV}(\bar x) = \frac{Sd(\bar x)}{\bar x_U} $
\item The absolute values of $\mbox{CV}(\bar x)$ and $\mbox{CV}(\bar y)$ often do not make a significant difference.
\ei
As a result, {\bf Ratio estimation is more efficient than an SRS when}:
$$ R > \frac{1}{2} $$
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Examples 4.2 and 4.3 (using R handout 4)}
\bi
\item Ratio estimator\\
---$y_i$ = total acreage of farms in county $i$ in 1992\\
---$x_i$ = total acreage of farms in county $i$ in 1987\\
---For 1987, $t_x = 963,464,412$\\
---$$\hat B =\ds\frac{\bar y}{\bar x} = \ds\frac{297897.0467}{301953.7233}
 =.986565, \mbox{ and } R = 0.995806$$
$$\hat t_{yr} = \hat B t_x = .986565\times 963,464,412 =  950,520,496$$
$$\mbox{SE} (\hat t_{yr}) = 5,540,376$$
\item SRS estimator\\
$\hat t_y= N \bar y =  3078*297897.0467 = 916,927,110$\\
$\mbox{SE}(\hat t_y)= 58,169,381$, this is almost 10 times as large
as the SE from ratio estimation ($\mbox{SE} (\hat t_{yr}) =5,540,376$)
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\bi
\item Coefficient of Variation (CV) comparison\\
Recall, Coefficient of Variation (CV)\\
when $\bar y_U \neq 0$,
$$CV(\bar y) = \ds\frac{\sqrt{V(\bar y)}}{E(\bar y)}, \quad \widehat {CV}(\bar y) = \ds\frac{\mbox{SE}(\bar y)}{\bar y} $$
----Measure of relative variability\\
----Does not depend on the unit of measurement\\
----$CV(\hat t) =  CV(\bar y)$\\
----If the CV of $\bar y$ is small, that is, if $\bar y_U$ is estimated with high
relative precision, the bias is small relative to the square root of
the variance.\\
---- A small $CV(\bar y)$ also means that $\bar y$ is stable from sample to
sample.
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

\begin{table}
\caption{Comparisons of ratio estimator and SRS estimator } \begin{tabular}{ccc} \hline & Ratio estimation
&SRS estimation\\
\hline
SE of $\hat t$ & 5,540,376 & 58,169,381\\
\hline
Estimated CV & $\ds\frac{5,540,376}{950,520,496} = 0.0058$ &
$\ds\frac{58,169,381}{916,927,110}=0.0634$\\
\hline
\end{tabular}
\end{table}

\bi
\item Incorporating the 1987 data through the ratio estimator has significantly increased precision.
\item If all quantities to be estimated are highly correlated with the 1987 acreage, using ratio estimators instead of $N \bar y$ could substantially reduce the sample size while maintaining high precision.
\ei

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
{\bf Regression Estimation in Simple Random Sampling}

{\bf Review: Regression Analysis}

A nutritionist aims to explore the relationship between age and muscle mass in women. It is hypothesized that muscle mass decreases with age. To investigate this, she randomly selects 15 women from each 10-year age group, starting from age 40 and ending at age 79, for a total of 60 women.


\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{figure}[!htp]
    \centering
    \includegraphics[width=0.90\textwidth, height=0.8\textheight]{./plots/statrelation2.jpg}
    \caption{Age vs. Muscle Mass in Women with fitted regression line} 
    \label{archers}
     \vspace{-0.1in}
\end{figure}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Normal error regression model:}
$$Y_i = \beta_0 +\beta_1 X_i +\epsilon_i$$
\bi
\item $Y_i$: response of the $i$th trial
\item $X_i$: a known constant, the level of the predictor variable
in the $i$th trial
\item $\beta_0$ and $\beta_1$: parameters
\item $\epsilon_i \stackrel{iid}{\sim} N(0, \sigma^2)$ for $i = 1, 2, \cdots, n$
\item $E(Y_i) = \beta_0 +\beta_1 X_i$
\ei
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Least square estimators:}


\bi
\item Consider the deviation of $Y_i$ from
its expected value $$[Y_i - (\beta_0 + \beta_1 X_i)]$$
\item Least Square Measures:
$$Q= \sum\limits_{i =1}^n (Y_i -(\beta_0 +\beta_1 X_i))^2$$
\item Objective: to find estimators $b_0$ and $b_1$ for $\beta_0$ and
$\beta_1$ respectively, for which $Q$ is minimum
\item $$b_0 = \hat \beta_0 =\bar y - b_1 \bar x$$
 $$b_1 = \hat \beta_1  =
\ds\frac{\sum\limits_{i=1}^{i=n} (x_i-\bar x)(y_i -\bar
y)}{\sum\limits_{i=1}^{i=n}(x_i-\bar x)^2}$$
\item Regression line: $\widehat{E(Y)} = b_0 + b_1 X$
\ei


\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Regression in Simple Random Sampling (SRS)}

Want to estimate population mean and population total\\
Assumptions:
\bi
\item The relationship between $E(y)$ and $x$ is a
straight line  $$E(y) = B_0 + B_1x$$
\item The population mean of $x$'s,
$\bar x_U$ is known
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

\begin{tabular}{cc}
\hline
Population quantities & Estimators\\
\hline
$B_1 = \ds\frac{\sum\limits_{i=1}^N (x_i-\bar x_U)(y_i -\bar
y_U)}{\sum\limits_{i=1}^N(x_i-\bar x_U)^2}$ & $\hat B_1 =
\ds\frac{\sum\limits_{i\in S} (x_i-\bar x)(y_i -\bar
y)}{\sum\limits_{i\in S}(x_i-\bar x)^2}$\\
\hline
$B_0 =\bar y_U -B_1 \bar x_U$ & $\hat B_0 =\bar y -\hat B_1 \bar
x$\\
\hline
\end{tabular}

\bi
\item $B_1$ and $B_0$ are the least squares regression slope and intercept calculated from
all the data in the population respectively
\item The regression estimator of $\bar y_U$ is
\begin{eqnarray*}
\hat {\bar y}_{\mbox{reg}} &= & \hat B_0 +\hat B_1 \bar x_U\\
&=& \bar y -\hat B_1 \bar x + \hat B_1 \bar x_U\\
&=& \bar y + \hat B_1 (\bar x_U -\bar x)
\end{eqnarray*}
\ei
 
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Properties of the Estimators}

Notation
\bi
\item $d_i = y_i - (B_0 + B_1 x_i)$
\item $e_i = y_i - (\hat B_0 + \hat B_1 x_i)$ called residuals
\item $R =\ds\frac{\sum\limits_{i=1}^N (x_i -\bar x_U)(y_i-\bar
y_U)}{(N-1) S_x S_y}$, population correlation coefficient of $x$ and
$y$
\ei
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Bias of $\hat {\bar y}_{\mbox{reg}}$}
$$\mbox{bias}(\hat{\bar y}_{\mbox{reg}}) = -\mbox{cov} (\hat B_1,\bar x)$$
Proof:
\begin{eqnarray*}
\mbox{Bias}(\hat{\bar y}_{\mbox{reg}}) &=&E[\hat{\bar
y}_{\mbox{reg}} -
\bar y_U]\\
&=& E[\hat B_0 +\hat B_1 \bar x_U -\bar y_U]\\
&=& E[\bar y -\hat B_1 \bar x +\hat B_1 \bar x_U -\bar y_U]\\
&=& E[\bar y -\bar y_U]-E[\hat B_1 (\bar x -\bar x_U)]\\
&=& -\mbox{cov}(\hat B_1, \bar x)
\end{eqnarray*}
$\hat{\bar y}_{\mbox{reg}}$ is biased for $\bar y_U$
\bi
\item If the regression line goes through all of the points $(x_i,
y_i)$ in the population, then the bias is zero since $\hat B_1 =B_1$
for every sample, so $\mbox{cov}(\hat B_1, \bar x)=0$
\ei
 
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf MSE of $\hat {\bar y}_{\mbox{reg}}$}: $MSE(\hat{\bar
y}_{\mbox{reg}}) = \left(1-\ds\frac n N\right) \ds\frac{S_d^2}{n}$
\begin{eqnarray*}
d_i &=& y_i -(B_0 + B_1 x_i)\\
&=& y_i -(B_0 +B_1 x_i -B_1 \bar x_U+B_1 \bar x_U)\\
&=&y_i -(B_0+B_1 \bar x_U + B_1 (x_i-\bar x_U))\\
&=& y_i -[\bar y_U +B_1 (x_i-\bar x_U)]
\end{eqnarray*}
\begin{eqnarray*}
MSE(\hat{\bar y}_{\mbox{reg}}) &=& E(\hat{\bar y}_{\mbox{reg}}-\bar
y_U)^2\\
&=& E[\bar y +\hat B_1(\bar x_U -\bar x)-\bar y_U]^2\\
&=& E\{\bar y- [\bar y_U + \hat B_1 (\bar x-\bar x_U)]\}^2\\
&\approx& \mbox{Var} (\bar d)\\
&=& \left(1-\ds\frac n N\right)\ds\frac{S_d^2}{n}
\end{eqnarray*}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Another expression of MSE of $\hat {\bar y}_{\mbox{reg}}$}

Notice $$B_1 = R\cdot\ds\frac{S_y}{S_x}$$
 and
\begin{eqnarray*}
S_d^2 & =& \sum_{i=1}^N \ds\frac{(y_i - \bar y_U - B_1[x_i - \bar
x_U])^2}{N-1}\\
&=& S_y^2 (1-R^2)
\end{eqnarray*}
$$MSE(\hat{\bar y}_{\mbox{reg}}) = \left(1-\ds\frac n N\right) \ds\frac 1 n
S_y^2 (1-R^2)$$ $MSE(\hat{\bar y}_{\mbox{reg}})$ is small if
\bi
\item $n$ is large, $n/N$ is large
\item The correlation $R$ is close to either -1 or +1
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Variance of $\hat {\bar y}_{\mbox{reg}}$}

For large SRSs
\bi

\item Bias is often negligible in large samples
\item The MSE for regression estimation is approximately equal to the variance
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Estimator for total: $\hat t_{\mbox{yreg}}$}
\begin{eqnarray*}
\hat t_{\mbox{yreg}} &=& \sum\limits_{i\in S} y_i +
\sum\limits_{i\notin S} y_i\\
&=& \sum\limits_{i \in S} y_i + \sum\limits_{i \notin S}(\hat B_0 +
\hat B_1 x_i)\\
&=& \sum\limits_{i \in S} y_i +(N-n) \hat B_0 + \hat B_1 \left(t_x -
\sum_{i\in S}x_i\right)
\end{eqnarray*}
If $n<<N$
\begin{eqnarray*}
\hat t_{\mbox{yreg}} &\approx& N \hat B_0 +\hat B_1 t_x\\
&=& N \hat B_0 +\hat B_1 N \bar x_U\\
&=& N(\hat B_0 +\hat B_1 \bar x_U)\\
&=& N \hat {\bar y}_{\mbox{reg}}
\end{eqnarray*}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Confidence Intervals:}
$$SE(\hat{\bar y}_{\mbox{reg}}) = \sqrt{\left(1-\ds\frac n N\right)
\ds\frac{s_e^2}n}$$
$$SE(\hat t_{\mbox{yreg}}) = N\sqrt{\left(1-\ds\frac n N\right)\ds\frac{s_e^2}{n}}$$
A $100(1-\alpha)$\% CI for $\bar y_U$ is
$$\hat{\bar y}_{\mbox{reg}} \pm t_{n-2} (\alpha/2) \sqrt{\left(1-\ds\frac
n N\right) \ds\frac{s_e^2}{n}}$$

A $100(1-\alpha)$\% approximate CI for $t$ is
$$\hat t_{\mbox{yreg}} \pm t_{n-2,\alpha/2} N \sqrt{\left(1-\ds\frac n N\right)
\ds\frac{s_e^2}n}$$
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{frame}

    {\bf {Example 4.7: Estimating the Number of Dead Trees}}

    To estimate the number of dead trees in a specific area, the following sampling procedure is implemented:
    \begin{enumerate}
        \item {Divide the area into 100 square plots.}
        \item {Conduct photo counts:}
        \begin{itemize}
            \item Count the number of dead trees in each plot using aerial photographs.
            \item Photo counts are efficient but may include misclassifications or missed detections.
        \end{itemize}
        \item {Select a simple random sample (SRS) of 25 plots for field verification:}
        \begin{itemize}
            \item Perform on-the-ground counts of dead trees in these 25 plots to assess and correct for any inaccuracies in the photo counts.
        \end{itemize}
        \item {Calculate the population mean:}
        \begin{itemize}
            \item The mean number of dead trees per plot, based on photo counts, is 11.3.
        \end{itemize}
    \end{enumerate}

    This methodology combines aerial photographic analysis with field verification to enhance the accuracy of the estimated mean number of dead trees per plot.
\end{frame}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\begin{verbatim}
print.data.frame(deadtrees)
   photo field
1     10    15
2     12    14
3      7     9
4     13    14
5     13     8
6      6     5
7     17    18
8     16    15
9     15    13
10    10    15
11    14    11
12    12    15
13    10    12
14     5     8
15    12    13
.........
25    10     8
\end{verbatim}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\begin{verbatim}
dtree<- svydesign(id = ~1, weight=rep(4,25),
 fpc=rep(100,25), data = deadtrees)
> dtree
Independent Sampling design
svydesign(id = ~1, weight = rep(4, 25), fpc = rep(100, 25), 
data = deadtrees)
> myfit1 <- svyglm(field~photo, design=dtree) 
> summary(myfit1) # displays regression coefficients
Call:
svyglm(formula = field ~ photo, design = dtree)
Survey design:
svydesign(id = ~1, weight = rep(4, 25), fpc = rep(100, 25), 
data = deadtrees)

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   5.0593     1.3930   3.632   0.0014 ** 
photo         0.6133     0.1259   4.870 6.44e-05 ***
\end{verbatim}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

From R output, 
$$\hat B_0 =5.0593 , \hat B_1 = 0.6133$$
Fitted regression line
$$\hat y = 5.0593 + 0.6133 x$$

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]

\begin{verbatim}
newdata <- data.frame(photo=11.3)
> predict(myfit1, newdata)
    link    SE
1 11.989 0.418
> confint(predict(myfit1, newdata),df=23)
     2.5 %   97.5 %
1 11.12455 12.85404
\end{verbatim}
{\normalsize
The regression estimate of the mean is 
$$\hat y_{reg} =  5.0593 + 0.6133 *11.3 = 11.99$$
For these data, $\bar x = 10.6,  \bar y = 11.56, s_y^2 = 9.09$, and the sample correlation between $x$
and $y$ is $r = 0.62420$.
$$SE(\hat {\bar y}_{reg}) = \sqrt{\left(1-\ds\frac{25}{100}\right) \ds\frac 1{25} *9.09 * (1- 0.62420^2)} = 0.408$$}
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]

\begin{verbatim}
newdata2 <- data.frame(photo=1130)
> predict(myfit1, newdata2, total=100)  
    link     SE
1 1198.9 41.802
> confint(predict(myfit1, newdata2,total=100),df=23)
     2.5 %   97.5 %
1 1112.455 1285.404

\end{verbatim}
The estimate of the total number of dead trees
$$\hat t_{yreg} = 100*11.99 = 1199$$
The estimated standard error of $\hat t_{yreg}$ is 41.80, with CI of  $[1112.455, 1285.404]$.
\bi
\item
Because of the relatively small sample size, we used the t distribution percentile (with
$n-2=23$ degrees of freedom) of 2.07 in the CI rather than the normal distribution
percentile of 1.96.
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf SRS and Ratio estimation using weights}

SRS
\bi
\item $w_i = N/n$
\item $\bar y =\ds\frac{\sum\limits_{i\in S}w_i
y_i}{\sum\limits_{i\in S} w_i}$
\item $\hat t_y = \sum\limits_{i\in S}
w_i y_i =N \bar y$
\item $\sum\limits_{i\in S} w_i =
\sum\limits_{i\in S}\ds\frac N n = n \cdot\ds\frac N n =N$
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Ratio Estimation}
\begin{eqnarray*}
\hat t_{yr} &=& \ds\frac{\bar y}{\bar x} t_x
= \ds\frac{\hat t_y}{\hat t_x} t_x \\
&=& \sum\limits_{i\in S}w_i y_i \ds\frac{t_x}{\hat t_x}
= \sum\limits_{i\in S} \left(w_i\cdot \ds\frac{t_x}{\hat t_x}\right)y_i\\
& \stackrel{g_i = t_x/\hat t_x}{=} & \sum\limits_{i\in S} w_i g_i y_i\\
&\stackrel{w_i^*= w_i g_i}{=}& \sum\limits_{i\in S}  w_i^* y_i
\end{eqnarray*}
\bi
\item $w_i^*$ depend upon values from the sample
\item The weight adjustments $g_i$ calibrate the estimates on the
$x$ variable. Since $\sum_{i \in S} w_i g_i x_i = t_x$, the adjusted
weights force the estimated total for the $x$ variable to equal the
known population total $t_x$. The factors $g_i$ are called the
calibration factors.
\ei


\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

 {\bf{Example 4.6: Census of Agriculture Data (Examples 4.2 and 4.3 Continued)}}

    \begin{itemize}
        \item For each observation:
        \[
        g_i = \frac{t_x}{\hat{t}_x} = \frac{964{,}470{,}625}{929{,}413{,}560} \approx 1.0377
        \]
        \item Since $\hat{t}_x < t_x$, each observation's sampling weight is increased by a small amount.
        \item The sampling weight for the Simple Random Sample (SRS) design is:
        \[
        w_i = \frac{3078}{300} \approx 10.26
        \]
        \item The ratio-adjusted weight for each observation is:
        \[
        w_i^* = w_i \times g_i = 10.26 \times 1.0377 \approx 10.65
        \]
    \end{itemize}
\end{frame}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\bi
\item $$\sum_{i\in S} w_i g_i x_i = \sum_{i\in S}
10.64700262 x_i = 964,470,625 = t_x$$
\item  $$\sum_{i\in S} w_i g_i
y_i = \sum_{i\in S} 10.64700262 y_i = 951,513,191 = \hat t_{yr}$$
\item The adjusted weights, however, no longer sum to $N = 3078$
$$\sum_{i\in S} w_i g_i = (300)(10.64700262) = 3194$$
\item The ratio estimator is calibrated to the population total
$t_x$ of the $x$ variable, but is no longer calibrated to the
population size $N$.
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Regression Estimation}
\begin{eqnarray*}
\hat t_{\mbox{yreg}}
&=& N[\hat B_0 +\hat B_1 \bar x_U]\\
&=& N\hat B_0 + N \hat B_1 \bar x_U\\
&=& \hat B_0 N +\hat B_1 t_x\\
&=& (\bar y -\hat B_1 \bar x)N +\hat B_1 t_x\\
&=&\hat t_y -\hat B_1 \hat t_x +\hat B_1 t_x\\
&=& \hat t_y + \hat B_1 (t_x -\hat t_x)\\
&=& \sum\limits_{i\in S}w_i y_i +\ds\frac{\sum\limits_{i\in
S}(x_i-\bar x)(y_i -\bar y)}{\sum\limits_{i\in S}(x_i-\bar
x)^2}\cdot (t_x -\hat t_x)
\end{eqnarray*}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\large \begin{eqnarray*} &=&\sum\limits_{i\in S}w_i y_i +
\ds\frac{\sum\limits_{i\in S} y_i
(x_i -\bar x)}{\sum\limits_{i} (x_i -\bar x)^2}\cdot (t_x -\hat t_x)\\
 &=&\sum\limits_{i\in S}w_i y_i +
\ds\frac{\sum\limits_{i\in S}w_i y_i
(x_i -\bar x)}{\sum\limits_{i}w_i (x_i -\bar x)^2} \cdot (t_x -\hat t_x)\\
&=& \sum\limits_{i\in S} w_i \left(1+\ds\frac{(x_i -\bar x)(t_x
-\hat
t_x)}{\sum\limits_{i} w_i(x_i -\bar x)^2}\right) y_i\\
&=& \sum\limits_{i\in S} w_i g_i y_i
\end{eqnarray*}
where $g_i = \left(1+\ds\frac{(x_i -\bar x)(t_x -\hat
t_x)}{\sum\limits_{i} w_i(x_i -\bar x)^2}\right)$ called g-weight}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
If $y_i =x_i$
\begin{eqnarray*}
\hat t_{\mbox{yreg}} &=& \sum\limits_{i\in S} w_i
\left(1+\ds\frac{(x_i-\bar
x)(t_x -\hat t_x)}{\sum\limits_i w_i(x_i-\bar x)^2}\right) x_i\\
&=& \sum\limits_{i\in S} w_i x_i + \ds\frac{\sum\limits_{i\in S}w_i
(x_i -\bar
x)^2}{\sum\limits_{i\in S} w_i (x_i-\bar x)^2}\cdot (t_x-\hat t_x)\\
&=& \hat t_x +(t_x -\hat t_x)\\
&=& t_x
\end{eqnarray*}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

    {\bf{Comparison of Estimation Methods}}

    \begin{itemize}
        \item Both \textbf{ratio} and \textbf{regression} estimation utilize an auxiliary variable highly correlated with the variable of interest.
        \item The ratio and regression estimators discussed are special cases of a generalized regression estimator.
        \item Ratio estimation is particularly useful in cluster sampling.
        \item For a Simple Random Sample (SRS) of size \( n \), the estimators are summarized in the following table.
    \end{itemize}
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\footnotesize
\begin{table}
\begin{tabular}{cccc}
& Estimator for Mean $\bar y_U$& Estimator for Total $t_y$& Residual $e_i$\\
\hline
SRS & $\bar y$ & $N \bar y$ & $y_i -\bar y$\\
\hline
Ratio & $\hat B \bar x_U$ & $\hat B t_x$
 &$y_i -\hat B x_i$\\
\hline
 Regression & $\hat B_0 + \hat B_1 \bar x_U$ & $ N (\hat B_0 + \hat B_1 \bar x_U)$ & $y_i -\hat B_0 -\hat B_1 x_i$\\
 & $=\bar y +\hat B_1 (\bar x_U -\bar x)$ & & \\
\hline
\end{tabular}
\caption{Estimators and Residuals for SRS of Size $n$}
\end{table}
}

Estimated variance for $\hat {\bar y}_U$: $\left(1-\ds\frac n
N\right)\ds\frac
{s_e^2}{n}$\\
Estimated variance for $\hat t$: $N^2 \left(1-\ds\frac n N\right)
\ds\frac{s_e^2}{n}$
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{frame}
    \frametitle{Estimation in Domains}

    \begin{itemize}
        \item \textbf{Domain:} A subpopulation of interest.
        \item Objective: Obtain separate estimates for subpopulations. 
        \begin{itemize}
            \item Example: Estimating the average income for women in a Simple Random Sample (SRS).
        \end{itemize}
        \item Considerations:
        \begin{itemize}
            \item The number of women in the sample is a random variable.
            \item Membership in a domain (e.g., women) is unknown for the entire population until sampled.
            \item Therefore, the number of individuals in each domain within an SRS is a random variable, with its value unknown at the survey design stage.
        \end{itemize}
        \item Estimating domain means is a special case of ratio estimation.
    \end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

 {\bf{Estimating Mean for a Specific Domain}}

    Suppose there are \( D \) domains in the population:

    \begin{itemize}
        \item \( U_d \): Index set of units in the population for domain \( d \), where \( d = 1, 2, \ldots, D \).
        \item \( S_d \): Index set of units in the sample for domain \( d \), where \( d = 1, 2, \ldots, D \).
        \item \( N_d \): Number of population units in \( U_d \).
        \item \( n_d \): Number of sample units in \( S_d \).
    \end{itemize}

    To estimate the mean salary for a specific domain (e.g., women):

    \[
    \bar{y}_{U_d} = \frac{\sum_{i \in U_d} y_i}{N_d} = \frac{\text{Total salary for all women in population}}{\text{Number of women in population}}
    \]

    A natural estimator for \( \bar{y}_{U_d} \) is the sample mean:

    \[
    \bar{y}_d = \frac{\sum_{i \in S_d} y_i}{n_d} = \frac{\text{Total salary for women in sample}}{\text{Number of women in sample}}
    \]

    Note: \( n_d \) is a random variable.
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
   
  Let:
    \[
    y_i: \text{Income for person } i, \quad
    x_i = 
    \begin{cases} 
        1 & \text{if women} \\
        0 & \text{otherwise}
    \end{cases}
    \]
    \[
    u_i = x_i y_i = 
    \begin{cases} 
        y_i & \text{if women} \\
        0 & \text{otherwise}
    \end{cases}
    \]

    \begin{itemize}
        \item \( t_x = \sum\limits_{i=1}^N x_i = N_d \): Total number of women in the population, \( \bar{x}_U = N_d / N \).
        \item \( t_u = \sum\limits_{i=1}^N u_i \): Total income for women in the population.
        \item \( \bar{y}_{U_d} = t_u / t_x = B \): Average income for women in the population.
        \item \( \bar{y}_d = \bar{u} / \bar{x} = \hat{B} \): Average income for women in the sample \( d \), where:
        \[
        \bar{u} = \frac{\sum\limits_{i \in S} x_i y_i}{n}, \quad \bar{x} = \frac{\sum\limits_{i \in S} x_i}{n} = \frac{n_d}{n}.
        \]
    \end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{eqnarray*}
\hat V(\hat B) &=& \ds\frac 1 {\bar x^2}\left(1-\ds\frac n N\right)
\ds\frac{s_e^2}{n}\\
&=& \ds\frac 1 {\bar x^2}\left(1-\ds\frac n N\right) \ds\frac 1 n
\cdot \ds\frac 1
{n-1} \sum\limits_{i\in S} (u_i -\hat B x_i)^2 \\
&= &\ds\frac 1 {\bar x^2}\left(1-\ds\frac n N\right) \ds\frac 1 n
\cdot \ds\frac 1 {n-1} \sum\limits_{i\in S} (y_i x_i -\hat B
x_i)^2\\
%&=& \ds\frac 1{n-1} \sum\limits_{i\in S} x_i^2 (y_i -\ds\frac{\bar
%u}{\bar x})^2
%&=& \ds\frac 1{n-1} \sum\limits_{i\in S} x_i^2 (y_i - \bar
%y_{women})^2\\
&= &\ds\frac 1 {\bar x^2}\left(1-\ds\frac n N\right) \ds\frac 1 n \cdot \ds\frac 1 {n-1} \sum\limits_{i\in S_d} (y_i -\bar y_d)^2\\
&\stackrel{\bar x = n_d/n}{=}& \left(1- \ds\frac {n} {N}\right) \ds\frac n {n_d^2} \cdot \ds\frac{n_d-1}{n-1} s_{yd}^2\\
&\approx & \left(1-\ds\frac n N\right) \ds\frac{s_{yd}^2}{n_d}
\end{eqnarray*}

$$SE(\bar y_d) \approx \sqrt{\left(1-\ds\frac n N\right)
\ds\frac{s_{yd}^2}{n_d}}$$
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

   { \bf{General Case of Domain Estimation}}

    Estimates for different subpopulations:

    \begin{itemize}
        \item The mean for a subpopulation is expressed as a ratio.
        \item The sample size of the domain is a random variable.
        \item The estimate for the mean, \( \hat{B} \), is given by:
        \[
        \hat{B} = \frac{\text{Sum of } y_i \text{'s in the domain}}{\text{Total number of observations in the domain}} = \bar{y}_d
        \]
    \end{itemize}
\end{frame}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}

    {\bf{Estimating Totals in Domains}}

    \begin{itemize}
        \item If \( N_d \) (total population size of the domain) is known:
        \[
        \hat{t}_{yd} = N_d \bar{y}_d
        \]
        \item If \( N_d \) is unknown:
        \[
        \hat{N}_d = N \cdot \frac{n_d}{n}
        \]
        Then, the total estimate is:
        \[
        \hat{t}_{yd} = N \cdot \frac{n_d}{n} \cdot \frac{\sum_{i \in S} u_i}{n_d} = N \bar{u}
        \]
        \item The standard error of \( \hat{t}_{yd} \) is:
        \[
        SE(\hat{t}_{yd}) = N \sqrt{\left(1 - \frac{n}{N}\right) \frac{s_u^2}{n}}
        \]
    \end{itemize}
\end{frame}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

   {\bf {Example 4.8: Estimating Acres Devoted to Farming}}

    In an SRS of size 300 from the Census of Agriculture (see Examples 2.6, 4.2, and 4.3):
    \begin{itemize}
        \item 129 counties have at least 600 farms.
        \item 171 counties have fewer than 600 farms.
        \item Objective: Estimate the average and total number of acres devoted to farming in each domain.
    \end{itemize}

    \vspace{0.5cm}

    \textbf{Summary Statistics for the Two Domains:}
    \vspace{0.2cm}

    \begin{center}
    \begin{tabular}{|c|c|c|c|}
        \hline
        {Domain, \(d\)} & \(n_d\) & \(\bar{y}_d\) & \(s_d\)  \\
         & & (Average Acres) &(SE) \\
        \hline
        1. At least 600 farms & 129 & 316,565.65 & 258,249.74 \\
        2. Fewer than 600 farms & 171 & 283,813.71 & 397,643.92 \\
        \hline
    \end{tabular}
    \end{center}
\end{frame}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\begin{verbatim}
> # direct calculation
> agsrsnew1<-agsrsnew[which(agsrsnew$farmcat=='large'),]
> nrow(agsrsnew1)
[1] 129
> mean(agsrsnew1$acres92)  #\bar y_1
[1] 316565.7
> sqrt(var(agsrsnew1$acres92)) #s_{1}
[1] 258249.7
> sum(agsrsnew1$acres92)/300 # u_1
[1] 136123.2
> 3078*sum(agsrsnew1$acres92)/300  # \hat t_u
[1] 418987302
> agsrsnew$is_large = ifelse(agsrsnew$farmcat == "large", 
agsrsnew$acres92,0)
> sqrt(var(agsrsnew$is_large))  #s_u=230641.2 page 141
[1] 230641.2
\end{verbatim}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\begin{verbatim}
> n<-300
> agsrsnew$farmcat<-rep("large",n)
> agsrsnew$farmcat[agsrsnew$farms92 < 600] <- "small"
> head(agsrsnew)
> print.data.frame(head(agsrsnew[,c(1,2,6,16)]))
             county state farms92 farmcat
1     COFFEE COUNTY    AL     760   large
2    COLBERT COUNTY    AL     488   small
3      LAMAR COUNTY    AL     299   small
4    MARENGO COUNTY    AL     434   small
5     MARION COUNTY    AL     566   small
6 TUSCALOOSA COUNTY    AL     436   small
\end{verbatim}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\begin{verbatim}
> sampwt <- rep(3078/n,n)
> dsrsnew <- svydesign(id = ~1, weights=~sampwt, 
fpc=rep(3078,300), data=agsrsnew)  
> dsrsnew
Independent Sampling design
svydesign(id = ~1, weights = ~sampwt, 
fpc = rep(3078, 300), data = agsrsnew)
> dsub1<-subset(dsrsnew,farmcat=='large') 
> smean1<-svymean(~acres92,design=dsub1)   
> smean1
          mean    SE
acres92 316566 21553
> df1<-sum(agsrsnew$farmcat=='large')-1 #domain df
> df1
[1] 128
> confint(smean1, level=.95,df=df1)
           2.5 %   97.5 %
acres92 273918.9 359212.4
\end{verbatim}
\end{frame}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
Suppose we don't know $N_d$: how many counties in the population are in each domain
\begin{verbatim}
> stotal1<-svytotal(~acres92,design=dsub1)
> stotal1
            total       SE
acres92 418987302 38938277
> confint(stotal1, level=.95,df=df1)
            2.5 %    97.5 %
acres92 341941269 496033335
\end{verbatim}
Please refer to detailed calculation on page 141
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{figure}[!htp]
       \centering
       \includegraphics[width=1.0\textwidth,
       height=0.8\textheight]{./plots/page141s}
\caption{Example 4.8, more calculations}
     \end{figure}
 \begin{center}
        \textit{\scriptsize Source: page 141 of Sampling: Design and Analysis, 3rd edition, by Sharon L. Lohr}
    \end{center}
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{frame}{Poststratification}
    \textbf{Poststratification:} Stratification performed after the selection of the sample.
    
    \begin{itemize}
        \item \textit{Stratification} is an element of survey design that divides the population into distinct subgroups before sampling.
        \item \textit{Poststratification}, on the other hand, is an analytical technique applied after data collection to adjust for differences between the sample and the population structure.
    \end{itemize}
\end{frame}

\begin{frame}

{\bf {Example of Poststratification}}
    Consider a public opinion survey aiming to stratify respondents by gender:
    
    \begin{itemize}
        \item If the survey is conducted via random digit dialing of telephone numbers, it's not possible to assign potential respondents to male or female strata until they have been contacted and identified.
        \item Poststratification can then be used to weight the responses according to known population demographics once the data has been collected.
    \end{itemize}
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Example: Estimating Monthly Food Expenditure} 

To estimate the average amount spent on food in a month, one desirable stratification variable might be household size, since larger households are likely to have higher food expenditures than smaller ones. Given this, we can use the distribution of household sizes from U.S. Census data for the region as follows:
\begin{table}
\begin{tabular}{cc}
\hline
\# of persons in household & percentage of household\\
1 & 25.75\\
2 & 31.17\\
3 & 17.50\\
4 & 15.58\\
5 & 10.00\\
\hline
\end{tabular}
\caption{Distribution of Household Sizes in the Region}
\end{table}

\end{frame}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

    \textbf{Poststratification:}
    
    \begin{itemize}
        \item Collect a Simple Random Sample (SRS) and record both the amount spent on food and the household size for each household in your sample.
        
        \item When the sample size $ n $ is sufficiently large, it is likely to resemble a stratified sample with proportional allocation. That is:
        \begin{itemize}
            \item Approximately 26\% of the sample would be one-person households,
            \item Around 31\% would be two-person households,
            \item And so on, following the known distribution of household sizes in the population.
        \end{itemize}
        
        \item Treat different household-size groups as distinct domains. Using this approach, ratio estimation can be applied to estimate the average amount spent on groceries within each domain.
    \end{itemize}
    
    By employing poststratification, we can improve the precision of our estimates by accounting for the structure of the population after data collection.
\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Poststratified
estimator}
Let $n_1, n_2, \cdots, n_H$ be the numbers of units sampled
in the
various household-size groups (domains), $n_h$ is random\\
and $\bar y_1, \cdots, \bar
y_H$ be the sample means for the groups\\
Let $x_{ih}=1$ if observation $i$ is in poststratum $h$ and $0$
otherwise\\
Let $u_{ih} = y_i x_{ih}$\\
$t_{xh} =\sum\limits_{i=1}^N x_{ih} =N_h$\\
$t_{uh} = \sum\limits_{i=1}^N u_{ih}$ = population total of variable
$y$ in poststratum $h$\\
For each poststratum $h$, estimate the total in the poststratum by\\
$\hat t_{uh} =\sum\limits_{i\in S} \ds\frac N n \cdot u_{ih}$ and $\hat N_h = \sum\limits_{i\in S} \ds\frac N n \cdot x_{ih}$\\
$\hat t_{uhr} = \ds\frac{t_{xh}}{\hat t_{xh}}\cdot \hat t_{uh}
=\ds\frac
{N_h}{\hat N_h} \cdot \hat t_{uh} = N_h \cdot \bar y_h$ 
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
Poststratified
estimator of the population total is
$$\hat t_{ypost} = \sum\limits_{h=1}^H \hat t_{uhr} =
\sum\limits_{h=1}^H \ds\frac {N_h}{\hat N_h} \cdot \hat t_{uh} =
\sum\limits_{h=1}^H N_h \bar y_h$$ ratio estimation is used within
each poststratum to estimate the population total in that
poststratum.\\
The poststratified estimator of $\bar
y_U$ \\
$\bar y_{\mbox{post}} = \sum\limits_{h=1}^H \ds\frac{N_h} N \cdot
\bar
y_h$ \\
where $N_h/N$ known, $n_h \ge 30$ and $n$ large\\
Approximately proportional allocation\\ $\hat V(\bar
y_{\mbox{post}}) \approx \left(1-\ds\frac n
N\right)\sum\limits_{h=1}^H \ds\frac {N_h}{N} \cdot \ds\frac{s_h^2} n,$\\
when the expected sample sizes in each poststratum are large.
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Poststratification using weights}

{\small Poststratification modifies the weights so that they sum
to $N_h$ in poststratum $h$.  Let $w_i$ represent the sampling weight for unit $i$. For an SRS, for
example, $w_i = N/n$ for each unit in the sample.  Recall that 
$$\hat t_{ypost} = \sum\limits_{h=1}^H \hat t_{uhr} =
\sum\limits_{h=1}^H \ds\frac {N_h}{\hat N_h} \cdot \hat t_{uh} =
\sum\limits_{h=1}^H \ds\frac {N_h}{\hat N_h} w_i x_{ih} y_{ih} $$ 

Define
$$w_i^{*} = (N_h /\hat N_h )w_i$$ when unit $i$ is in poststratum $h$. Then estimate the population
total $t_y$ by
$$\hat t_{ypost} = \sum_{i \in S} w_i^{*}y_i$$
and the population mean by
$$\bar y_{post} = \ds\frac{ \sum_{i \in S} w_i^{*}y_i}{ \sum_{i \in S} w_i^{*}}.$$
For an SRS, the above reduces to 
$$\bar y_{\mbox{post}} = \sum\limits_{h=1}^H \ds\frac{N_h} N \cdot
\bar
y_h, \quad \sum_{i \in S} w_i^* =N$$}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{figure}[!htp]
       \centering
       \includegraphics[width=0.90\textwidth,
       height=1.2\textheight]{./plots/page144.pdf}
\caption{Example 4.9(1)}
       \label{example0409}
     \end{figure}

\end{frame}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
{\bf Ratio Estimation with Stratified Samples}

{\bf Combined ratio estimator}
\bi
\item First, estimate $t_x$ and $t_y$ using all the data
\item Next ratio estimation is applied
\ei
 $$\hat t_{yrc} = \hat B t_x,\mbox{
}\mbox{where}\mbox{ } \hat B = \ds\frac{\hat t_{y,str}}{\hat
t_{x,str}}$$
$$\hat t_{y,str} = \sum_{h=1}^H N_h \bar y_h = \sum_{h=1}^H
\sum_{j\in S_h} w_{hj} y_{hj}$$ and $$\hat t_{x,str} = \sum_{h=1}^H
N_h \bar x_h = \sum_{h=1}^H \sum_{j\in S_h} w_{hj} x_{hj}$$ with
$w_{hj} = N_h/n_h$
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
$$MSE(\hat t_{yrc}) \approx V(\hat t_{y,str} - B \hat t_{x,str}) =
V\left[\sum_{h=1}^H \sum_{j\in S_h} w_{hj}(y_{hj} -B
x_{hj})\right]$$
\begin{eqnarray*}
\hat V(\hat t_{yrc}) &=& \left(\ds\frac{t_{x,str}}{\hat
t_{x,str}}\right)^2 \hat V\left(\sum_{h=1}^H \sum_{j \in S_h} w_{hj}
e_{hj}\right)\\
&=&\left(\ds\frac{t_{x,str}}{\hat t_{x,str}}\right)^2 \hat V(\hat
t_{e,str}) \\
&=& \left(\ds\frac{t_{x,str}}{\hat t_{x,str}}\right)^2[\hat V(\hat
t_{y,str}) + \hat B^2 \hat V(\hat t_{x,str}) - 2 \hat B \widehat
{Cov} (\hat t_{y,str},\hat t_{x,str})]
\end{eqnarray*}
where $e_{hj} = y_{hj} - \hat B x_{hj}$.
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}

{\bf Separate ratio estimator}
\bi
\item Ratio estimation is applied separately in each stratum
\item Next the strata estimators are combined to estimate the population total
\ei
$$\hat t_{yrs} = \sum_{h=1}^H \hat t_{yhr} = \sum_{h=1}^H t_{xh}
\cdot \ds\frac{\hat t_{yh}}{\hat t_{xh}} = \sum_{h=1}^H t_{xh}
\cdot \hat B_h$$ with
$$\hat V(\hat t_{yrs}) = \sum_{h=1}^H \hat V(\hat t_{yhr})$$
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}

{\bf{Comments on Estimators}}
    \begin{itemize}
        \item A separate ratio estimator can improve efficiency if the ratio \( \hat{B}_h = \frac{\hat{t}_{yh}}{\hat{t}_{xh}} \) varies significantly between strata.
        \item A separate ratio estimator should not be used when strata sample sizes are small, as each ratio is biased, and the bias may propagate across strata.
        \item Poststratification is a special case of the separate ratio estimator.
        \item The combined estimator has less bias when sample sizes in some strata are small.
        \item However, when ratios vary greatly between strata, the combined estimator does not leverage the efficiency gain from stratification that the separate ratio estimator does.
    \end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Disclaimer}

Slides are intended for a course based on the book: \textit{Sampling: Design and Analysis, Third Edition} by Sharon L. Lohr

All examples, datasets, and pages directly scanned and included in this chapter are from the textbook.

References to papers or books cited in these slides can be found in the Bibliography section of the textbook.
\end{frame}

\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%







































