Generate an object in R (call it whatever you want to name it) with 100 random draws from a standard normal distribution. Using this object, calculate and provide
set.seed(11)
random_numbers <- rnorm(100)
random_numbers
## [1] -0.59103110 0.02659437 -1.51655310 -1.36265335 1.17848916 -0.93415132
## [7] 1.32360565 0.62491779 -0.04572296 -1.00412058 -0.82843324 -0.34835173
## [13] -1.53829340 -0.25556525 -1.14994503 0.01232697 -0.22296954 0.88777165
## [19] -0.59215528 -0.65571812 -0.68251762 -0.01585819 -0.44260479 0.35255750
## [25] 0.07317058 0.00715880 -0.18760011 -0.76570065 -0.22105682 -0.98358859
## [31] -1.10428404 -0.93815021 0.67862424 -1.57749787 -0.86993846 0.48467705
## [37] -0.18605270 1.54555470 -0.61138007 -0.34775649 -1.63651631 0.02038144
## [43] 0.89174268 -0.87274968 0.89005083 -0.34387435 -2.18678137 0.88005818
## [49] 0.72385656 0.21985268 0.78987057 -0.22999390 -0.81850248 0.49973416
## [55] 0.15919235 0.54262643 -0.15664505 0.43879332 1.48787060 0.06016510
## [61] -0.84901287 2.33969306 -0.12120295 -1.95020737 0.53871149 1.69351482
## [67] -0.79096822 -1.07526060 -0.60787512 0.75440166 0.45347606 -0.12343368
## [73] -0.76309682 0.22827009 1.11946192 0.15657318 -0.68877213 0.45294960
## [79] -1.06754665 0.40156515 -0.06477369 0.31549629 -0.60568155 -0.90758469
## [85] 2.26160898 -0.60322671 -1.29786210 0.50645120 -0.85333426 -1.50603179
## [91] 1.20232890 -1.02786539 0.93826996 -0.54315466 0.51309513 -0.35259088
## [97] 1.32653329 -1.14015185 1.41310994 -0.60217878
1a) A histogram of the object
hist(random_numbers,
main = "Histogram of Random Normal Values",
xlab = "Values",
col = "purple")
1b) The mean
mean <- mean(random_numbers)
mean
## [1] -0.1235137
1c) The standard deviation
sd <- sd(random_numbers)
sd
## [1] 0.9144671
1d) The standard error of the mean
sd(random_numbers)/sqrt(length(random_numbers))
## [1] 0.09144671
1e) The 95% confidence interval
mean(random_numbers) + c(-1,1) * 1.96 * (sd(random_numbers)/sqrt(length(random_numbers)))
## [1] -0.30274928 0.05572183
Using the data (from the assignment sheet) to conduct a difference of means test:
Please make sure to show your work. Remember, you can use R as a calculator (as shown below) but you are also able to submit written work as well.
2a) Calculate the t-statistic
t_stat <- (2.0- 2.64) /
sqrt((1.32^2 / 9) + (1.75^2 / 11))
t_stat
## [1] -0.931547
The t-statistic is…-0.931547
2b) Calculate the degrees of freedom
df <- (9)+(11)-(2)
df
## [1] 18
There are 18 degrees of freedom.
2c) Compare the t-statistic to the critical value for p = 0.05 for the corresponding degrees of freedom.
Written answer here…. 2.101>|-.92| so because of that we fail to reject the null hypothsis there is no difference statisticaly in groups with a lot of females vs a little females