x cd /pub/data/saipe/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for this directory.
J. Blodgett, OSEDA, Nov, 2005
and again, 12/2006 after 2004 data was released and converted.
and again, 01/2008 after 2005 data was released and converted.
and again, 12/2008 after 2006 and 2007 data were released and converted.
and again, 4//2010 after 2008 data were released and converted.
and again, 12/2010 after 2009 data were released and converted.
and again, 12/2011 after 2010 saipe data were released and converted.
9/2012 after converting sahie 2010 data.
9/2013 after converting sahie 2011 data.
1/2014 after converting the 2012 saipe data.
3/2014 after converting the 2012 saihe data.
12/2014 after converting the 2013 saipe data.
12/2015 after converting the 20132 & 2014 saipe data.
5/2016 after converting 2014 saihe data
12/2016 after converting 2015 saipe data
-- */
title "Job to Invoke doset Macro for Sets in saipe, creating saipe.datasets";
%include '/pub/sas/autoexec.sas';
options mprint symbolgen;
libname saipe '/pub/data/saipe';
*======Edit parms starting here and including the todo assigment------------------------;
%let gyear=2016; *<-----latest income year for which SAIPE estimates are available----;
*<----also used for latest sahie estimates, 9/2013--------;
%let gyr=%substr(&gyear,3,2);
%let gyearm1=%eval(&gyear -1);
%*let todo=sahie&gyr sahietotals&gyr mosahie&gyr;
%let todo=usstcnty20xx usschldst20xx usstcnty&gyear usschldst&gyear mostcnty&gyear moschldst&gyear;
%*let todo=sahie16 mosahie16 sahietotals16; *<---running Aug. 2018 (GPR)--;
*-----Run this step ONLY ONCE------------------------------------------;
*----If you need to rerun (start over) then delete the datasets dataset first. doset will not
allow initialize mode if the datasets set already exists.---;
%*doset(mode=initialize, libname=saipe,debug=1);
*----------------------------------------------------------------------;
%doset(mode=,libname=saipe,
memname=usstcnty20xx, memlabel=%nrbquote(US state & county Income & Poverty ests 2000-&gyear),
geouniv=UnitedStates,
units=US State County,
Years=%str(2000-&Gyear),
CreatePgm=cnvt_stcnty_20xx,
Keywords=Income poverty estimates state county time series post 2000,
Description=%nrbquote(Estimates of the number and percent of persons below the poverty level for the total population
and selected younger age groups, along with a Median Household Income estimate. These are for income years starting with
2000 and ending with &gyear.),
keyvars=SumLev state county Year,
keyfmats=SumLev state county,
DataSource=%str(U.S. Bureau of the Census: Small Area Income and Poverty Estimates program),
SortedBy=Year State county,
UsageNotes=%nrbquote(
- In the raw data as provided by the Bureau there were lower and upper bounds for the
90% confidence intervals. We used these to calculate CIW variables (Confidence Interval Widths). To get the lower and
upper bound figures just subtract and add the CIW variable to the variable value. In a few instances the intervals were
not balanced, in which case we just averaged the values of (Upper limit - Value) and (Value - Lower limit) to get the CIW
value.
- Data for income year N is normally released in December of year N+1.
- Data for children under 5 are only available at the US and State levels. These variables will have missing values
for all county level summaries
- There are 4 poverty universe variables which we have added to facilitate aggregation. They were derived by dividing the
poverty counts by the corresponding percentages, times 100.
- The counties for 2000 reflect old 2000 defns while data for later years use revised geography. This affects Colorado,
Alaska, and Virginia only.
),
SubType=stcnty,
SetGroup=us,
SortPrio=1,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/saipe/data/index.html),
debug=1);
%doset(mode=,libname=saipe,
memname=usschldst20xx,memlabel=%nrbquote(US school district Income & Poverty ests 2000-&gyear),
geouniv=UnitedStates,
units=School District,
Years=%str(2000-&Gyear),
CreatePgm=cnvt_sd_20xx,
Keywords=Income poverty estimates school district time series post 2000,
Description=%nrbquote(Estimates of the number and percent of children age 5-17 below poverty.
These data are for income years starting with 2000 and ending with &gyear.),
keyvars=SumLev state ncescode Year,
keyfmats=SumLev state ,
keyidvars=| | Areaname,
DataSource=%str(U.S. Bureau of the Census: Small Area Income and Estimates program),
SortedBy=Year State ncescode,
UsageNotes=%nrbquote(- Unlike the state and county level data for the same period these do not come with
confidence interval measures.
- Data for income year N is normally released in December of year N+1.
),
SubType=schldst,
SetGroup=us,
VarSet=,
SortPrio=1,
URLMeta=%str(http://www.census.gov/did/www/saipe/data/index.html),
debug=1);
*-------------------Now the new (2008+ vintage) single-year datasetes---------------------------------------------------;
%doset(mode=,libname=saipe,
memname=usstcnty&gyear, memlabel=%nrbquote(US state & county Income & Poverty ests for &gyear),
geouniv=UnitedStates,
units=US State County,
Years=&Gyear,
CreatePgm=cnvt_stcnty_20xx,
Keywords=Income poverty estimates state county time series post 2000,
Description=%nrbquote(Estimates of the number and percent of persons below the poverty level for the total population
and selected younger age groups, along with a Median Household Income estimate. These are for income year &gyear.),
keyvars=SumLev state county Year,
keyfmats=SumLev state county,
DataSource=%str(U.S. Bureau of the Census: Small Area Income and Poverty Estimates program),
SortedBy=State county,
UsageNotes=%nrbquote(- In the raw data as provided by the Bureau there were lower and upper bounds for the
90% confidence intervals. We used these to calculate CIW variables (Confidence Interval Widths). To get the lower and
upper bound figures just subtract and add the CIW variable to the variable value. In a few instances the intervals were
not balanced, in which case we just averaged the values of (Upper limit - Value) and (Value - Lower limit) to get the CIW
value.
- Data for income year N is normally released in December of year N+1.
- Data for children under 5 are only available at the US and State levels. These variables will have missing values
for all county level summaries
- There are 4 poverty universe variables which we have added to facilitate aggregation. They were derived by dividing the
poverty counts by the corresponding percentages, times 100.
),
SubType=stcnty,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/saipe/data/index.html),
debug=1);
%doset(mode=,libname=saipe,
memname=usschldst&gyear,memlabel=%nrbquote(US school district Income & Poverty ests &gyear),
geouniv=UnitedStates,
units=School District,
Years=&Gyear,
CreatePgm=cnvt_sd_20xx,
Keywords=Income poverty estimates school district time series post 2000,
Description=%nrbquote(Estimates of the number and percent of children age 5-17 below poverty.
These data are for income years starting with 2000 and ending with &gyear.),
keyvars=SumLev state ncescode Year,
keyfmats=SumLev state ,
keyidvars=| | Areaname,
DataSource=%str(U.S. Bureau of the Census: Small Area Income and Estimates program),
SortedBy=State ncescode,
UsageNotes=%nrbquote(- Unlike the state and county level data for the same period these do not come with
confidence interval measures.
- Data for income year N is normally released in December of year N+1.
- Data for children under 5 are only avaiable at the US and State levels. These variables will have missing values
for all county level summaries
),
SubType=schldst,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/saipe/data/index.html),
debug=1);
%doset(libname=saipe,memname=mostcnty20xx,template=usstcnty20xx,
memlabel=%nrbquote(MO state & county Income & Poverty ests 2000-&gyear),
geouniv=Missouri,units=State County,SetGroup=moviews)
%doset(libname=saipe,memname=mostcnty&gyear,template=usstcnty20xx, years=&gyear,
memlabel=%nrbquote(MO state & county Income & Poverty ests for &gyear),
geouniv=Missouri,units=State County,SetGroup=moviews)
%doset(libname=saipe,memname=moschldst20xx,template=usschldst20xx,
memlabel=%nrbquote(MO school district Income & Poverty ests 2000-&gyear),
geouniv=Missouri,SetGroup=moviews)
%doset(libname=saipe,memname=moschldst&gyear,template=usschldst20xx, years=&gyear,
memlabel=%nrbquote(MO school district Income & Poverty ests for &gyear),
geouniv=Missouri,SetGroup=moviews)
/* ========================begin comment====================================
%doset(libname=saipe,memname=stateranks&gyear,memlabel=%str(State-level Rankings and trends for &gyearm1.-&gyear),
geouniv=UnitedStates,
units=State,
Years=&gyearm1 &gyear,
CreatePgm=rankrepts,
Keywords=Income poverty estimates state ranks trends,
Description=%nrbquote(Estimates of several key indicators for the 51 states for years &gyearm1 and &gyear.. Includes
rank values for each.),
keyvars=State Year,
keyfmats=state,
DataSource=%str(U.S. Bureau of the Census: Small Area Income and Estimates program),
SortedBy=State,
UsageNotes=%nrbquote(- Derived from data in the usstcnty20xx dataset as it existed in January of 2007 with
data for income years through &gyear..
- The key measures are PctPoor, PctPoor0_17 (poverty rates for children),and Median Household Income.
- Variables with names beginning Lastyr contain values for &gyearm1.. Otherwise the variables are for &gyear..
- Variables with names beginning with Change represent the value for &gyear minus the value for &gyearm1..
Except that ChangeRank variables are negated so that a higher ranking (reflected as a lower Rank value) results in a
positive Change value.
- Dataset usdata&gyear. has comparable data summarized at the national level, but without any Rank variables.
),
SubType=stranks,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/saipe/data/index.html),
debug=1);
%*----Add entries for the sahie datasets, vintage 2005, as created in 2008---;
%doset(libname=saipe,
memname=sahie05,
geouniv=UnitedStates,
units=State County,
Year=2005,
CreatePgm=cnvt_sahie,
Keywords=health insurance coverage,
Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage.
The estimates provide detail by age, race, gender and income levels for one calendar year.),
keyvars=SumLev state county Year agecat racecat sexcat iprcat,
keyfmats=SumLev state county | agecat racecat sexcat iprcat,
DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program),
SortedBy=State county,
UsageNotes=%nrbquote(- All Races is the only race category available at the county-level.
- The under 19 age group is only available for Both Sexes, All Races, and At or below 200 percent of federal poverty threshold.
- The age 50 to 64 age group is not provided at the county-level.
- Either At or below 200 percent of federal poverty threshold or the At or below 250 percent of federal poverty threshold is
available at the county-level.
- The pctelig variable is very misleading in cases where there is an income level qualifier because it uses a total age-race-sex denominator.
- Except for geography codes we have used variable names as indicated by the Bureau in the Data Structure and
Definitions section at the head of the data file - saved as sahie05.datadefs.txt
),
SubType=sahie,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/hhes/www/sahie/data/2005/index.html),
debug=1);
%doset(mode=,libname=saipe, memname=mosahie05,template=sahie05,geouniv=Missouri,setgroup=mo) ;
%*----Add entries for the sahie datasets, vintage 2006, as created in 2009---;
%doset(libname=saipe,
memname=sahie07,fixindex=0,
geouniv=UnitedStates,
units=State County,
Year=2007,
CreatePgm=cnvt_sahie,
Keywords=health insurance coverage,
Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage.
The estimates provide detail by age, race, gender and income levels for one calendar year.),
keyvars=Totflag asri SumLev state county Year agecat racecat sexcat iprcat,
keyfmats=| | SumLev state county | agecat racecat sexcat iprcat,
DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program),
SortedBy=State county,
UsageNotes=%nrbquote( - See the sahietotals07 set if not interested in demographic detail.
- The asri variable can be used to filter based on relevant demographic categories. It is a string of up to 4 letters. If it contains an
'r' then race is relevant (for example)
- All Races is the only race category available at the county-level.
- The under 19 age group is only available for Both Sexes, All Races, and At or below 200 percent of federal poverty threshold.
- The age 50 to 64 age group is not provided at the county-level.
- Either At or below 200 percent of federal poverty threshold or the At or below 250 percent of federal poverty threshold is
available at the county-level.
- pctelig and pctliic vars use denom that is entire demog group regardless of income level.
- Except for geography codes we have used variable names as indicated by the Bureau in the Data Structure and
Definitions section at the head of the data file - saved as sahie07.datadefs.txt
- See sample listing of mosahie07 to see an
example of what kinds of summaries are available at state and county levels.
),
SubType=sahie,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/sahie/index.html),
debug=1);
%doset(mode=,libname=saipe, memname=mosahie07,template=sahie07,geouniv=Missouri,setgroup=mo) ;
%doset(libname=saipe,
memname=sahietotals07,
geouniv=UnitedStates,
units=State County,
Year=2007,
CreatePgm=cnvt_sahie,
Keywords=health insurance coverage,
Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage.
This is a subset of the more detailed estimates in sahie07. This set has data only for the total population under age 65.),
keyvars=SumLev state county Year,
keyfmats=SumLev state county | ,
DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program),
SortedBy=State county,
UsageNotes=%nrbquote( - See the sahie07 set if interested in demographic detail.
- Except for geography codes we have used variable names as indicated by the Bureau in the Data Structure and
Definitions section at the head of the data file - saved as sahie07.datadefs.txt
),
SubType=sahietotals,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/sahie/index.html),
debug=1);
%doset(mode=,libname=saipe, memname=mosahie07,template=sahie07,geouniv=Missouri,setgroup=mo) ;
%doset(libname=saipe,
memname=sahie08,fixindex=0,
geouniv=UnitedStates,
units=State County,
Year=2008,
CreatePgm=cnvt_sahie,
Keywords=health insurance coverage,
Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage.
The estimates provide detail by age, race, gender and income levels for one calendar year.),
keyvars=Totflag asri SumLev state county Year agecat racecat sexcat iprcat,
keyfmats=| | SumLev state county | agecat racecat sexcat iprcat,
DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program),
SortedBy=State county,
UsageNotes=%nrbquote( - See the sahietotals08 set if not interested in demographic detail.
- The asri variable can be used to filter based on relevant demographic categories. It is a string of up to 4 letters. If it contains an
'r' then race is relevant (for example)
- All Races is the only race category available at the county-level.
- The under 19 age group is only available for Both Sexes, All Races, and At or below 200 percent of federal poverty threshold.
- The age 50 to 64 age group is not provided at the county-level.
- Either At or below 200 percent of federal poverty threshold or the At or below 250 percent of federal poverty threshold is
available at the county-level.
- pctelig and pctliic vars use denom that is entire demog group regardless of income level.
- Except for geography codes we have used variable names as indicated by the Bureau in the Data Structure and
Definitions section at the head of the data file - saved as sahie08.datadefs.txt
- See sample listing of mosahie07 to see an
example of what kinds of summaries are available at state and county levels.
),
SubType=sahie,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/sahie/index.html),
debug=1);
%doset(libname=saipe,
memname=sahietotals08,
geouniv=UnitedStates,
units=State County,
Year=2008,
CreatePgm=cnvt_sahie,
Keywords=health insurance coverage,
Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage.
This is a subset of the more detailed estimates in sahie08. This set has data only for the total population under age 65.),
keyvars=SumLev state county Year,
keyfmats=SumLev state county | ,
DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program),
SortedBy=State county,
UsageNotes=%nrbquote( - See the sahie08 set if interested in demographic detail.
- Except for geography codes we have used variable names as indicated by the Bureau in the Data Structure and
Definitions section at the head of the data file - saved as sahie08.datadefs.txt
),
SubType=sahietotals,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/sahie/index.html),
debug=1);
%doset(mode=,libname=saipe, memname=mosahie08,template=sahie08,geouniv=Missouri,setgroup=mo) ;
%doset(libname=saipe,
memname=sahie09,fixindex=0,
geouniv=UnitedStates,
units=State County,
Year=2009,
CreatePgm=cnvt_sahie,
Keywords=health insurance coverage,
Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage.
The estimates provide detail by age, race, gender and income levels for one calendar year.),
keyvars=Totflag asri SumLev state county Year agecat racecat sexcat iprcat,
keyfmats=| | SumLev state county | agecat racecat sexcat iprcat,
DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program),
SortedBy=State county,
UsageNotes=%nrbquote( - See the sahietotals09 set if not interested in demographic detail.
- The asri variable can be used to filter based on relevant demographic categories. It is a string of up to 4 letters. If it contains an
'r' then race is relevant (for example)
- All Races is the only race category available at the county-level.
- The under 19 age group is only available for Both Sexes, All Races, and At or below 200 percent of federal poverty threshold.
- The age 50 to 64 age group is not provided at the county-level.
- Either At or below 200 percent of federal poverty threshold or the At or below 250 percent of federal poverty threshold is
available at the county-level.
- pctelig and pctliic vars use denom that is entire demog group regardless of income level.
- Except for geography codes we have used variable names as indicated by the Bureau in the Data Structure and
Definitions section at the head of the data file - saved as sahie09.datadefs.txt
- See sample listing of mosahie07 to see an
example of what kinds of summaries are available at state and county levels.
),
SubType=sahie,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/sahie/index.html),
debug=1);
%doset(libname=saipe,
memname=sahietotals09,
geouniv=UnitedStates,
units=State County,
Year=2000,
CreatePgm=cnvt_sahie,
Keywords=health insurance coverage,
Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage.
This is a subset of the more detailed estimates in sahie08. This set has data only for the total population under age 65.),
keyvars=SumLev state county Year,
keyfmats=SumLev state county | ,
DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program),
SortedBy=State county,
UsageNotes=%nrbquote( - See the sahie08 set if interested in demographic detail.
- Except for geography codes we have used variable names as indicated by the Bureau in the Data Structure and
Definitions section at the head of the data file - saved as sahie09.datadefs.txt
),
SubType=sahietotals,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/sahie/index.html),
debug=1);
%doset(mode=,libname=saipe, memname=mosahie09,template=sahie09,geouniv=Missouri,setgroup=mo) ;
===========================End commented out================================ */
%*---9-5-12 we edited these to use the global year references (gyr and gyear) to make it simpler to run for each new year. ---;
%doset(libname=saipe,
memname=sahie&gyr,fixindex=0,
geouniv=UnitedStates,
units=State County,
Year=&gyear,
CreatePgm=cnvt_sahie,
Keywords=health insurance coverage,
Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage.
The estimates provide detail by age, race, gender and income levels for one calendar year.),
keyvars=Totflag asri SumLev state county Year agecat racecat sexcat iprcat,
keyfmats=| | SumLev state county | agecat racecat sexcat iprcat,
DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program),
SortedBy=State county,
UsageNotes=%nrbquote( - See the sahietotals&gyr set if not interested in demographic detail.
- The asri variable can be used to filter based on relevant demographic categories. It is a string of up to 4 letters. If it contains an
'r' then race is relevant (for example)
- All Races is the only race category available at the county-level.
- The under 19 age group is only available for Both Sexes, All Races, and At or below 200 percent of federal poverty threshold.
- The age 50 to 64 age group is not provided at the county-level.
- Either At or below 200 percent of federal poverty threshold or the At or below 250 percent of federal poverty threshold is
available at the county-level.
- pctelig and pctliic vars use denom that is entire demog group regardless of income level.
- Except for geography codes we have used variable names as indicated by the Bureau in the Data Structure and
Definitions section at the head of the data file - saved as sahie&gyr..datadefs.txt
),
SubType=sahie,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/sahie/index.html),
debug=1);
%doset(libname=saipe,
memname=sahietotals&gyr,
geouniv=UnitedStates,
units=State County,
Year=&gyear,
CreatePgm=cnvt_sahie,
Keywords=health insurance coverage,
Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage.
This is a subset of the more detailed estimates in sahie08. This set has data only for the total population under age 65.),
keyvars=SumLev state county Year,
keyfmats=SumLev state county | ,
DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program),
SortedBy=State county,
UsageNotes=%nrbquote( - See the sahie08 set if interested in demographic detail.
- Except for geography codes we have used variable names as indicated by the Bureau in the Data Structure and
Definitions section at the head of the data file - saved as sahie&gyr..datadefs.txt
),
SubType=sahietotals,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/did/www/sahie/index.html),
debug=1);
%doset(mode=,libname=saipe, memname=mosahie&gyr.,template=sahie&gyr.,geouniv=Missouri,setgroup=mo) ;
%***include '/pub/data/saipe/Tools/file_dosets.sas'; *<----as generated by invoke_metafix.sas in system/Tools--;
*---Customize the sort priority of the Datasets.html page. (1-8-15, jgb)---;
data saipe.datasets; set saipe.datasetsB;
if sortprio ne '9' and sortprio ne 'X' then do;
if index(memname,'sahie') then sortprio='8';
else if index(memname,'20xx') then sortprio='1';
else sortprio='5';
end;
run cancel;
proc datasets library=saipe nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options mprint msglevel=i;
%gendshtm(libname=saipe,debug=1,runprocc=1);
%***gendshtm(libname=archives,filetype=saipe,debug=1,runprocc=1,memindex=0);