In: Statistics and Probability
Using the following set of data, please find the mode, median,
standard deviation and t-test for females and males.
Females:
A.) Mean
B.) Median
C.) Standard Deviation
D.) T-test
Males:
A.) Mean
B.) Median
C.) Standard Deviation
D.) T-test
FEMALES:
Female 1 Time (in Seconds): 225.62 Simple reaction:
0.262
Female 2 Time (in Seconds): 400.04 Simple reaction: 0.234
Female 3 Time (in Seconds): 469.16 Simple reaction: 0.199
Female 4 Time (in Seconds): 386.39 Simple reaction: 0.259
Female 5 Time (in Seconds): 345.54 Simple
reaction: 0.243
Female 6 Time (in Seconds): 351.88 Simple
reaction: 0.301
Female 7 Time (in Seconds): 89.676 Simple
reaction: 0.449
Female 8 Time (in Seconds): 103.83 Simple
reaction: 0.284
Female 9 Time (in Seconds): 131.02 Simple
reaction: 0.38
Female 10 Time (in Seconds): 374.3 Simple
reaction: 0.241
Female 11 Time (in Seconds):1009.8 Simple
reaction: 0.246
Female 12 Time (in Seconds): 173.78 Simple
reaction: 1.268
Female 13 Time (in Seconds): 109.81 Simple
reaction: 0.704
Female 14 Time (in Seconds): 646.82 Simple
reaction: 0.334
Female 15 Time (in Seconds): 575.44 Simple
reaction: 5.668
Female 16 Time (in Seconds): 380.1 Simple
reaction: 0.745
Female 17 Time (in Seconds): 97.995 Simple
reaction: 0.375
Female 18 Time (in Seconds): 83.701 Simple
reaction: 0.989
Female 19 Time (in Seconds): 339.86 Simple
reaction: 1.433
MALES:
Male 1 Time (in Seconds): 160.13 Simple
reaction: 0.204
Male 2 Time (in Seconds): 124.02 Simple reaction:
0.228
Male 3 Time (in Seconds): 50.095 Simple reaction:
0.416
Male 4 Time (in Seconds): 310.9 Simple
reaction: 0.303
Male 5 Time (in Seconds): 313.73 Simple reaction:
0.223
Male 6 Time (in Seconds): 393.03 Simple reaction:
0.441
Male 7 Time (in Seconds): 435.46 Simple
reaction: 2.327
Male 8 Time (in Seconds): 197.17 Simple
reaction: 1.752
Male 9 Time (in Seconds): 362.13 Simple
reaction: 0.281
Male 10 Time (in Seconds): 328.23 Simple reaction:
0.308
Male 11 Time (in Seconds): 302.34 Simple reaction:
0.282
Male 12 Time (in Seconds): 85.602 Simple reaction:
0.982
Male 13 Time (in Seconds): 301.95 Simple reaction:
0.377
Male 14 Time (in Seconds): 205.92 Simple reaction:
0.427
Male 15 Time (in Seconds): 101.41 Simple reaction:
0.403
Male 16 Time (in Seconds): 146.06 Simple reaction:
0.421
Male 17 Time (in Seconds): 442.37 Simple
reaction: 0.605
Male 18 Time (in Seconds): 253.31 Simple reaction:
0.428
Male 19 Time (in Seconds): 324.75 Simple reaction:
1.479
R CODES :
> data1=read.csv(file.choose(),header=T)
> data1
Gender Time Reaction
1 Female 225.620 0.262
2 Female 400.040 0.234
3 Female 469.160 0.199
4 Female 386.390 0.259
5 Female 345.540 0.243
6 Female 351.880 0.301
7 Female 89.676 0.449
8 Female 103.830 0.284
9 Female 131.020 0.380
10 Female 374.300 0.241
11 Female 1009.800 0.246
12 Female 173.780 1.268
13 Female 109.810 0.704
14 Female 646.820 0.334
15 Female 575.440 5.668
16 Female 380.100 0.745
17 Female 97.995 0.375
18 Female 83.701 0.989
19 Female 339.860 1.433
20 Male 160.130 0.204
21 Male 124.020 0.228
22 Male 50.095 0.416
23 Male 310.900 0.303
24 Male 313.730 0.223
25 Male 393.030 0.441
26 Male 435.460 2.327
27 Male 197.170 1.752
28 Male 362.130 0.281
29 Male 328.230 0.308
30 Male 302.340 0.282
31 Male 85.602 0.982
32 Male 301.950 0.377
33 Male 205.920 0.427
34 Male 101.410 0.403
35 Male 146.060 0.421
36 Male 442.370 0.605
37 Male 253.310 0.428
38 Male 324.750 1.479
> names(data1)
[1] "Gender" "Time" "Reaction"
> attach(data1)
1.> by(Time,Gender,FUN=mean)
Gender: Female
[1] 331.3033
---------------------------------------------------------------
Gender: Male
[1] 254.6635
> by(Reaction,Gender,FUN=mean)
Gender: Female
[1] 0.7691579
---------------------------------------------------------------
Gender: Male
[1] 0.6256316
2.> by(Time,Gender,FUN=median)
Gender: Female
[1] 345.54
---------------------------------------------------------------
Gender: Male
[1] 301.95
> by(Reaction,Gender,FUN=median)
Gender: Female
[1] 0.334
---------------------------------------------------------------
Gender: Male
[1] 0.416
3.> by(Time,Gender,FUN=sd)
Gender: Female
[1] 235.9646
---------------------------------------------------------------
Gender: Male
[1] 119.6056
> by(Reaction,Gender,FUN=sd)
Gender: Female
[1] 1.241706
---------------------------------------------------------------
Gender: Male
[1] 0.5901345
4. > Time[Gender=="Male"]
[1] 160.130 124.020 50.095 310.900 313.730 393.030 435.460 197.170
362.130 328.230
[11] 302.340 85.602 301.950 205.920 101.410 146.060 442.370 253.310
324.750
> Time[Gender=="Female"]
[1] 225.620 400.040 469.160 386.390 345.540 351.880 89.676
103.830
[9] 131.020 374.300 1009.800 173.780 109.810 646.820 575.440
380.100
[17] 97.995 83.701 339.860
> t.test(Time[Gender=="Male"],Time[Gender=="Female"])
Welch Two Sample t-test
data: Time[Gender == "Male"] and Time[Gender == "Female"]
t = -1.2628, df = 26.677, p-value = 0.2176
alternative hypothesis: true difference in means is not equal to
0
95 percent confidence interval:
-201.23825 47.95878
sample estimates:
mean of x mean of y
254.6635 331.3033
Since p-value > 0.05, we fail to reject the null hypothesis of no difference and conclude that there is no significant difference in mean of time between males and females.
> Reaction[Gender=="Male"]
[1] 0.204 0.228 0.416 0.303 0.223 0.441 2.327 1.752 0.281 0.308
0.282 0.982 0.377
[14] 0.427 0.403 0.421 0.605 0.428 1.479
> Reaction[Gender=="Female"]
[1] 0.262 0.234 0.199 0.259 0.243 0.301 0.449 0.284 0.380 0.241
0.246 1.268 0.704
[14] 0.334 5.668 0.745 0.375 0.989 1.433
>
t.test(Reaction[Gender=="Male"],Reaction[Gender=="Female"])
Welch Two Sample t-test
data: Reaction[Gender == "Male"] and Reaction[Gender ==
"Female"]
t = -0.45506, df = 25.737, p-value = 0.6529
alternative hypothesis: true difference in means is not equal to
0
95 percent confidence interval:
-0.7921676 0.5051150
sample estimates:
mean of x mean of y
0.6256316 0.7691579
Since p-value > 0.05, we fail to reject the null hypothesis of no difference and conclude that there is no significant difference in mean of simple reaction between males and females.