Attribution Non-Commercial (BY-NC)

75 views

Attribution Non-Commercial (BY-NC)

- Perceived Father Acceptance-rejection in Childhood
- Dummy Variables
- QuantileRegressionHRT (Artes & Crabb, 2009)
- StatusAsA-ValuedResource
- Students’ Variables as Predictor of Secondary School Students’ Performance in Physics
- Ols Chapter
- info system-datamining
- Eddy
- Optimization of Hydrolysis Degradation of Neurotoxic Pesticide Methylparathion Using a Response Surface Methodology (RSM)
- Tugas Mandiri Kemometri
- 097 Real-Time Traffic Measurement From Single Loop Inductive Signatures
- Factorial a Nova
- Anova-Analysis of Variance
- Dummy
- Optimization of Processing Conditions for Meat Paper From Beef Semimembranosus Muscle Using RSM
- Chapter 2
- Bio-RadTechNote2861 Principles of Curve Fitting
- a
- Stat Question
- CUSUM Analysis Using Multi Variable Regression-Data

You are on page 1of 10

Why include a qualitative independent variable? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Simplest model Simplest case . . . . . . . . . . . . . . . . . Example (continued) . . . . . . . . . . . . Possible solution: separate regressions Independent variable vs. regressor . . . Common slope model . . . . . . . . . . . Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

More general models More than one quantitative independent variable . Polytomous independent variables . . . . . . . . . . . Example (continued) . . . . . . . . . . . . . . . . . . . . Testing with polytomous independent variable . . . R commands . . . . . . . . . . . . . . . . . . . . . . . . . More than one qualitative independent variable . . Interaction Denition. . . . . . . . . . . . . . . . . . . . . . Interaction vs. correlation . . . . . . . . . . . Constructing regressors . . . . . . . . . . . . Testing . . . . . . . . . . . . . . . . . . . . . . . Principle of marginality . . . . . . . . . . . . Polytomous independent variables . . . . . Hypothesis tests . . . . . . . . . . . . . . . . . Standardized estimates. . . . . . . . . . . . . Interaction between categorical variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

I

We are interested in the eect of a qualitative independent variable (for example: do men earn more than women?) We want to better predict/describe the dependent variable. We can make the errors smaller by including variables like gender, race, etc. Qualitative variables may be confounding factors. Omitting them may cause biased estimates of other coecients. 2 / 26

Simplest model

Simplest case

I

3 / 26

Example:

N N N

Dependent variable: income One quantitative independent variable: education One dichotomous (can take two values) independent variable: gender

Assume eect of either independent variable is the same, regardless of the value of the other variable (additivity, parallel regression lines) - See pictures from book. Usual assumptions on statistical errors: independent, zero means, constant variance, normally distributed, xed X s or X independent of statistical errors. 4 / 26

Example (continued)

I

Suppose that we are interested in the eect of education on income, and that gender has an eect on income. See pictures from book. Scenario 1: Gender and education are uncorrelated

N N

I I

Gender is not a confounding factor Omitting gender gives correct slope estimate, but larger errors Gender is a confounding factor Omitting gender gives biased slope estimate, and larger errors 5 / 26

N N

I I

N N

How to test for the eect of gender? If it is reasonable to assume that regressions for men and women are parallel, then it is more ecient to use all data to estimate the common slope. 6 / 26

I

I I I

Independent variable = real variables of interest Regressor = variable put in the regression model In general, regressors are functions of the independent variables. Sometimes regressors are equal to the independent variables. 7 / 26

I I

Yi = + Xi + Di + i For women (Di = 0): Yi = + Xi + 0 + i = + Xi + i For men (Di = 1): Yi = + Xi + 1 + i = ( + ) + Xi + i See picture from book. What are the interpretations of , and ? What happens if we code D = 1 for women and D = 0 for men? 8 / 26

I I I

Testing

I

N N

H0 : = 0, Ha : = 0 Same as before: Compute t-statistic or incremental F-test H0 : = 0, Ha : = 0 Same as before: Compute t-statistic or incremental F-test 9 / 26

N N

More than one quantitative independent variable

I I I

10 / 26

All methods go through, as long as we assume parallel regression surfaces. Model: Yi = + 1 Xi1 + + k Xik + Di + i . Women (Di = 0): Yi = + 1 Xi1 + + k Xik + 0 + i = + 1 Xi1 + + k Xik + i

Interpretation of , 1 , . . . , k , . 11 / 26

I I

Qualitative variable with more than two categories Example: Duncan data:

N N N

Dependent variable: Y =prestige Quantitative independent variables: X1 =income and X2 =education Qualitative independent variable: type (bc, prof, wc)

D1 and D2 are regressors for type: Type D1 D2 Blue collar (bc) 0 0 Professsional (prof) 1 0 White collar (wc) 0 1 If there are p categories, use p 1 dummy regressors. What happens if we use p regressors? 12 / 26

Example (continued)

I I

Y = + 1 X1 + 2 X2 + 1 D1 + 2 D2 + Blue collar (Di1 = 0 and Di2 = 0): Yi = + 1 Xi1 + 2 Xi2 + 1 0 + 2 0 + i = + 1 Xi1 + 2 Xi2 + i

White collar (Di1 = 0 and Di2 = 1): Yi = + 1 Xi1 + 2 Xi2 + 1 0 + 2 1 + i = ( + 2 ) + 1 Xi1 + 2 Xi2 + i 13 / 26

I I I I

Test partial eect of type, i.e., the eect of type controlling for income and education. H0 : 1 = 2 = 0 Ha : at least one j = 0, j = 1, 2. Incremental F-test:

N N

I I

What do the individual p-values in summary(lm()) mean? First look at F-test, then at individual p-values 14 / 26

R commands

I

Creating dummy variables by hand: D1 <- (type=="prof")*1 D2 <- (type=="wc")*1 m1 <- lm(prestigeeducation+income+D1+D2) Letting R do things automatically: m1 <- lm(prestigeeducation+income+type) m1 <- lm(prestigeeducation+income+factor(type)) The use of factor():

N N N

factor() is not needed in this example, because the coding of the categories is in words: bc, prof, wc. It is essential to use factor() if the coding of the categories is numerical! To be safe, you can always use factor. 15 / 26

Example R-code

I

Example: Y =prestige, X1 =income, X2 =education, Type D1 D2 Blue collar 0 0 Professional 1 0 White collar 0 1 and Gender D3 Women 0 1 Men Y = + 1 X1 + 2 X2 + 1 D1 + 2 D2 + 3 D3 + What is the equation for men with professional jobs? And for women with white collar jobs? 16 / 26

I I

Interaction

Denition

I

17 / 26

Two variables are said to interact in determining a dependent variable if the partial eect of one depends on the value of the other. So far we only studied models without interaction. Interaction between a quantitative and a qualitative variable means that the regression surfaces are not parallel. See picture. Interaction between two qualitative variables means that the eect of one of the variables depends on the value of the other variable. Example: the eect of type of job on prestige is bigger for men than for women. Interaction between two quantitative variables is a bit harder to interpret, and we may consider that later. 18 / 26

I I

I I

First, note that in general, the independent variables are not independent of each other. Correlation: Independent variables are statistically related to each other. Interaction: Eect of one independent variable on the dependent variable depends on the value of the other independent variable. Two independent variables can interact whether or not they are correlated. 19 / 26

Constructing regressors

I I I

Y =income, X =education, D=dummy for gender Yi = + Xi + Di + (Xi Di ) + i Note X D is a new regressor. It is a function of X and D, but not a linear function. Therefore we do not get perfect collinearity. Women (Di = 0): Yi = + Xi + 0 + (Xi 0) + i = + Xi + i Men (Di = 1) Yi = + Xi + 1 + (Xi 1) + i = ( + ) + ( + )Xi + i

Interpretation of , , , . 20 / 26

Testing

I

Testing for interaction is testing for a dierence in slope between men and women. H0 : = 0 and Ha : = 0. What is the dierence between:

N N

The model with interaction Fitting two separate regression lines for men and women 21 / 26

Principle of marginality

I

N N

First test for interaction eect. If no interaction, test and interpret main eects.

I I

If interaction is included in the model, main eects should also be included. See pictures of models that violate the principle of marginality. 22 / 26

I

Create interaction regressors by taking the products of all dummy variable regressors and the quantitative variable. Example:

N N

Y = + 1 X1 + 2 X2 + 1 D1 + 2 D2 + 11 X1 D1 + 12 X1 D2 + 21 X2 D1 + 22 X2 D2 +

I

Interpretation of parameters 23 / 26

Hypothesis tests

I I I

When testing for main eects and interactions, follow principle of marginality Use incremental F-test Examples in R-code 24 / 26

Standardized estimates

I I I

Do not standardize dummy-regressor coecients. Dummy regressor coecient has clear interpretation. By standardizing it, this interpretation gets lost. Therefore we dont standardize dummy regressor coecients. Also, dont standardize interaction regressors. You can standardize the quantitative independent variable before taking its product with the dummy regressor. 25 / 26

I I

N N N N N

male ies with 1 pregnant (not receptive) female per day male ies with 8 pregnant females per day male ies with 1 virgin (receptive) female per day male ies with 8 virgin females per day male ies without females

I I

N N N

See plots

10

- Perceived Father Acceptance-rejection in ChildhoodUploaded byOanaMihaela
- Dummy VariablesUploaded byapi-26942617
- QuantileRegressionHRT (Artes & Crabb, 2009)Uploaded byPaul H Artes
- StatusAsA-ValuedResourceUploaded byDavid Pareira
- Students’ Variables as Predictor of Secondary School Students’ Performance in PhysicsUploaded byIJSRP ORG
- Ols ChapterUploaded byshinde_jayesh2005
- info system-dataminingUploaded byRadhika Shanmugam
- EddyUploaded byOloye Elayela
- Optimization of Hydrolysis Degradation of Neurotoxic Pesticide Methylparathion Using a Response Surface Methodology (RSM)Uploaded byIOSRjournal
- Tugas Mandiri KemometriUploaded byDyah Indra
- 097 Real-Time Traffic Measurement From Single Loop Inductive SignaturesUploaded byRashad M. El-Etreby
- Factorial a NovaUploaded bysearchshri
- Anova-Analysis of VarianceUploaded byAlex Rengifo-Rojas
- DummyUploaded bymushtaque61
- Optimization of Processing Conditions for Meat Paper From Beef Semimembranosus Muscle Using RSMUploaded byWalter Vega Fernández
- Chapter 2Uploaded byvijaydh
- Bio-RadTechNote2861 Principles of Curve FittingUploaded byyumyum9
- aUploaded byAbul Lais Nalband
- Stat QuestionUploaded byRano Joy
- CUSUM Analysis Using Multi Variable Regression-DataUploaded byaks5884
- Am J Clin Nutr 1990 Rowland 1125 33Uploaded byAlina Popa
- g8m6 key study guide statisticsUploaded byapi-276774049
- An Algorithm for Identifying Nonsystematic Delay-DUploaded byhsvm1989
- Contingency TheoryUploaded bystudentsarah
- da3x3xcanovausingSPSSGLMUNIVARIATEb.pdfUploaded byAnonymous RL1sO4CM
- SimpleLinearRegression.pdfUploaded bykappi4u
- BookUploaded byPalakshVismay
- Polymath Nonlinear Regression TutorialUploaded byparryaman
- New empirical model to evaluate groundwater ﬂow into circular tunnel using multiple regression analysisUploaded byAn Ho Taylor
- Research Paper Effect of Mobile Banking on Customer-823Uploaded byamittaneja28

- Context_shaping the English CharacterUploaded byFrancesco Guarneri
- HUMANKIND AT A CROSSROADS: A CALL TO ACTION!!!Uploaded bylaurentratar
- The International Journal of Engineering and Science (The IJES)Uploaded bytheijes
- Steve Martinot & Jared Sexton - The Avantgarde of White SupremacyUploaded byMxolisi Bob Thabethe
- 15144986Uploaded byAnonymous PkeI8e84Rs
- Econ 106G Homework 1 - SolutionUploaded byAmmar Diwan
- 1999 Psych TestUploaded bybats_robyn
- Addressing Moderated Mediation Preacher Rucker Hayes 2007Uploaded byPayal Anand
- Crystals in BuddhismUploaded bySean Griffin
- The Rio Declaration report for Environmental LawUploaded bydminoza
- Chapter 06Uploaded bygttrans111
- Sri Gadadharastakam.docUploaded byIronChaves
- Sunu1....Uploaded byKaan Uçum
- TeachingsofVedantaByRamanuja-SukhantkarUploaded byAnonymous gJEu5X03
- Arabian Nights by Richard Burton Part 8Uploaded bymranka
- M20 - Mage Translation Guide.pdfUploaded byDaniel Braga
- New Dialect Formation (The Inevitability of Colonial English) by Peter Trudgill.pdfUploaded byFrank Tatel
- Atmakaraka PART 1Uploaded byTushar Kumar Bhowmik
- Game of Thrones a Romantic ComedyUploaded byunanimous999
- Physics for You - October 2016Uploaded byRishikeshKumar
- 128 The SwudhoorUploaded byImtiaz Muhsin
- Influence Without AuthorityUploaded byLakshmikanth Lazy Kanth
- thmtoolsUploaded byGilmer Calderon Quispe
- Portacle Transform Protocol OneUploaded byJonnie Gunther
- BUS103Uploaded byAnonymous 8iLcp9c
- connected communitites checklist 2015Uploaded byapi-297874252
- Eagleton the Contradictions of Postmodernism 2Uploaded bybensmithkeys
- when_anthropology_is_at_home.pdfUploaded byNilson Almino
- copy of eng2h q1 self assessment log revised june 2017Uploaded byapi-378183458
- SM PptUploaded byamy2094

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.