Let's get practical (Stats, R and Study Design) Flashcards
Calculate the median for the following numbers:
23, 56, 87, 30, 28, 45, 66, 18, 49, 48
Step 1: Sorting
18, 23, 28, 30, 45, 48, 49, 56, 66, 87
Step 2: Calculating
(45 + 48) / 2 = 46,5
Calculate the median for the following numbers:
23, 56, 87, 30, 28, 45, 66, 18, 49, 48, 55
Step 1: Sorting
18, 23, 28, 30, 45, 48, 49, 55, 56, 66, 87
Step 2: Pick the middle (odd numbers)
48
Calculate the mean:
4, 2, 3, 1, 1, 5, 4, 4
( 4 + 2 + 3 + 1 + 1 + 5 + 4 + 4) / 8 = 3
Calculate the median for the folowing numbers:
4, 2, 3, 1, 1, 5, 4, 4
Step 1: Sorting
1, 1, 2, 3, 4, 4, 4, 5
Step 2: Calculating
(3 + 4) / 2 = 3,5
What is the mode from this numbers?
5,2,1,2,6
Mode = 2
What is the mode for the following data set?
5, 6, 7, 7, 9, 5, 7, 5, 10, 7, 12, 5
Mode1 = 5
Mode2 = 7
Calculation with R
You have the variable x and want to assign the integer “5” to it. How can we do that?
x <- 5
Calculation with R
You want to assign an vector with x=1, y=2 and z=3 in the variable myVector. How do that work?
myvector <- c(1,2,3)
Calculation with R
What is the output of the following function:
seq(1,5,1)
1 2 3 4 5
Calculation with R
What is the output of the following code:
variable <- c(10,10,11,12,13,14,15)
unique(variable)
unique() removes duplicates
10 11 12 13 14 15
Calculation with R
Write a function that only prints even numbers from this array:
variable <- c(1,2,3,4,5,6,7,8,9,10)
Calculation with R
What is the output from this function?
0, 10, 20, 30
Calculation with R
How does the ouput from the following function look like?
Calculation with R
What is the meaning of “criterion = 5” in this function:
It is the default parameter that will be set if no paramter is handed over.
Calculation with R
What is the output of this function:
1