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
library(dplyr) | |
# create data frame of z-scores and probabilities | |
standard_normal_distribution <- data.frame(z_score = seq(-7, 7, 0.000001), | |
probability = pnorm(seq(-7, 7, 0.000001))) | |
# find max number of characters (redshift has a limit of DECIMAL(38, 37)) | |
max(nchar(standard_normal_distribution$probability)) | |
# if necessary, round big decimals |
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.69,23.84,24.77,25.84,26.79,27.74,28.67,30.41) | |
> y <- c(5,4,17,21,15,20,15,14) | |
> ny <- c(9,10,11,18,7,4,3,0) | |
> ymat <- cbind(y,ny) | |
> m1 <- glm(ymat ~ x, family=binomial) | |
> summary(m1) | |
Call: | |
glm(formula = ymat ~ x, family = binomial) |