Last active
August 18, 2018 23:05
-
-
Save aegis1980/6a119c8e48ba971e69255d3963fbc135 to your computer and use it in GitHub Desktop.
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
# Fractile estimation from samples – prediction method with t-student distribution, if you dont know parent pop sd | |
tp <- function(x,n){ | |
result <- qt(x,n-1) * sqrt(1+(1/n)) | |
return(result) | |
} | |
# Fractile estimation from samples – prediction method with normal distribution, if you do know parent pop sd | |
up <- function(x,n){ | |
result <- qnorm(x) * sqrt(1+(1/n)) | |
return(result) | |
} | |
# Two functions above use prediciton ethod, think I need to use the 'coverage method' that takes in account confidence. | |
# Not sure how! | |
kappa <-function(gamma,x,n,skew){ | |
# some funciton I dont know :( | |
return (0) | |
} | |
# Using prediciton moethods functions, with x=0.05 | |
# This does not give values in AS/NZS table B1 | |
kt <- function(n,x,COV){ | |
k = c(tp(x,n), up(x,n)) | |
result <- 1/(1 + k*COV) | |
return(result) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment