Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Economics D Question 1 Load the Tutorial 3 dataset tute3_cps.csv in R. Run a single linear regression where 'ahe' is the dependent variable and 'age'

image text in transcribedimage text in transcribed
image text in transcribedimage text in transcribed
Economics D Question 1 Load the Tutorial 3 dataset tute3_cps.csv in R. Run a single linear regression where 'ahe' is the dependent variable and 'age' is the independent variable. In equation form, the regression equation is: ahe = BO + B1 age + u, where u is a homoskedastic error term. What is the standard error for BO from this regression? O 5.161 O 4.383 O 0.849 O 0.028 D Question 2 Using the regression estimates from Question 1, what is the p-value for the test of the null hypothesis that B1 = 0.45 versus the alternative that B1 != 0.45, where "!=" means "not equals"? Choose the value that is closest to the value that you compute. O 0.000001 O 0.017 O 0.049 O 0.092 D Question 3 Using the regression estimates from Question 1, which of the following is a correct interpretation based on the B1 estimate? 10 years older is associated with a $506 increase in average hourly earnings 5 years younger is associated with a $2.53 decrease in average hourly earnings O 3 years younger is associated with a $15.18 increase in average hourly earnings 7 years older is associated with a $30.68 increase in average hourly earnings119 120 # Let's start with descriptive statistics to get a feel for the data 121 122 ## A. DESCRIPTIVE STATISTICS FOR ENTIRE DATASET 123 stargazer(data, 124 summary . stat = c("n", "mean", "sd", "median", "min", "max"), 125 type="text", title="Descriptive Statistics", 126 out="sumstats. txt") 127 128 129 # B. DESCRIPTIVES FOR SUBSETS OF DATA 130 # Here, we use the summary() and sd() commands to obtain all of the relevant 131 # summary statistics for different subgroups of data. This does not immediately 132 # provide a "nice" table like stargazer does, but the code is much simpler 133 # than what is required for stargazer for looking at summary statistics 134 # for subsets of data 135 136 ## Compare means and standard deviation for ahe for females and males 137 # Females 138 summary(data$ahe[data$female==1]) # summary(): summary statistics except std dev. 139 sd(data$ahe [data$female==1]) # sd(): std dev. 140 141 # Males 142 summary (data$ahe[data$female==0]) 143 sd(data$ahe [data$female==0]) 144 145 ## Compare means and standard deviation for ahe for bachelor degrees and no bachelor degrees 146 # Bachelor Degree 147 summary(data$ahe[data$bachelor--1]) 148 sd(data$ahe [data$bachelor==1]) 149 LUy 210 # B. COMPUTING CIS BY HAND, 90%, 95%, 99% CIs 211 # Compute the 95% CI for AHE by hand (example) 212 ahe_mu=mean(data$ahe) # Sample mean of ahe 213 ahe_nobs=length(data$ahe) # Number of observations; length() returns the number of obs in ahe 214 ahe_sd=sd(data$ahe) # Sample standard deviation of ahe 215 ahe_se=ahe_sd/sqrt(ahe_nobs) # Standard error of the sample mean 216 ahe_CI95_low-ahe_mu-1*ahe_se # Lower bound of the 95% CI 217 ahe_CI95_high-ahe_mu+1*ahe_se # Upper bound of the 95% CI 218 219 # Output CI results using 'paste' command for printing words and numbers on the same line 220 paste("95% CI Lower Bound: ", ahe_(195_low) 221 paste("95% CI Upper Bound: ", ahe_(195_high) 222 223 # Re-run t. test(data$ahe,mu=10) code to see 95% CI 224 # Confirm it is the same as what we computed by hand at [19.24, 19.56] 225 t. test(data$ahe, mu=4. 08926) 226 227 # Computing 90% CI for ahe by hand 228 ahe_CI90_low-ahe_mu-1.65*ahe_se 229 ahe_CI90_high=ahe_mu+1.65*ahe_se 230 231 # Computing 99% CI for ahe by hand 232 ahe_CI90_low-ahe_mu-2.58*ahe_se 233 ahe_CI90_high=ahe_mu+2.58*ahe_se 234 235 236 # C. ONE-SIDED HYPOTHESIS TESTS 237 # We can also compute p-values for one-sided hypothesis tests by computing the 238 # t-statistic by hand, and then using the CDF of the N(0,1) distribution 239 as aun . oc . 7+nillaun=1fill OCT1-auIn cc7 234 235 236 # C. ONE-SIDED HYPOTHESIS TESTS 237 # We can also compute p-values for one-sided hypothesis tests by computing the 238 # t-statistic by hand, and then using the CDF of the N(0, 1) distribution 239 240 # p-value for one-sided hypothesis test that the mean of ahe is greater than 19.5 241 # To compute the p-value we use the pnorm() command, where phorm(X) returns the 242 # value of the cumulative density function for the N(0, 1) distribution at X 243 t_act=(ahe_mu-19.5)/ahe_se # t-statistic pvalue1=1-pnorm(t_act) # compute p-value 245 paste("One-sided p-value for greater than (>) alternative:", pvalue1) 246 247 # p-value for one-sided hypothesis test that the mean of ahe is less than 19.5 248 t_act=(ahe_mu-19.5)/ahe_se # t-statistic 249 pvalue2=pnorm(t_act) # compute p-value 250 paste("One-sided p-value for less than (

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Business Law

Authors: Jeffrey F. Beatty, Susan S. Samuelson, Patricia Abril

6th Edition

1337404349, 978-1337404341

More Books

Students also viewed these Economics questions

Question

Gay, lesbian, bisexual, and transgender issues in sport

Answered: 1 week ago

Question

issuing shares of stock in exchange for cash is an example of

Answered: 1 week ago