Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.stata</string>
<key>settings</key>
<dict>
@puterleat
puterleat / steve
Created July 17, 2013 09:39
A simple pre-processor (the name is a play on Stata and Sweave, but this is much less fancy than Sweave) which grabs chunks of stata code from a markup file (e.g. latex or markdown) and runs this code using the Stata binary.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Steve
A simple pre-processor (the name is a play on Stata and Sweave, but this is
much less fancy than Sweave) which grabs chunks of stata code from a markup file
(e.g. latex or markdown) and runs this code using the Stata binary.
@puterleat
puterleat / statpipe
Last active December 22, 2015 21:39
A shell utility (in python) to allow piping and redirection of stata commands and output.
#!/usr/bin/python
"""
For example:
echo "di 2^2" | statpipe
. di 2^2
4
@puterleat
puterleat / gist:6624298
Last active December 23, 2015 10:49
updated analysis for ipod study
title make
Analysis for ipod craving study
worksheet

Analysis for ipod craving study

Data structure

. tab2 WASCRAVING INCOMPLETE STARTEDCRAVING
-> tabulation of WASCRAVING by INCOMPLETE
| INCOMPLETE
WASCRAVING | 0 1 | Total
-----------+----------------------+----------
0 | 368 0 | 368
1 | 400 467 | 867
Iteration 1: log likelihood = -886.08863
Computing standard errors:
Mixed-effects ML regression Number of obs = 203
Group variable: person Number of groups = 15
Obs per group: min = 3
avg = 13.5
max = 22
. gen STARTEDCRAVING = strength_0 == 0 & (strength_1 > 0 & strength_1 < .)
. gen WASCRAVING = strength_0 == 0
. gen COMPLETE = WASCRAVING if strength_1 >= 0 & strength_1 < .
(632 missing values generated)
.
. tab2 WASCRAVING COMPLETE STARTEDCRAVING
@puterleat
puterleat / gist:6761837
Created September 30, 2013 10:15
analysis v.3
title make version
Analysis for ipod craving study
worksheet
3

Analysis for ipod craving study

Data structure

Information about your asthma

Are you male/female

How old are you (in years)?

How long have you had asthma?

@puterleat
puterleat / gist:7085092
Last active December 26, 2015 03:19
Example of text formatting for questionnaire for Zoe
---
name: "Conseqences of asthma"
redirect_url: "/accounts/profile/"
success_message: "Thanks for taking part in this study. Your help is greatly appreciated."
---
~~~{#are_you_male_or_female choiceset="female" type="likert"}
Are you male or female?
~~~