More London Resources: SAS Codes and Output Files
Here's the SAS code used to analyze the Small Area Microdata (SAM) files from the UK Office of National Statistics.
Most of the SAS file is format codes, and then there's a few steps to prepare the data and select certain parts of the population for further analysis. The heart of the actual analysis is here, near the end of the file:
***Ownership Models for Household Reference Persons;
proc logistic data=mysam.mysam2001 simple;
class frsex hourspwg hnearnra famtypa miginda frnssec8;
model rev_own=frsex hourspwg hnearnra famtypa miginda frnssec8 / expb rsquare;
title "London Home Ownership Models for Greater London Region";
run;
proc logistic data=mysam.mysam2001 outest=mysam.ownmods noprint;
class frsex hourspwg hnearnra famtypa miginda frnssec8;
model rev_own=frsex hourspwg hnearnra famtypa miginda frnssec8 / expb rsquare;
title "London Home Ownership Models by LA";
by lacode;
run;
***Ownership Models for those who just moved in within the last year;
proc logistic data=mysam.mysam2001 simple;
where miginda ne 0;
class frsex hourspwg hnearnra famtypa frnssec8;
model rev_own=frsex hourspwg hnearnra famtypa frnssec8 / expb rsquare;
title "Ownership Model for Recent Movers for Greater London Region";
run;
proc logistic data=mysam.mysam2001 outest=mysam.ownmov noprint;
where miginda ne 0;
class frsex hourspwg hnearnra famtypa frnssec8;
model rev_own=frsex hourspwg hnearnra famtypa frnssec8 / expb rsquare;
title "Ownership Model for Recent Movers by LA";
by lacode;
run;
***Models predicting who moved into their homes in the last year;
proc logistic data=mysam.mysam2001 simple;
class frsex hourspwg hnearnra famtypa frnssec8;
model rev_mov=frsex hourspwg hnearnra famtypa rev_own frnssec8 / expb rsquare;
title "Mobility Model for Greater London Region";
run;
proc logistic data=mysam.mysam2001 outest=mysam.movmods noprint;
class frsex hourspwg hnearnra famtypa frnssec8;
model rev_mov=frsex hourspwg hnearnra famtypa rev_own frnssec8 / expb rsquare;
title "Mobility Model by LA";
by lacode;
run;
When we run this batch of code, the software gives us a "log" keeping track of everything SAS did, including any warnings or error messages:
And then SAS also creates a printed output file with the results of the procedures we've asked for:
As you can see, this is a lot of output -- and this is just for the three models for the overall London region as a while. The output would be much, much longer if we printed out everything for all the models by Local Authority (LA) (notice the "noprint" option in the second portion of each pair of "proc logistic" sections).
Our mission at this stage is to distill this monstrous output file to a few presentation-quality tables in Excel, and begin taking notes for a few paragraphs of interpretation. Recall that one part of the paper is focusing on "middle-class" occupations across the London region. We now have some models that estimate how occupational divisions affect the likelihood of home ownership, across different parts of the London region, while "controlling for" age, household structure, hours worked per week, and so on. This means that we're able to isolate the independent effect of occupational class on property ownership.
Notice one more thing. I've highlighted three sections of the code in red. These are the files created to save the results of the statistical analysis. I've converted these files to Excel format, and they are here:
So, your mission: help me re-format the "raw" output of these statistical procedures into a small number of Excel tables that help us make sense of things as we work on our draft.
If you want to see an example, then skim through this manuscript:
We distilled Stacks o' SAS output into a few key tables to try to tell our story. The Excel file with all the tables for the manuscript is here.