With regards to set.seed().
As long as we put the same number in
set.seed() then the same data will be created.
set.seed command. What this does is makes sure the βrandomβ data creation is the same no matter who is creating the data.
set.seed() is the equivalent to that deck of cards being shuffled in a specific order, that way, if it is shuffled that way every single time, each player is going to be dealt the same cards.
set.seed() then the same data will be created.
rnorm() command to dictate quantity, mean, and standard deviation of each.
library(tidyverse)
set.seed(123) # ensures reproducibility
memory <- tibble(
method = rep(c("Flashcards", "Rereading", "Testing"), each = 20),
score = c(
rnorm(20, mean = 75, sd = 8), # Flashcards group
rnorm(20, mean = 70, sd = 9), # Rereading group
rnorm(20, mean = 85, sd = 7) # Testing group
)
)
glimpse(memory)
Rows: 60 Columns: 2 $ method <chr> "Flashcards", "Flashcards", "Flashcards", "Flashcards", "Flashcβ¦ $ score <dbl> 70.51619, 73.15858, 87.46967, 75.56407, 76.03430, 88.72052, 78.β¦