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
# in this program I test the sampling distribution of Cohen's q | |
library("MASS") | |
# sample sizes to generate correlation coefficients | |
n1 <- 100 | |
n2 <- 100 | |
sml <- 20000 # number of simulations | |
qs <- vector(length=length(sml)) |
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
rndSequence = function(length) { | |
options = length; | |
option_sequence = []; | |
for (var i = 0; i < options; i++) { | |
if (option_sequence.length === 0) { | |
var rnd = Math.floor(Math.random()*options); | |
option_sequence.push(rnd); | |
} | |
else if (option_sequence.length > 0) { | |
var rnd = Math.floor(Math.random()*options); |
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
# This function reads a Rmd file and returns the word count | |
# It uses the wordcountaddin and koRpus packages | |
text_stats_file <- function(rmdFile) { | |
rmd <- file(rmdFile, "rt") | |
text <- readLines(rmd) | |
conText <- "" | |
for (i in text) { | |
conText <- paste(conText, i) | |
} | |
close(rmd) |
NewerOlder