This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
find_n = function(ep, g, n, MSE, SSW, w){ | |
n = 4*(qt(1-ep/2, g*(n-1)))^2*MSE*SSW/w^2 | |
return(n) | |
} |
This file contains hidden or 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
x <- c(22, 23.9, 20.9, 23.8, 25, 24, 21.7, 23.8, 22.8, 23.1, 23.1, 23.1, 23.5, 23, 23) | |
fitdistr(x, "gamma") |
This file contains hidden or 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
# Check columns classes | |
sapply(DF, class) |
This file contains hidden or 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
p143[1:2] = lapply(p143[1:2], as.factor) |
This file contains hidden or 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
cd /Library/Frameworks/R.framework/Versions/Current/Resources/lib | |
ln -sf /System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib libRblas.dylib | |
ln -sf libRblas.0.dylib libRblas.dylib |
This file contains hidden or 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
\section{Standard Test} | |
\begin{tabular}{l|cc} | |
\textbf{GRE} & Verbal & Math \\ | |
\hline | |
Score & 157 & 168 \\ | |
Percentile & 73\% & 96\% \\ | |
\end{tabular}\\[10pt] |
This file contains hidden or 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
pairedBootstrap <- function(yourData, responseName, numberBoot){ | |
#####CREATE USEFUL VARIABLES FOR THE BOOTSTRAP METHOD | |
originalSampleSize <- dim(yourData)[1] #the data sample size | |
numberExplanatory <- dim(yourData)[2]-1 #the number of explanatory variables | |
#explanatory variable names | |
explanatoryNames <- setdiff(names(yourData),responseName) | |
#explanatory variable formula (for the lm function) |
This file contains hidden or 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
################################################################# | |
##### Perform the paired bootstrap for linear regression ##### | |
##### ##### | |
##### - yourData is a data frame containing the response and##### | |
##### explanatory variables(no extra variables should be##### | |
##### included) ##### | |
##### - responseName is the name of your response variable ##### | |
##### as it appears in the data frame(character) ##### | |
##### - numberBoot is the number of bootstrap samples to ##### | |
##### take ##### |
This file contains hidden or 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
paste("p143$x", 1:25, sep = "", collapse = ",") |