In: Statistics and Probability
What are the R codes for these questions below:
1. Load the library {car}, which contains the Salaries data set.
#Then, list the first few records
with head(Salaries). The display the summmary() for this dataset,
which will shows frequencies.
Then, load the library {psych} which contains the describe()
function and use this function to list the descriptive statistics
for the dataset.
2. Load the coefplot library and display a coefficient plot for lm.fit.2 <- lm(salary~sex+yrs.since.phd, data=Salaries) using the coefplot() function. Divide the plot screen into 2 rows and 2 columns using par(mfrow=c(2,2)). Then plot all 4 regression plots for lm.fit.2 using the plot() function. Then, reset the plot screen to 1 row by 1 column using par(mfrow=c(1,1))