Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
confidence interval stuff
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
failers = c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1) passers_FB = c(0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1) passers_TB = c(0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1) x = failers n = length(x) # sample mean xbar = mean(x) nboot = 10000 # random resamples from x tmpdata = sample(x,n*nboot, replace=TRUE) bootstrapsample = matrix(tmpdata, nrow=n, ncol=nboot) # Compute the means x* bsmeans = colMeans(bootstrapsample) # Compute δ∗ for each bootstrap sample deltastar = bsmeans - xbar # Find the 0.025 and 0.975 quantile for deltastar d = quantile(deltastar, c(0.025, 0.975)) # Calculate the 95% confidence interval for the mean. ci = xbar - c(d[2], d[1]) cat('Confidence interval: ',ci, '\n')
[
+
]
Show input
Absolute running time: 0.32 sec, cpu time: 0.56 sec, memory peak: 39 Mb, absolute service time: 0,32 sec
edit mode
|
history
|
discussion
Confidence interval: 0.1111111 0.4166667