#Class    Sex   Age Survived Freq
set loc Class cat
set loc Sex cat
set loc Age cat
set loc Survived aff
set loc Freq qua
read cases inline noid 
 1st   Male Child       n    0
 2nd   Male Child       n    0
 3rd   Male Child       n   35
Crew   Male Child       n    0
 1st Female Child       n    0
 2nd Female Child       n    0
 3rd Female Child       n   17
Crew Female Child       n    0
 1st   Male Adult       n  118
 2nd   Male Adult       n  154
 3rd   Male Adult       n  387
Crew   Male Adult       n  670
 1st Female Adult       n    4
 2nd Female Adult       n   13
 3rd Female Adult       n   89
Crew Female Adult       n    3
 1st   Male Child       y    5
 2nd   Male Child       y   11
 3rd   Male Child       y   13
Crew   Male Child       y    0
 1st Female Child       y    1
 2nd Female Child       y   13
 3rd Female Child       y   14
Crew Female Child       y    0
 1st   Male Adult       y   57
 2nd   Male Adult       y   14
 3rd   Male Adult       y   75
Crew   Male Adult       y  192
 1st Female Adult       y  140
 2nd Female Adult       y   80
 3rd Female Adult       y   76
Crew Female Adult       y   20
;;;;
run
tab sampleweight Freq Class Sex Age Survived 
tab sampleweight Freq Class Survived
tab sampleweight Freq Sex Age Survived
llm Class + Sex + Age + Survived + (Class + Sex + Age)*Survived + Class*Sex*Age weight Freq 
