In: Statistics and Probability
1. Explain the R code. SAT_2010 <- mutate( SAT_2010, Salary =salary/1000)
Note: column name is case sensitive.
2. For the following R
code segment, answer the following questions a) and b)
SAT_plot <-ggplot(data =SAT_2010, aes(x=Salary, y =total))
+
geom_point()+geom_smooth( method ="lm") +
ylab("Average total score on the SAT")+
xlab("Average teacher salary (in thousands")
SAT_plot
a). Explain the code.
Specially, pay attention to the ggplot.
b). What will happen if we delete the last line: SAT_plot? Why?
2. What command in the 7.6 creates a variable called SAT_grp, how
is the variable's value determined? What sampling technique this is
called?
3. What is the cofounding factor in this case, and how does it affect the outcome?
4. Check the running outcome, and see if column Salary is added as
a new column, or as a replacement column for salary, explain the
reason.
5. In lm (x~y), what is the dependent variable, what is the independent variable?
b) if you delete last line SAT_plot you will not be able to show the plot you fitted.because you stored the plot object in SAT_plot.
Note: - For 2nd and 3rd questions data and required code not given.
4. Salary added as new column as i mentioned in the 1st question.
5. In lm (x~y), x is dependent variable and y is independent variable.