0
0
R Programmingprogramming~10 mins

t-test in R Programming - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to perform a t-test on two numeric vectors x and y.

R Programming
result <- t.test([1], y)
Drag options to blanks, or click blank then click option'
Ax
Bmean
Ct.test
Dy
Attempts:
3 left
💡 Hint
Common Mistakes
Using the function name instead of a variable.
Passing the wrong variable as the first argument.
2fill in blank
medium

Complete the code to perform a paired t-test on vectors a and b.

R Programming
t.test(a, b, paired = [1])
Drag options to blanks, or click blank then click option'
ANULL
BTRUE
CNA
DFALSE
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to set paired = TRUE for paired tests.
Using paired = FALSE which runs an unpaired test.
3fill in blank
hard

Fix the error in the code to test if the mean of vector data is different from 5.

R Programming
t.test(data, mu = [1])
Drag options to blanks, or click blank then click option'
A5
BNULL
Cmean(data)
D"5"
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the number as a string with quotes.
Using the sample mean instead of the hypothesized mean.
4fill in blank
hard

Fill both blanks to perform a one-sided t-test checking if mean of x is greater than 10.

R Programming
t.test(x, mu = [1], alternative = [2])
Drag options to blanks, or click blank then click option'
A10
B"less"
C"greater"
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong alternative hypothesis string.
Setting mu to a wrong value.
5fill in blank
hard

Fill all three blanks to perform a two-sample t-test assuming unequal variances between groups a and b.

R Programming
t.test([1], [2], var.equal = [3])
Drag options to blanks, or click blank then click option'
Aa
Bb
CFALSE
DTRUE
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the sample vectors.
Setting var.equal to TRUE when variances are unequal.