Datasets for this assignment:

A random sample of 1,000 federal personnel records for March 1994:

General Social Survey 1998:


For those who prefer to work with RCloud, a project with the same materials can be accessed using the following link:



Load Libraries

library(dplyr)



INFERENCE FOR NUMERIC DATA

Load OPM94.RData

# your work


1. Confidence Interval for a Population Mean Calculated Manually

Examples for this section are provided on the following page: https://yuriygdv.github.io/pmap4041spring2020/week13.html

What is the mean salary in the sample of federal employees?

# your work

What is the standard deviation of salary in the sample?

# your work

What is the variability of the sample mean salary

Variability of the sample mean salary is the same as: Standard deviation of the sample mean / Standard deviation of the of the sampling distribution for the sample mean / Standard error. All of these are interchangeable terms.

# your work

Find the critical value t* of the t-statistic for 95% confidence level:

# your work

Calculate the 95% confidence interval for the mean salary in the population of federal employees:

# your work
              # lower bound
              # upper bound

What is your conclusion?

... Your written answer ...


2. Confidence Interval for a Population Mean Calculated in R

Run a t-test and obtain the same confidence interval using t.test() function:

# your work

Does the result match with the one you obtained manually?

... your written answer ...


3. Difference in means

Does the mean salary of men differ from the mean salary of women in the population of federal employees? If so, by how much? Run a t-test and explain the results.

# your work


4. Inference for Regression

Regress salary on minority and print out the regression output (summary):

# your work

Interpret the regression coefficient on minority. What does this regression tell us about the relationship between salary and minority status in the population of federal employees in 1994?

... your written answer ...

Interpret the confidence interval for minority:

... Your written answer ...

Regress salary sal on yos + edyrs + male + patco + vet + age . Print out regression summary and confidence intervals.

# your work

What can you conclude about the relationship between salary and minority status in the population? How is the result different from the previous one and why?

...Your written answer ...




INFERENCE FOR CATEGORICAL DATA

Load gss98 dataset and library descr

# your work

Variable NATEDUC measures American’s attitudes towards public spending on education using the following survey question: Are we spending too much, too little, or about the right amount on improving the nation’s education system?

Construct a contingency table for NATEDUC as the response variable and IDEOLOGY as the explanatory variable (use one of the two methods presented in the course materials):

# your work

Describe the relationship between NATEDUC and IDEOLOGY in the sample?

... Your written answer ...

Do the attitudes towards public spending on education change across different ideologies in the U.S. population?

... Your written answer ...




Knit and publish your work on RPubs.

Yuriy Davydenko 2020