Best Statistical Inference Quiz in R 14

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 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]

 
 
 
 

2. 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?

 
 
 
 

3. 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.

 
 
 
 

4. 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)

 
 
 
 

5. 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?

 
 
 
 

6. 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.

 
 
 
 

7. 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?

 
 
 
 

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

 
 
 
 

9. 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.)

 
 
 
 

10. 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?

 
 
 
 

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 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

 
 
 
 

13. 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.

 
 
 
 

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 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?

 
 
 
 

16. 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?

 
 
 
 

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 a number 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 a number 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

Important MCQs R Package Development 13

The post is about MCQs R Package Development Quiz. The quiz also contains questions about git. There are a total of 17 questions and some of the questions have multiple correct answers. Let us start with MCQs R Package Development.

Please go to Important MCQs R Package Development 13 to view the test

MCQs R Package Development with Answers

R FAQS Logo: MCQs R Package Development
  • Which of the following are good reasons to build an R Package?
  • Which of the following files and folders are required in an R package?
  • Which of the following files and subdirectories will be included in the initial package directory if you create a new package using the ‘create’ function from ‘devtools’?
  • Which of the following functions from the devtools package are you likely to use often, rather than just once per package, when building a package?
  • What is the purpose of the DESCRIPTION file in a package?
  • Which of the following statements correctly describes how R functions should be defined with the package directory?
  • How is attaching a package namespace different from loading a namespace?
  • For packages that require C code, what should be installed on your system?
  • What is the purpose of the Imports field in the DESCRIPTION file?
  • Which of the following are good reasons for open-sourcing your software?
  • When a test fails in a call to expect_that(), what happens?
  • What does the is_a() function do in the context of testthat?
  • In which sub-directory of an R package should tests be placed?
  • What is Git?
  • What is a pull request on GitHub?
  • The GNU General Public License is called a copyleft license because
  • What does the ::: operator do?

https://itfeature.com, https://gmstat.com

Important MCQs R Markdown Quiz 12

Online MCQs R Markdown Quiz with Answers. R Markdown is a way of generating fully reproducible documents, in which both text and code can be combined. Let us start with the MCQs R Markdown Quiz.

Please go to Important MCQs R Markdown Quiz 12 to view the test

MCQs R Markdown Quiz

MCQs R Markdown Quiz

  • A data analyst wants to find headers in their R Markdown document. What should they look for?
  • A data analyst has code chunks in their R Markdown file. How do they appear in an HTML report?
  • Fill in the blank: Markdown is a ———- for formatting plain text files.
  • A data analyst creates an interactive version of their R Markdown document to share with other users allowing them to execute code the analyst wrote. What did they create?
  • A data analyst wants to convert their R Markdown file into another format. What are their options?
  • A data analyst has finished editing their R Markdown file and wants to save it as an HTML report. What tool will they use?
  • What information does a data analyst usually find in the header section of an RMarkdown document?
  • To create bullet points in their output document, a data analyst adds ———- to their RMarkdown document.
  • A data analyst wants to embed a link in their RMarkdown document. They write (click here!)(www.rstudio.com) but it doesn’t work. What should they write instead?
  • A data analyst needs to create a shareable report in RStudio. They first want to change the default file format that gets exported by the Knit button to .pdf. What value should they use for the output field in the YAML header?
  • What is the purpose of the Knit button in R Studio?
  • A delimiter is a character that indicates the beginning or end of ———-.
  • R Markdown notebooks can be converted into HTML, PDF, and Word documents, slide presentations, and ———-.
  • A data analyst notices that their header is much smaller than they wanted it to be. What happened?
  • A data analyst wants to create documentation for their cleaning process so other analysts on their team can recreate this process. What tool can help them create this shareable report?
  • If an analyst creates the same kind of document over and over or customizes the appearance of a final report, they can use ———- to save them time.

MCQs in Statistics, R Data Analysis