Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Colored stdout in Python (based off of blender build scripts) | |
# Reference: https://stackoverflow.com/questions/287871/how-to-print-colored-text-to-the-terminal | |
class bcolors: | |
HEADER = '\033[95m' | |
OKBLUE = '\033[94m' | |
OKCYAN = '\033[96m' | |
OKGREEN = '\033[92m' | |
WARNING = '\033[93m' | |
FAIL = '\033[91m' |
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
# data | |
x1 <- rnorm(10, 1.1, 3) | |
x2 <- rnorm(50, 0.7, 3) | |
v_x1 <- var(x1) | |
v_x2 <- var(x2) | |
n_x1 <- length(x1) | |
n_x2 <- length(x2) | |
# welch's t-stat | |
num <- mean(x1) - mean(x2) |
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
#' Sum of Vector (Recursive Function) | |
#' A recursive function to find the total sum of all the elements of a vector. | |
#' Logic: Sum any two elements of the vector. Concatenate this sum to the | |
#' vector, excluding the elements used to compute the sum. Pass this new vector | |
#' back into the function (the length should be the original length of the | |
#' vector minus 1). Terminate the recursion when the length of the vector is 1 | |
#' (i.e. the total sum). | |
#' @param n A vector of numbers. | |
#' @return The sum of the vector. |