Method of Semi Averages (2020)

The secular trends can also be measured by the method of semi averages. The steps are:

  • Divide the time series data into two equal portions. If observations are odd then either omit the middle value or include the middle value in each half.
  • Take the average of each part and place these average values against the midpoints of the two parts.
  • Plot the semi-averages in the graph of the original values.
  • Draw the required trend line through these two potted points and extend it to cover the whole period.
  • It is simple to compute the slope and $y$-intercept of the line drawn from two points. The trend values can be found from the semi-average trend line or by an estimated straight line as explained:

Let $y’_1$ and $y’_2$ be the semi-averages placed against the times $x_1$ and $x_2$. Let the estimated straight line $y’=a+bx$ is to pass through the points ($x_1$, $y’_1$) and ($x_2$, $y’_2$). The constant “$a$” and “$b$” can easily be determined. the equation of the line passing through the points ($x_1$, $y’_1$) and ($x_2$, $y’_2$) can be written as:

\begin{align*}
y’ – y’_1 &= \frac{y’_2-y’_1}{x_2-x_1}(x-x_1)\\
&= b(x-x_1)\\
\Rightarrow y’ &= (y’_1 – bx_1) + bx\\
&= a+bx, \quad \text{ where $a=y’_1-bx_1$}
\end{align*}

For an even number of observations, the slope of the trend line can be found as:

\begin{align*}
b&=\frac{1}{n/2}\left(\frac{S_2}{n/2} – \frac{S_1}{n/2} \right)\\
&= \frac{1}{n/2} \left(\frac{S_2-S_1}{n/2}\right)\\
&= \frac{4(S_2-S_1)}{n^2},
\end{align*}

where $S_1$ is the sum of $y$-values for the first half of the period, $S_2$ is the sum of $y$-values of the second half of the period, and $n$ is the number of time units covered by the time series.

The following merits and demerits of the Method of Semi Averages are as described:

Merits of Method of Semi Averages

  • The method of semi-averages is simple, easy, and quick.
  • It smooths out seasonal variations
  • It gives a better approximation to the trend because it is based on a mathematical model.

Demerits of Method of Semi Averages

  • It is a rough and objective method.
  • The arithmetic mean used in Semi Average is greatly affected by very large or by very small values.
  • The method of semi-averages is applicable when the trend is linear. This method is not appropriate if the trend is not linear.

Numerical Example 1: Method of Semi Averages

The following table shows the property damaged by road accidents in Punjab for the year 1973 to 1979.

Year1973197419751976197719781979
Property Damage201238392507484648742
  1. Obtain the semi-averages trend line
  2. Find out the trend values.

Solution

Let $x=t-1973$

YearProperty DamagedSemi TotalSemi AverageCoded YearTrend Values
1973201  0$y’=190+87(0)=190$
19742388312771$y’=190+87(1)=277$
1975392  2$y’=190+87(2)=364$
1976507  3$y’=190+87(3)=451$
1977484  4$y’=190+87(4)=538$
197854918756255$y’=190+87(5)=625$
1979742  6$y’=190+87(6)=712$
method of semi-averages (trend values)

\begin{align*}
y’_1 &= 277, x_1 = 1, y’_2 = 625, x_2=5\\
b&=\frac{y’_2-y’_1}{x_2-x_1}=\frac{625-277}{5-1}=87\\
a&=y’_1 – bx_1 = 277-87(1)=190
\end{align*}

The semi-average trend line $y’=190+87x$ (with the origin at 1973)

Numerical Example 2: Method of Semi Averages

The following table gives the number of books in thousands sold at a bookstore for the years 1973 to 1981

Year197319741975197619771978197919801981
No. of Books Sold423835253224201917
  1. Find the equation of the semi-average trend line
  2. Compute the trend values
  3. Estimate the number of books sold for the year 1982.

Solution

Let $x=t-1973$

YearNo. of books (y)Semi TotalSemi AverageCoded yearTrend Values
197342  0$y’=39.5 – 3(0)=39.5$
197438140351$y’=39.5 – 3(1)=36.5$
1975352$y’=39.5 – 3(2)=33.5$
197625  3$y’=39.5 – 3(3)=30.5$
197732  4$y’=39.5 – 3(4)=27.5$
197824  5$y’=39.5 – 3(5)=24.5$
19792080206$y’=39.5 – 3(6)= 21.5$
198019  7$y’=39.5 – 3(7)=18.5$
198117  8$y’=39.5 – 3(8)=15.5$

\begin{align*}
y’_1 &= 35, x_1=1.5, y’_2=20, x_2=6.5\\
b &= \frac{y’_2 – y’_1}{x_2-x_1} = \frac{20-35}{6.5-1.5} =-3\\
a &= y’_1 – bx_1 = 35 – (-3)(1.5) = 39.5\\
y’&= 39.5 – 3x (\text{with origin at 1973})
\end{align*}

For the year 1982, the estimated number of books sold is $y’=39.5-3(9)=12.5$.

Computer MCQs Test Online

R Programming Language

The Method of Free Hand Curve (2020)

The secular trend is measured by the method of the free hand curve in the following steps:

  • Take the time periods along the $x$-axis by taking appropriate scaling
  • Plot the points for observed values of the $Y$ variable as the dependent variable against the given time periods
  • Join these plotted points by line segments to get a historigram
  • Draw a free-hand smooth curve (or a straight line) through the histogram

In this method we draw the given times series data on graph paper, then we draw a free-hand trend line through the plotted graph according to the trend of the graph. Then we read trend values from this free-hand trend line.

It is generally preferred to use a curve instead of a straight line to show the secular trend.

Merits (Free Hand Curve)

  • The free-hand curve method is simple, easy, and quick for measuring secular trends.
  • A well-fitted trend line (or curve) approximates the trend closely based on a mathematical model.

Demerits (Free Hand Curve)

  • It is a rough and crude method.
  • It is greatly affected by personal bias as different persons may fit different trends to the same data.
    The estimates are not reliable due to personal bias.

Question: The following time series shows the number of road accidents in Punjab from 1972 to 1978.

Year1972197319741975197619771978
No. of Accidents2493263826993038374540794688
  • Obtain the historigram showing the number of road accidents and a free-hand trend line by drawing a straight line
  • Find the trend values for this time series

Solution:

Method of Free Hand Curve
YearValueTotalMeanTrend value
19722493  2200
19732638  2550
19742699  2950
1975303823338033403340
19763745  3650
19774079  4050
19784688  4499

The method of free hand curve is useful for:

  1. Exploratory Data Analysis (EDA): As a preliminary step free hand curve method helps us to understand the basic characteristics of the data and identify potential relationships between variables.
  2. Visual Communication: It also helps to present trends in the data in a clear and easily understandable way for non-statistical audiences.
  3. Limited Data: When you have a relatively small dataset, a free hand curve might be sufficient to get a basic idea of the central tendency.

By understanding the method of free hand curves and its limitations, one can use it as a valuable tool for initial data exploration and visualization alongside other statistical techniques for a more robust analysis.

MCQs Intermediate Mathematics Part-I Quadratic Equations

Heteroscedasticity Residual Plot (2020)

The post is about Heteroscedasticity Residual Plot.

Heteroscedasticity and Heteroscedasticity Residual Plot

One of the assumptions of the classical linear regression model is that there is no heteroscedasticity (error terms have constant error terms) meaning that ordinary least square (OLS) estimators are (BLUE, best linear unbiased estimator) and their variances are the lowest of all other unbiased estimators (Gauss Markov Theorem).

If the assumption of constant variance does not hold then this means that the Gauss Markov Theorem does not apply. For heteroscedastic data, regression analysis provides an unbiased estimate of the relationship between the predictors and the outcome variables.

As we have discussed heteroscedasticity occurs when the error variance has non-constant variance.  In this case, we can think of the disturbance for each observation as being drawn from a different distribution with a different variance.  Stated equivalently, the variance of the observed value of the dependent variable around the regression line is non-constant. 

We can think of each observed value of the dependent variable as being drawn from a different conditional probability distribution with a different conditional variance. A general linear regression model with the assumption of heteroscedasticity can be expressed as follows

\begin{align*}
y_i & = \beta_0 + \beta_1 X_{i1} + \beta_2 X_{i2} + \cdots + \beta_p X_ip + \varepsilon_i\\
Var(\varepsilon_i)&=E(\varepsilon_i^2)\\
&=\sigma_i^2; \cdots i=1,2,\cdots, n
\end{align*}

Note that we have a $i$ subscript attached to sigma squared.  This indicates that the disturbance for each of the $ n$ units is drawn from a probability distribution that has a different variance.

If the error term has non-constant variance, but all other assumptions of the classical linear regression model are satisfied, then the consequences of using the OLS estimator to obtain estimates of the population parameters are:

  • The OLS estimator is still unbiased
  • The OLS estimator is inefficient; that is, it is not BLUE
  • The estimated variances and covariances of the OLS estimates are biased and inconsistent
  • Hypothesis tests are not valid

Detection of Heteroscedasticity Residual Plot

The residual for the $i$th observation, $\hat{\varepsilon_i}$, is an unbiased estimate of the unknown and unobservable error for that observation, $\hat{\varepsilon_i}$. Thus the squared residuals, $\hat{\varepsilon_i^2} $, can be used as an estimate of the unknown and unobservable error variance,  $\sigma_i^2=E(\hat{\varepsilon_i})$. 

One can calculate the squared residuals and then plot them against an explanatory variable that you believe might be related to the error variance.  If you believe that the error variance may be related to more than one of the explanatory variables, you can plot the squared residuals against each one of these variables.  Alternatively, you could plot the squared residuals against the fitted value of the dependent variable obtained from the OLS estimates.  Most statistical programs (software) have a command to do these residual plots.  It must be emphasized that this is not a formal test for heteroscedasticity.  It would only suggest whether heteroscedasticity may exist.

Below there are residual plots showing the three typical patterns. The first plot shows a random pattern that indicates a good fit for a linear model. The other two plot patterns of residual plots are non-random (U-shaped and inverted U), suggesting a better fit for a non-linear model, than a linear regression model.

Heteroscedasticity Regression Residual Plot 3
Heteroscedasticity Residual Plot 1
Heteroscedasticity Residual Plot 1
Heteroscedasticity Residual Residual Plot 2
Heteroscedasticity Residual Plot 2
Heteroscedasticity Residual Plot 3

Learn R Language from R Frequently Asked Questions