-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9843ebd
commit 2e87e35
Showing
3 changed files
with
1,193 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
##putting together an example with the t-distribution | ||
|
||
##let's take samples from a normal distribution and show what the t-distribution from the test stastic | ||
|
||
|
||
test.stat<- function(sims, n){ | ||
|
||
store<- c() | ||
for(z in 1:sims){ | ||
ee<- rnorm(n, mean = 0, sd = 0.1) | ||
ff<- mean(ee) | ||
gg<- var(ee) | ||
store[z]<- ff/(sqrt(gg/n)) } | ||
|
||
return(store) | ||
} | ||
|
||
|
||
round1<- test.stat(1000, 2) | ||
plot(density(round1)) | ||
round2<- test.stat(1000, 3) | ||
plot(density(round2)) | ||
round3<- test.stat(1000, 100) | ||
plot(density(round3)) |
Binary file not shown.
Oops, something went wrong.