R: Experiment 1: With varying numbers of samples
Descriptive Statistics | First 100 | First 1K | First 10K | First 100K |
---|---|---|---|---|
Mean | 0.02000071 | 0.020000066 | 0.020000004 | 0.02 |
Standard Error | 2.12714E-06 | 7.53406E-07 | 2.51164E-07 | 9.69855E-08 |
Median | 0.020005 | 0.020004 | 0.020004 | 0.020004 |
Mode | 0.020005 | 0.020005 | 0.020005 | 0.020005 |
Standard Deviation | 2.12714E-05 | 2.38248E-05 | 2.51164E-05 | 3.06695E-05 |
Sample Variance | 4.52471E-10 | 5.67621E-10 | 6.30831E-10 | 9.40618E-10 |
Kurtosis | 28.87137928 | 21.46428225 | 19.07376827 | 12.23083198 |
Skewness | -5.453831468 | -4.509853108 | -3.831289593 | -2.003065575 |
Range | 0.000135 | 0.000252 | 0.000277 | 0.000374 |
Minimum | 0.01988 | 0.019872 | 0.019868 | 0.019815 |
Maximum | 0.020015 | 0.020124 | 0.020145 | 0.020189 |
Sum | 2.000071 | 20.000066 | 200.000044 | 1999.999951 |
Count | 100 | 1000 | 10000 | 100000 |
Confidence Level(95.0%) | 4.2207E-06 | 1.47844E-06 | 4.92331E-07 | 1.9009E-07 |
foo<-function(n){
v <-1:12
v[1]=mean(To_Chip_RTP_delay[1:n])
v[2]=std.error(To_Chip_RTP_delay[1:n])
v[3]=names(sort(-table(To_Chip_RTP_delay[1:n])))[1]
v[4]=sd(To_Chip_RTP_delay[1:n])
v[5]=var(To_Chip_RTP_delay[1:n])
v[6]=kurtosis(To_Chip_RTP_delay[1:n])
v[7]=skewness(To_Chip_RTP_delay[1:n])
v[8]=min(To_Chip_RTP_delay[1:n])
v[9]=max(To_Chip_RTP_delay[1:n])
v[10]=sum(To_Chip_RTP_delay[1:n])
v[11]=length(To_Chip_RTP_delay[1:n])
v[12]=qnorm(0.965)*std.error(To_Chip_RTP_delay[1:n])
return(v)}
seq1<-c(foo(100),foo(1000),foo(10000),foo(100000))
mat1<-matrix(seq1, ncol=4)
fee<-function(n) {foo(To_Chip_RTP_delay, 10^n)}
lapply(c(2:5), fee)
[[1]] [1] "0.0200006800000119" "2.12697347407497e-06" "0.0200049999984913“
[4] "2.12697347407497e-05" "4.52401615941855e-10" "30.3672958382318“
Transcript
Now, it's really easy to compute the statistics over the first hundred, thousand, ten thousand, hundred thousand.
Well, yes just define yourself a function to compute the statistics we want, and then
calling the function to be applied to the function with a hundred, a thousand, ten thousand, or a hundred thousand samples will produce the columns. We are set. Off we go!