Skip to content

Instantly share code, notes, and snippets.

View rpardee's full-sized avatar

Roy Pardee rpardee

View GitHub Profile
@rpardee
rpardee / values.js
Last active November 21, 2020 20:52 — forked from lennymd/values.js
var outcomes_health ;
function filter_down(indata) {
const cols = indata.columns;
let values = {};
indata.columns.forEach(col => (values[col] = d3.map(indata, d => d[col]).keys()));
outcomes_health = values['health_outcomes'] ;
}
async function get_values() {
* Translate service centers to facility codes. Translations change over time. ;
data svc_facs ;
input
@1 svcctr $char3.
@7 ctreffdt date9.
@19 ctrtrmdt date9.
@31 facility_code $char3.
;
format ctr: mmddyy10. ;
datalines ;
* Gimme 10 records of a random var. ;
data fake_data ;
do cnt = 1 to 10 ;
randy = uniform(7376) ;
output ;
end ;
keep randy ;
run ;
proc sort data = fake_data ;
screen mode id:i:2
use multimon:i:0
desktopwidth:i:1600
desktopheight:i:1200
session bpp:i:32
winposstr:s:0,1,0,0,1538,718
compression:i:1
keyboardhook:i:2
audiocapturemode:i:0
videoplaybackmode:i:1
proc format ;
value $sx
"F" = "Girls"
"M" = "Boys"
;
value ag
low - 12 = '12 and under'
13 - high = '13 and up'
;
quit ;
@rpardee
rpardee / gist:a8742c39734f205c62c6
Created February 17, 2015 18:03
Unroll LOINC & CPT lists to create a search_keys table for finding lab test indicators
require "win32ole"
=begin
Parsing strategy for unrolling the lists.
lists are either CPTs or LOINCs
CPTs are \d{5}.
Loincs are \d{4,5}-\d
Particular, problematic list is:
@rpardee
rpardee / gist:ed4cfc85f23081fd1a44
Created February 4, 2015 21:15
sas -> teradata temp table: why won't teradata do this join?
* Write db commands to the log. ;
options
fullstimer
sastrace = ',,,d'
sastraceloc = saslog
;
%let my_server = EDW_PROD1 ;
%let my_schema = SB_GHRI ;
/*********************************************
* Roy Pardee
* Group Health Research Institute
* (206) 287-2078
* pardee.r@ghc.org
*
* C:\Users/pardre1/Desktop/deleteme.sas
*
*
*********************************************/
@rpardee
rpardee / %limited_freq
Created May 27, 2014 16:13
SAS macro to produce a FREQ of the top-N most frequently ocurring values of a variable.
%macro limited_freq(inset = s.car_adm_f, var = , rowlim = 10) ;
proc sql outobs = &rowlim nowarn ;
create table topn as
select &var, count(*) as frq
from &inset
group by &var
order by 2 desc
;
quit ;
@rpardee
rpardee / gist:db3fbeecad8bae038008
Created May 21, 2014 21:13
SAS GTL for 'butterfly' plot
proc template ;
define statgraph psa_butterfly ;
begingraph ;
layout lattice _id='lattice' / columndatarange = data
columngutter = 0
rowdatarange = data
rowgutter = 10
/* columnweights = (0.62 0.38) */
columns = 2 ;
layout overlay _id='overlay' / yaxisopts = (gridattrs=(color=CXE8E6E8 pattern=SOLID thickness=1 )