This problem makes use of the Carseats
dataset in he ISLR2
package.
Sales
, fit
a linear model to predict Sales
using that quantitative variable.
Report the p-values associated with the coefficients for the variables.
That is, for each model of the form \(Y = \beta_0 + \beta_1 X + \epsilon\),
report the p-value associated with the coefficient \(\beta_1\). Here, \(Y\)
represents Sales and \(X\) represents one of the other quantitative
variables. Store the p-values in a variable p.values
. (check the example code below)
rejected.null.hypotheses
. Hint: you can make use of the function which()
.
Which null hypotheses do we reject using that least conservative method? Store the adjusted p-values in p.values.fwer
and store your answer in the variable rejected.null.hypotheses.FWER
.
p.values.fdr
and store your answer in the variable rejected.null.hypotheses.FDR
.Assume that:
ISLR2
library has been loaded.Carseats
dataset has been loaded and attached.