Skip to content

Instantly share code, notes, and snippets.

@daynebatten
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save daynebatten/7b9a8420d38cc129399d to your computer and use it in GitHub Desktop.

Select an option

Save daynebatten/7b9a8420d38cc129399d to your computer and use it in GitHub Desktop.
/* We need constraints for every combination of dimensions you can build by leaving out one dimension at a time.
This is pretty simple in a 2-dimensional dataset. */
proc sql;
create table
levels
/* Constraints across the degree dimension */
as select distinct
county,
'dummy' as degree
from
testset
/* And constraints across the county dimension */
union all
select distinct
'dummy' as county,
degree
from
testset;
quit;
/* Assign numbers to our soon-to-be constraints */
data levels;
set levels;
con = _n_;
run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment