student: David K student_id: 10101010 url: http://127.0.0.1/lab_04.Rmd pubkey: MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECEBmlRqws4b7xZSp4dhunPFrpRXbsqF9gPIsihjqOqC3lSpqnvenZmx3WD9A1+uw65vbCYfbyGIav343Y1frVg== signature: MEYCIQCtxksHFKhvneJbyCtLrALRrhdqVt5uG0DQwb5l47rOSQIhAIH4V10Me3plx7Ubci+ZXLBBHX5cBCtuB1ww69UUOoEe;MEYCIQChEz+v4AqGA4pIssu18YdbqjKvKuC7uH+FMYnzDTA4zAIhAJlR6o7MmWjOKPBaZo7xCyhkGjcpdHdCbO8xOqkey8h9
125
100
0.15
0.45
0.1
0.3
1
## Fill in the probabilities column wise.
observed_frequencies <- matrix(rmultinom(1, size = 125, prob = c(0.15, 0.45, 0.10, 0.30)), nrow = 2)
# the matrix function creates a 2 by 2 table by specifying nrow = 2
observed_frequencies
[,1] [,2]
[1,] 24 10
[2,] 50 41
## Chose the right logical indicator
observed_frequencies
chisq.test(observed_frequencies, correct = FALSE)
[,1] [,2]
[1,] 28 13
[2,] 43 41
Pearson's Chi-squared test
data: observed_frequencies
X-squared = 3.2842, df = 1, p-value = 0.06995
123
asdf
123
asdf
12 3
as d f
12 3
asdf
d
d
d
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.