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
# Calculation of power for stepped wedge design | |
# Adapted from an excel-based calculator from Jim Hughes, jphughes@u.washington.edu | |
# see http://faculty.washington.edu/peterg/Vaccine2006/articles/HusseyHughes.2007.pdf | |
# http://faculty.washington.edu/jphughes/Power%20for%20stepped%20wedge.xls | |
# http://faculty.washington.edu/jphughes/Power%20for%20stepped%20wedge%20(mean).xls | |
# Adapted by Eric Green, eric.green@duke.edu, @ericpgreen | |
# (1) enter or (2) import design matrix =========================================================== | |
# skip option 1 if using option 2, and vice versa | |
# power.p is the final object of interest for proportions |
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
%------------------------------------------------------------------------------- | |
% Title | |
% Code written by AUTHOR, email | |
% Date | |
% Other notes | |
%------------------------------------------------------------------------------- | |
\documentclass[authoryear,11pt]{elsarticle} % requires elsarticle package | |
\usepackage[T1]{fontenc} |
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
#------------------------------------------------------------------------------ | |
# Title | |
# Code written by AUTHOR, email | |
# Date | |
# Other notes | |
#------------------------------------------------------------------------------ | |
# setup | |
#------------------------------------------------------------------------------ | |
# load libraries |
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
.DS_Store | |
.DS_Store? | |
._* | |
.Spotlight-V100 | |
.Trashes | |
ehthumbs.db | |
Thumbs.db | |
*.aux | |
*.glo |
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
# bootstrapped standard errors and confidence intervals for sem | |
# original sem code from sem:::bootSem.sem | |
# original post: http://r.789695.n4.nabble.com/Bootstrap-bootSem-causes-R-to-crash-tp4661900p4677999.html | |
# commented out lines referencing tcltk | |
bootSem2 <- function (model, R = 100, Cov = cov, data = model$data, max.failures = 10, | |
...) | |
{ |
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
# info | |
#------------------------------------------------------------------------------------- | |
# simulation of a multivariate ordinal dataset using the MultiOrd package | |
# running this .R gist will *only* read in the final data, not run the simulation | |
# scroll down to see original code to simulate | |
# sim code modified by package creator to override simBinCorr function | |
# simulated data | |
#------------------------------------------------------------------------------------- |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test Google Forms</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<div> | |
<div> |
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
miList <- list(structure(list(v1 = c(2, 3, 0, 0, 0, 2, 1, 0, 3, 3, 1, 3, | |
3, 0, 1, 3, 3, 2, 0, 1, 3, 0, 0, 0, 2, 0, 3, 3, 0, 0, 2, 0, 1, | |
2, 3, 3, 0, 3, 3, 2, 3, 3, 0, 0, 0, 0, 1, 1, 0, 3, 0, 3, 3, 3, | |
0, 3, 3, 2, 3, 2, 3, 3, 0, 2, 0, 3, 0, 2, 0, 0, 3, 2, 3, 0, 2, | |
3, 0, 3, 2, 0, 0, 2, 0, 1, 2, 2, 3, 0, 0, 0, 0, 0, 0, 3, 0, 0, | |
0, 3, 0, 2, 0, 0, 1, 3, 0, 0, 2, 1, 3, 0, 0, 3, 2, 0, 3, 3, 1, | |
3, 3, 2, 0, 3, 2, 2, 3, 0, 3, 2, 3, 0, 0, 2, 0, 0, 2, 0, 0, 0, | |
2, 0, 2, 0, 1, 0, 2, 0, 2, 1, 2, 3, 0, 0, 3, 2, 0, 2, 3, 2, 0, | |
3, 0, 2, 3, 0, 0, 0, 0, 2, 2, 3, 3, 2, 3, 2, 0, 0, 3, 3, 3, 0, | |
0, 3, 1, 0, 0, 0, 3, 3, 0, 1, 3, 3, 3, 1, 0, 1, 0, 0, 3, 3, 0 |
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
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
# export from R to Excel with conditional highlighting | |
# see http://stackoverflow.com/questions/21618556/export-data-frames-to-excel-via-xlsx-with-conditional-formatting | |
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
# get some data from the psych package | |
library(psych) | |
dat <- bfi | |
# load xlsx | |
library(xlsx) |
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
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
# dhis api access | |
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
# https://www.dhis2.org/doc/snapshot/en/developer/html/apas07.html | |
# https://github.com/jason-p-pickering/datim-validation | |
# http://www.r-fiddle.org/#/fiddle?id=wHglXleC&version=1 | |
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
# setup ======================================================================= | |
require(RCurl) |
OlderNewer