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
df_long = pd.DataFrame( | |
{"student": ["Andy", "Bernie", "Cindy", "Deb", "Andy", "Bernie", "Cindy", "Deb", "Andy", "Bernie", "Cindy", "Deb"], | |
"school": ["Z", "Y", "Z", "Y", "Z", "Y", "Z", "Y", "Z", "Y", "Z", "Y"], | |
"class": ["english", "english", "english", "english", "math", "math", "math", "math", "physics", "physics", "physics", "physics"], | |
"grade": [10, 100, 1000, 10000, 20, 200, 2000, 20000, 30, 300, 3000, 30000] | |
} | |
) | |
df_long | |
> student school class grade |
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
alias gh="open \`git remote -v | grep [email protected] | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`" |
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) | |
library(broom) | |
library(modelsummary) | |
clean_colnames <- function(df) { | |
new <- tolower(gsub(" ", "_", names(df))) | |
new <- gsub(".", "_", new, fixed = TRUE) | |
new <- gsub("(", "", new, fixed = TRUE) | |
new <- gsub(")", "", new, fixed = TRUE) |
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 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
## DATA GENERATION | |
# reproducibility | |
library(bayesplot) | |
set.seed(1839) | |
# matches the stan function | |
inv_logit <- function(x){ | |
exp(x) / (1 + exp(x)) | |
} |
OlderNewer