create.partitions function

Create partitions (aka nested dummy variables)