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
library(rms) | |
dd <- datadist(mtcars) | |
mtcarsRegression <- | |
ols(mpg ~ hp + wt, data = mtcars, x = TRUE, y = TRUE) | |
validate(mtcarsRegression) |
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
#!/bin/bash | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# exit on error | |
set -e | |
TMUX_VERSION=2.2 |
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
lm_eqn <- function(model){ | |
mod_frame <- broom::tidy(model) | |
eqn_string <- sprintf("The response is equal to %.2f ", mod_frame$estimate[1]) | |
model_terms <- function(i){ | |
if(i == 1){return(".")} | |
paste(sprintf("+ %.2f %s", mod_frame$estimate[i], mod_frame$term[i]), model_terms(i - 1)) | |
} |
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
set.seed(12121212) | |
library(network) | |
nw_random <- function(prob, size_net) { | |
network(x = matrix(rbinom(size_net ^ 2, 1, prob = prob), ncol = size_net, nrow = size_net)) | |
} | |
library(ggnetwork) |
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
#’ Create a Kaplan-Meier plot using ggplot2 | |
#’ | |
#’ @param sfit a \code{\link[survival]{survfit}} object | |
#’ @param returns logical: if \code{TRUE}, return an ggplot object | |
#’ @param xlabs x-axis label | |
#’ @param ylabs y-axis label | |
#’ @param ystratalabs The strata labels. \code{Default = levels(summary(sfit)$strata)} | |
#’ @param ystrataname The legend name. Default = “Strata” | |
#’ @param timeby numeric: control the granularity along the time-axis | |
#’ @param main plot title |
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
09:27 ~: ssh -vv -i ./.ssh/dataincubator vagrant@XXX.XXX.XX.XXX | |
OpenSSH_7.5p1, OpenSSL 1.0.2l 25 May 2017 | |
debug1: Reading configuration data /Users/mustafaascha/.ssh/config | |
debug1: Reading configuration data /usr/local/etc/ssh/ssh_config | |
debug2: resolving "XXX.XXX.XX.XXX" port 22 | |
debug2: ssh_connect_direct: needpriv 0 | |
debug1: Connecting to XXX.XXX.XX.XXX [XXX.XXX.XX.XXX] port 22. | |
debug1: Connection established. | |
debug1: identity file ./.ssh/dataincubator type 1 | |
debug1: key_load_public: No such file or directory |
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
#Notes from Clinical Information Systems, October 3 2017 | |
# Contents =================================================================== | |
# 1. HPV frequencies, model | |
# 2. Vitamin D and depression | |
# Setup ===================================================================== |
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
#' Notes from Clinical Information Systems, October 2 2018 | |
#' | |
# Contents ======================================== | |
#' | |
#' From 2018 | |
#' 1. Human immunodeficiency status versus white | |
#' blood cell counts, visualization and modeling | |
#' 2. Body mass index versus dietary habits (salt intake | |
#' and salmon consumption) | |
#' |
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
#' Notes from Clinical Information Systems, October 2 2018 | |
#' | |
# Contents ======================================== | |
#' | |
#' From 2018 | |
#' 1. Human immunodeficiency status versus white | |
#' blood cell counts, visualization and modeling | |
#' 2. Body mass index versus dietary habits (salt intake | |
#' and salmon consumption) | |
#' 3. Income and fast-food consumption |
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
library(tidyverse) | |
rm_rownames <- function(z) { | |
rownames(z) <- NULL | |
z | |
} | |
sz_message <- function(sz, p_nm, ttl, bs) { | |
p_mn <- round(mean(sz[[p_nm]], na.rm = T)) |
OlderNewer