Showing posts with label SAS. Show all posts
Showing posts with label SAS. Show all posts

Wednesday, January 6, 2010

Data Mining presentations at SUGI

This is a handy collection -the SAS Data Mining group presentations from SUGI meetings are posted at http://www.lexjansen.com/cgi-bin/xsl_transform.php?x=sdm&s=sugi_s&c=sugi

These include summary papers for applications that would be good to share with consulting clients ( for example, there was on one regression assumptions and problem with predictive modeling). There was also a paper on applying the Google page-rank to football teams! Definitely worth browsing. Best-paper awardees are clearly indicated as well.

Monday, January 5, 2009

A simple SAS proc tabulate example

PROC TABULATE is convenient for simple tables, so I wanted to post the code and the reference from SAS's support site. This article was simple enough for me to quickly construct a useful table.

Here is an example using my own data:

/* The example below illustrates a very simple table */

/* First the dataset */
data test;
input age_grp $ census_region $ income $ beta_only ;
datalines;
65-74 South low 1
65-74 South medium 0
85+ South low 0
65-74 South high 1
85+ West low 0
75-84 South medium 0
85+ South low 0
75-84 South high 0
85+ South low 0
85+ Midwest low 0
65-74 Midwest medium 0
65-74 West high 0
65-74 South low 0
75-84 West low 1
75-84 South low 0
85+ Midwest medium 0
75-84 South low 0
75-84 West low 1
75-84 Northeast medium 0
75-84 Northeast low 1
75-84 South medium 0
75-84 Northeast medium 1
75-84 South medium 1
75-84 Midwest medium 1
75-84 West medium 1
85+ South medium 1
65-74 West high 1
75-84 Midwest low 1
75-84 Midwest medium 0
75-84 South low 0
85+ Midwest medium 0
75-84 West low 0
75-84 South low 0
65-74 Northeast medium 1
85+ Midwest medium 0
65-74 South medium 1
75-84 Northeast medium 0
85+ Northeast medium 1
65-74 South high 0
65-74 West medium 0
85+ Midwest high 0
;
run;

/* Set up variables and a title */

%let my_cvars = age_grp census_region income;
%let trt = beta_only; /* Indicator for treatment */
title "Characteristics by treatment status for &trt";

/* Simple table */
proc tabulate data=test;

/* List categorical variables in a class statement */
class &trt &my_cvars;

/* Use keylabel to construct labels for proc tabulate tags */
keylabel n = 'N' all='Total' pctn='%' colpctn= 'Col %' rowpctn='Row %' ;

/* Define the table as: table rows, columns; */

table (&my_cvars all)
,
&trt*(n*f=comma6. pctn*f=comma6.1 colpctn*f=7.1 rowpctn*f=7.1)
;

run;

Monday, December 29, 2008

Doubly-robust estimation of treatment effect

Marie Davidian presented work published in the 2004 Statistics in Medicine paper in Spring of 2007 at NCSU - here are the presentation slides: Double Robustness in Estimation of Causal Treatment Effects.

The doubly robust estimator of treatment effect uses inverse probability weighting to adjust for selection into treatment and further regression adjustment in modeling treatment effect. Davidian shows that as long as either the propensity model or the regression model is correct, the doubly-robust estimator is a consistent estimator of the true treatment effect.

A SAS macro that performs doubly robust estimation is available from the Harry Guess research community web site at UNC.