Statistical Inference Quiz in R 13

The article contains a Statistical Inference quiz in R language with Answers. There are 16 questions in the “Statistical Inference Quiz in R Language”. The MCQs are from probability and regression models. Let us Start with the Statistical Inference Quiz in R.

Statistical Inference Quiz in R Language

1. Consider the mtcars data set. Fit a model with mpg as the outcome that includes numbers of cylinders as a factor variable and weight as a possible confounding variable. Compare the effect of 8 versus 4 cylinders on mpg for the adjusted and unadjusted by-weight models. Here, adjusted means including the weight variable as a term in the regression model and unadjusted means the model without weight included. What can be said about the effect comparing 8 and 4 cylinders after looking at models with and without weight included?

 
 
 
 

2. Suppose that diastolic blood pressures (DBPs) for men aged 35-44 are normally distributed with a mean of 80 (mm Hg) and a standard deviation of 10. About what is the probability that a random 35-44-year-old has a DBP less than 70?

 
 
 
 

3. The number of people showing up at a bus stop is assumed to be Poisson with a mean of 5 people per hour. You watch the bus stop for 3 hours. About what’s the probability of viewing 10 or fewer people?

 
 
 
 

4. Brain volume for adult women is normally distributed with a mean of about 1,100 cc for women with a standard deviation of 75 cc. What brain volume represents the 95th percentile?

 
 
 
 

5. Consider the following data set
x <- c(0.8, 0.47, 0.51, 0.73, 0.36, 0.58, 0.57, 0.85, 0.44, 0.42)
y <- c(1.39, 0.72, 1.55, 0.48, 1.19, -1.59, 1.23, -0.65, 1.49, 0.05)
Fit the regression through the origin and get the slope treating $y$ as the outcome and $x$ as the regressor.

(Hint, do not center the data since we want regression through the origin, not through the means of the data.)

 
 
 
 

6. Do data(mtcars) from the datasets package and fit the regression model with mpg as the outcome and weight as the predictor. Give the slope coefficient.

 
 
 
 

7. Consider the following data set

x <- c(0.586, 0.166, -0.042, -0.614, 11.72)
y <- c(0.549, -0.026, -0.127, -0.751, 1.344)

Give the slope dfbeta for the point with the highest hat value.

influence.measures(fit5)$infmat[which.max(abs(influence.measures(fit5)$infmat[, 2])), 2]

 
 
 
 

8. Consider the following data set
x <- c(0.586, 0.166, -0.042, -0.614, 11.72)
y <- c(0.549, -0.026, -0.127, -0.751, 1.344)
Give the hat diagonal for the most influential point

 
 
 
 

9. Consider the following data set. What is the intercept for fitting the model with $x$ as the predictor and $y$ as the outcome?
x <- c(0.8, 0.47, 0.51, 0.73, 0.36, 0.58, 0.57, 0.85, 0.44, 0.42)
y <- c(1.39, 0.72, 1.55, 0.48, 1.19, -1.59, 1.23, -0.65, 1.49, 0.05)

 
 
 
 

10. Consider the mtcars data set. Fit a model with mpg as the outcome that includes a number of cylinders as a factor variable and weight as a confounder. Give the adjusted estimate for the expected change in mpg comparing 8 cylinders to 4.

 
 
 
 

11. Consider the mtcars data set. Fit a model with mpg as the outcome that considers numbers of cylinders as a factor variable and weight as a confounder. Now fit a second model with mpg as the outcome model that considers the interaction between numbers of cylinders (as a factor variable) and weight. Give the P-value for the likelihood ratio test comparing the two models and suggest a model using 0.05 as a type I error rate significance benchmark.

 
 
 
 

12. Consider the mtcars data set. Fit a model with mpg as the outcome that includes the number of cylinders as a factor variable and weight included in the model as

lm(mpg ~ I(wt * 0.5) + factor(cyl), data = mtcars)

How is the wt coefficient interpreted?

 
 
 
 

13. Consider the following PMF shown below in R
x <- 1:4
p <- x/sum(x)
temp <- rbind(x, p)
rownames(temp) <- c("X", "Prob")
temp
What is the mean?

 
 
 
 

14. Consider a standard uniform density. The mean for this density is 0.5 and the variance is 1 / 12. You sample 1,000 observations from this distribution and take the sample mean, what value would you expect it to be near?

 
 
 
 

15. The respiratory disturbance index (RDI), a measure of sleep disturbance, for a specific population has a mean of 15 (sleep events per hour) and a standard deviation of 10. They are not normally distributed. Give your best estimate of the probability that a sample average RDI of 100 people is between 14 and 16 events per hour.

 
 
 
 

16. You flip a fair coin 5 times, about what’s the probability of getting 4 or 5 heads?

 
 
 
 


Statistical Inference Quiz in R Language

Statistical Inference Quiz in R with Answers

  • Consider the following PMF shown below in R
    x <- 1:4 p <- x/sum(x)
    temp <- rbind(x, p)
    rownames(temp) <- c(“X”, “Prob”)
    temp
    What is the mean?
  • Suppose that diastolic blood pressures (DBPs) for men aged 35-44 are normally distributed with a mean of 80 (mm Hg) and a standard deviation of 10. About what is the probability that a random 35-44-year-old has a DBP less than 70?
  • Brain volume for adult women is normally distributed with a mean of about 1,100 cc for women with a standard deviation of 75 cc. What brain volume represents the 95th percentile?
  • You flip a fair coin 5 times, about what’s the probability of getting 4 or 5 heads?
  • The respiratory disturbance index (RDI), a measure of sleep disturbance, for a specific population has a mean of 15 (sleep events per hour) and a standard deviation of 10. They are not normally distributed. Give your best estimate of the probability that a sample average RDI of 100 people is between 14 and 16 events per hour.
  • Consider a standard uniform density. The mean for this density is 0.5 and the variance is 1 / 12. You sample 1,000 observations from this distribution and take the sample mean, what value would you expect it to be near?
  • The number of people showing up at a bus stop is assumed to be Poisson with a mean of 5 people per hour. You watch the bus stop for 3 hours. About what’s the probability of viewing 10 or fewer people?
  • Consider the mtcars data set. Fit a model with mpg as the outcome that includes a number of cylinders as a factor variable and weight as a confounder. Give the adjusted estimate for the expected change in mpg comparing 8 cylinders to 4.
  • Consider the mtcars data set. Fit a model with mpg as the outcome that includes the number of cylinders as a factor variable and weight included in the model as
    lm(mpg ~ I(wt * 0.5) + factor(cyl), data = mtcars)
    How is the wt coefficient interpreted?
  • Consider the following data set
    x <- c(0.586, 0.166, -0.042, -0.614, 11.72)
    y <- c(0.549, -0.026, -0.127, -0.751, 1.344)
    Give the hat diagonal for the most influential point
  • Consider the following data set
    x <- c(0.586, 0.166, -0.042, -0.614, 11.72)
    y <- c(0.549, -0.026, -0.127, -0.751, 1.344)
    Give the slope dfbeta for the point with the highest hat value. influence.measures(fit5)$infmat[which.max(abs(influence.measures(fit5)$infmat[, 2])), 2]
  • Consider the mtcars data set. Fit a model with mpg as the outcome that includes numbers of cylinders as a factor variable and weight as a possible confounding variable. Compare the effect of 8 versus 4 cylinders on mpg for the adjusted and unadjusted by-weight models. Here, adjusted means including the weight variable as a term in the regression model and unadjusted means the model without weight included. What can be said about the effect comparing 8 and 4 cylinders after looking at models with and without weight included?
  • Consider the mtcars data set. Fit a model with mpg as the outcome that considers numbers of cylinders as a factor variable and weight as a confounder. Now fit a second model with mpg as the outcome model that considers the interaction between numbers of cylinders (as a factor variable) and weight. Give the P-value for the likelihood ratio test comparing the two models and suggest a model using 0.05 as a type I error rate significance benchmark.
  • Consider the following data set
    x <- c(0.8, 0.47, 0.51, 0.73, 0.36, 0.58, 0.57, 0.85, 0.44, 0.42)
    y <- c(1.39, 0.72, 1.55, 0.48, 1.19, -1.59, 1.23, -0.65, 1.49, 0.05)
    Fit the regression through the origin and get the slope treating $y$ as the outcome and $x$ as the regressor. (Hint, do not center the data since we want regression through the origin, not through the means of the data.)
  • Do data(mtcars) from the datasets package and fit the regression model with mpg as the outcome and weight as the predictor. Give the slope coefficient.
  • Consider the following data set. What is the intercept for fitting the model with $x$ as the predictor and $y$ as the outcome?
    x <- c(0.8, 0.47, 0.51, 0.73, 0.36, 0.58, 0.57, 0.85, 0.44, 0.42)
    y <- c(1.39, 0.72, 1.55, 0.48, 1.19, -1.59, 1.23, -0.65, 1.49, 0.05)

Sampling and Sampling Distributions Quiz with Answers

Intermediate Mathematics Part-I Quiz with Answers

Leave a Reply

Discover more from R Language Frequently Asked Questions

Subscribe now to keep reading and get access to the full archive.

Continue reading