Download presentation
Presentation is loading. Please wait.
Published byBenjamin Gordon Modified over 8 years ago
1
Before the class starts: Login to a computer Read the Data analysis assignment 1 on MyCourses If you use Stata: Start Stata Start a new do file Open the PDF documentation about regression If you use RStudio: Start RStudio Start a new R script Open R in Action, chapter 8
2
Maximum likelihood estimation
3
A better approach Fit a curve instead of a line The example is the logit function Interpretation stays the same: Expected value of Menarche given Age i.e. probability
4
Model Linear regression model y = β 0 + β 1 x 1 + β 2 x 2 + … + β k x k + u Nonlinear regression model y = g(β 0 + β 1 x 1 + β 2 x 2 + … + β k x k ) +u g(x) = 1/(1+e -x ) Remarks The inverse of g(x), f(x) is called link function f(x) = ln(x/1-x) is the logit function f(x) = x reduces to linear regression model Wooldridge, J. M. (2009). Introductory econometrics: a modern approach (4th ed). Mason, OH: South Western, Cengage Learning., Section 17.1
5
Basic principle Population has bernoulli distribution Only 0 and 1 Relative frequencies of 0 and 1 unknown The population is very large The estimation principle: Find the relative frequency that will maximize the likelihood of the sample Observed value ProbabilityCumulative Probability 0?? 0?? 0?? 0?? 0?? 0?? 0?? 1?? 1?? Sample of 9 observations Likelihood of the sample Maximum likelihood estimate
6
Example AgeMenarcheFittedpln(p) Girl 113.6173.6% -0.306 Girl 211.408.0%92.0%-0.083 Girl 312.6135.2% -1.045 Girl 413.1156.2% -0.576 Girl 512.6034.6%65.4%-0.425 Girl 610.301.5%98.5%-0.015 Girl 710.201.3%98.7%-0.013 Girl 815.4197.8% -0.022 Girl 915.2196.9% -0.031 Girl 1013.8179.2% -0.233 Likelihood(product)6.4% Log-likelihood(sum)-2.749 Menarche = g(-20.0 + 1.54 Age) + u
7
Example data A researcher is interested in how variables, such as 1.GRE (Graduate Record Exam scores), 2.GPA (grade point average) and 3.prestige of the undergraduate institution, effect admission into graduate school. The response variable, admit/don't admit, is a binary variable. The variable rank takes on the values 1 through 4. Institutions with a rank of 1 have the highest prestige, while those with a rank of 4 have the lowest. http://www.ats.ucla.edu/stat/stata/dae/logit.htm
8
Excel example
9
Normally distributed example Observed value Probability density Cumulative probability density -0.8970.205 0.1850.4070.084 1.5880.160.013 -1.130.1510.002 -0.080.3860.001 0.1320.4050.0003 0.7080.3660.0001 -0.240.360.00004 1.9840.0850.000003 Sample of 9 observations Likelihood of the sample Population has normal distribution Mean and SD are estimated
10
Cumulative probability and probability density
11
Excel example
12
Data analysis assignment 2
13
Task Do a moderation and a mediation analysis with a statistical software of your choice using the approaches presented by Baron and Kenny (1986) using the Prestige dataset used in the class. Answer the following two research questions: 1.Are women dominated professions rewarded less for prestigiousness than men dominated professions? 2.To what extent can the positive relationship between education and income mediated by prestigiousness? You can explain either income or if you see it necessary, the logarithm of income.
14
How to get your analysis file started Stata Load the data following the instructions Explore the data using e.g. describe, summarize, inspect, codebook, graph matrix, and stem RStudio Load the data following the instructions Load the psych, car, effects, and texreg packages by adding library command to start of the R file. (If a package is not found, you need to install it) Explore the data using e.g. describe, lowerCor, corr.test, and scatterplotMatrix
15
How to submit your answer Stata Set your working directory Start your do file with log using assingment1, replace text End your do file with log close After each graph add graph export plotX.pdf Open the Word document template from MyCourses Copy-paste the content of assignment1.log to the document template and insert the exported figures into right places. In word, write comments in normal style and use headings where appropriate RStudio Compile a notebook in MS Word format In word, write comments in normal style and use headings where appropriate
16
Are women dominated professions rewarded less for prestigiousness than men dominated professions?
17
Workflow of the analysis Stata Use nestreg, test, or ftest for nested model test and margins and marginsplot for marginal effects RStudio Load the effects package Use anova for nested model test and effect and plot for marginal effects 1.Fit a model with direct effects only (done already as a part of the previous assignment) 2.Add the interaction term to the model and compare the models with a nested model test (F test) 3.Do an inteaction plot 4.Interpret the results paying particular attention to interpreting effect sizes
18
To what extent can the positive relationship between education and income mediated by prestigiousness?
19
Workflow of the analysis Stata Use the user written sgmediation command or online calculator RStudio Calculate sobel test manually by calculating the z statistic and testing it with pnorm or use the online calculator 1.Fit a model of Y on X and controls 2.Fit a model of M on X and controls 3.Fit a model of Y on X, M, and controls 4.Calculate the sobel test (http://quantpsy.org/sobel/sobel.htm) 5.Interpret the results paying particular attention to interpreting effect sizes
20
Simulation demonstration: heteroskedasticity
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.