0% found this document useful (0 votes)
17 views3 pages

Linear Probability Model in R

Uploaded by

Alexandra Farkas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

Linear Probability Model in R

Uploaded by

Alexandra Farkas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

José António Ferreira Machado

Marlon Francisco Nova SBE Econometrics


António Ribeiro dos Santos Fall 2024-25

R class: linear probability model

A linear probability model is a model in which the dependent variable for each observation takes values

which are either 0 or 1 - binary variable (for example: buy or do not buy a car, go to the doctor or not,

smoker or non-smoker, ...).

Pr (y = 1|X) = β0 + β1 x1 + β2 x2 + ... + βk xk + u,

where βj measures the predicted change in the probability of success when xj changes by one unit.

This type of model has one particularity. Unless p(Y ) does not depend on x (which would mean that the

model is useless) we have heteroskedaticity. Why do we know for sure that this is true?

Since Y ∼ Bernoulli(θ) then, E(Y ) = θ and E(Y 2 ) = θ because Y 2 = Y .

This implies that:

V ar(Y ) = E(Y 2 ) − µ2 = E(Y ) − µ2 = θ − θ2 = θ(1 − θ)

Therefore,

V ar(Y ) = p(Y )[1 − p(Y )]

How to correct for it? Using Feasible Generalized Least Squares with one particularity:

1. Run the regression of y on x1 , x2 , ..., xk and obtain the fitted values ŷi ;

2. Make sure all fitted values lie between 0 and 1;

3. Construct the estimated variances, which for the LPM are given by ĥi = ŷi (1 − ŷi );
p
4. Estimate the model by WLS using weights 1/ ĥ

1
José António Ferreira Machado
Marlon Francisco Nova SBE Econometrics
António Ribeiro dos Santos Fall 2024-25

In today’s class, we want to estimate the following Linear Probability Model (LPM):

ecobuy = β0 + β1 ecoprc + β2 regprc + β3 f aminc + β4 hhsize + β5 educ + β6 age + u

where ecobuy is a binary variable that takes value one if the individual purchased any ecolabeled apples

and zero otherwise. In addition, ecoprc and regprc are the prices of ecolabeled and regular apples,

respectively, in dollars, f aminc is family income in tens of thousands of dollars, hhsize is the number

of persons in the household, educ is education in years, and finally age is age in years. To estimate this

model, we will use Wooldridge’s dataset [Link].

Assume that the data come from a random sample and that the population model above is the true

model (i.e. assume that MLR.1 and MLR.2 are verified). Perform the following tasks:

a) Download the dataset from Moodle and save it in a folder for the purpose of today’s class. Open

Rstudio and the R script. Edit the R script: define the directory (i.e. the folder where you saved

the data). Load the data ([Link]) into R using read excel (library readxl). Explore the data and

export descriptive statistics table.

b) Investigate whether MLR.3 No perfect collinearity holds. (Hint: check if there is a lot of variation

in the variables by looking to descriptive statistics table and also check the correlation between the

variables1 .)

c) Estimate the model by OLS and store the results. Interpret the estimated coefficients. Comment on

the individual significance of all variables.

d) Test for the joint significance of ecoprc and regprc. Predict the fitted values and check whether they

lie in the zero-one interval.

e) Conduct all heteroskedasticity tests you learned in class (BP, White, and shorter version of the White

test). What do you conclude? Did you expect your findings?

f) Estimate the model by Weighted Least Squares (WLS) and store the results. To do this, you need to

conduct Feasible Generalized Least Squares (FGLS) in four steps:


1
Note that for MLR.3 to hold, no variable can be a linear combination of others. (Linear) Correlation between variables
can only tells us if there is no linear combination between any 2 pair of variables. However, it does not allows us to see if
there is a linear combination between 3 or more variables.

2
José António Ferreira Machado
Marlon Francisco Nova SBE Econometrics
António Ribeiro dos Santos Fall 2024-25

1. Estimate the model by OLS and predict the fitted values, ŷi (you did this already in d)

2. If not all fitted values lie in the zero-one interval, apply some transformation to bring them to that

interval (e.g. replace all values below zero with 0.01 and all values above one with 0.99)

3. Construct the estimated variances, which for the LPM are given by ĥi = ŷi (1 − ŷi )
p
4. Estimate the model by WLS, using weights 1/ ĥ

g) Ask R for the heteroskedasticity-robust standard errors. Do not forget to store the results. Compare

OLS, OLS with robust standard errors, and WLS results. What do you observe?

h) Test for the joint significance of ecoprc and regprc using robust inference.

i) Run a FGLS model. [If you do not have a LPM, you probabily do not know the functional form of

heteroskedaticity]. Compare the results with WLS.

Common questions

Powered by AI

When comparing estimated coefficients from an Ordinary Least Squares (OLS) and a Weighted Least Squares (WLS) model in addressing heteroskedasticity in LPMs, one typically finds that while the coefficients might not change significantly in magnitude, the efficiency and precision of the estimates improve under WLS due to the correction of heteroskedasticity. WLS uses weights derived from the variance estimates to correct for the non-constant variance, leading to more reliable and robust estimates. Moreover, the standard errors in WLS are often expected to be more accurate than those from simple OLS, especially in the presence of heteroskedasticity .

In econometrics, storing results both with and without heteroskedasticity-robust standard errors is advantageous as it allows comparison to understand the impact of heteroskedasticity on the model's estimations. Robust standard errors provide more reliable t-statistics and confidence intervals in the presence of heteroskedasticity, thereby assuring the validity of hypothesis tests. By comparing these with non-robust results, researchers can assess how heteroskedasticity influences standard errors and the overall reliability of regression coefficients, thus ensuring a comprehensive and accurate econometric analysis .

Heteroskedasticity is inherently present in the Linear Probability Model (LPM) because the variance of the binary dependent variable Y is a function of its mean. Specifically, for a binary variable modeled as Bernoulli, \( V ar(Y) = p(Y)[1 - p(Y)] \). This variance is not constant because it changes with the probability \( p(Y) \), which depends on the values of the independent variables. As a result, the variance of Y changes with X, leading to heteroskedasticity unless p(Y) does not depend on x, which would render the model useless .

To check for perfect collinearity when estimating a model, one should examine the descriptive statistics of the dataset to ensure a wide variation in variable values. Additionally, checking the correlation matrix for high correlations between variables helps identify potential collinearity, although it must be noted that this only addresses pairwise collinearity, not multi-collinearity involving more than two variables. This step ensures that no variable is a linear combination of others, which is a requirement for MLR.3 .

To address heteroskedasticity in a Linear Probability Model, the Feasible Generalized Least Squares (FGLS) method is suggested. This involves firstly running a regression of y on x1, x2, ..., xk and obtaining the fitted values. It is essential to make sure these fitted values lie between 0 and 1 by possibly transforming them to fit this range. Next, construct the estimated variances for the LPM using \( \hat{h}_i = \hat{y}_i(1 - \hat{y}_i) \). Finally, estimate the model using Weighted Least Squares (WLS) with weights calculated as \( 1/\sqrt{\hat{h}} \).

The heteroskedasticity tests mentioned are the Breusch-Pagan test, White test, and a shorter version of the White test. These tests are used to detect the presence of heteroskedasticity, i.e., non-constant variance in the error terms of a regression model. In the context of an LPM, these tests are crucial as heteroskedasticity is expected due to the binary nature of the dependent variable. The White test doesn't assume a specific form for heteroskedasticity, while the Breusch-Pagan test does. The outcome of these tests can confirm heteroskedasticity, thereby guiding the use of robust regression techniques like WLS to produce reliable estimates .

Testing for the joint significance of variables such as 'ecoprc' and 'regprc' in a Linear Probability Model is crucial because it allows researchers to determine whether these variables, together, have a statistically significant relationship with the dependent variable, 'ecobuy'. This is important in econometric analysis to verify the explanatory power and relevance of multiple regressors in affecting the probability of an outcome. Conducting such tests ensures robustness of the model and helps in identifying key drivers of the response variable. It also helps counter multicollinearity issues, thereby improving the model's predictive performance .

Applying transformations to bring fitted values of a Linear Probability Model into the 0-1 interval can help make the model predictions more realistic since probabilities must logically be between 0 and 1. This step is critical for ensuring the feasibility of the predicted values but might also lead to some biases if the transformations are not carefully conducted. Such adjustments, like capping values below zero at 0.01 and values above one at 0.99, help in maintaining the predictions within a valid range for probabilities, although they can slightly distort the true relationships being modeled if not managed properly .

One might use model comparison between FGLS and WLS in econometric analysis to evaluate their relative effectiveness in addressing heteroskedasticity and ensuring robust estimation of parameters. FGLS and WLS offer different approaches to weighting observations and handling variance inconsistencies. Comparing these models allows researchers to determine which method better stabilizes the variance, improves the precision of estimates, and optimizes predictive performance. Such comparisons provide insights into model selection, validation, and the impact of heteroskedasticity correction techniques, thereby enhancing the comprehensiveness and reliability of econometric analyses .

The steps involved in using Feasible Generalized Least Squares (FGLS) to estimate a model in the presence of heteroskedasticity include: first, estimating the model by OLS and predicting the fitted values \( \hat{y}_i \). Next, ensure all fitted values lie within a feasible range (i.e., between 0 and 1) by applying necessary transformations. Then, construct the estimated variances \( \hat{h}_i = \hat{y}_i(1 - \hat{y}_i) \). Finally, use Weighted Least Squares (WLS) to estimate the model, applying weights \( 1/\sqrt{\hat{h}} \) to account for heteroskedasticity. This approach ensures efficiency and consistency in parameter estimation .

You might also like