Shazam Input

set nowide

set skipmiss

*sex data coded: 1=female 0=male

*nearsght data coded: 1=yes 0=no

*parents data coded: 1=both 2=one 3=neither

*newspapr data coded: 1=yes 0=no

*study data coded: 1=<5hrs 2=5-10hrs 3=10-15hrs 4=15-20hrs 5=>20hrs

*tv data coded: 1=<5hrs 2=5-10hrs 3=10-15hrs 4=15-20hrs 5=>20hrs

*movie data coded: 1=never 2=1-3times 3=4-6times 4=>6times

*bed data coded: 1=before10:00pm 2=10:00pm-11:00pm 3=11:00pm-12:00pm 4=12:00am-1:00am 5=1:00am-2:00am 6=after2:00am

*posture data coded: 1=sitting 2=standing 3=tummy 4=back

*computer data coded: 1=<5hrs 2=5-10hrs 3=10-15hrs 4=15-20hrs 5=>20hrs

*video data coded: 1=<5hrs 2=5-10hrs 3=10-15hrs 4=15-20hrs 5=>20hrs

*lighting data coded: 1=candlelight 2=fluorescence 3=halogen 4=incandescent

*nation data coded: 1=chinese 2=canadian 3=taiwanese 4=japanese 5=filipino 6=Iranian 7=british 8=Ukranian

*studytm data coded: 1=morning 2=afternoon 3=evening 4=night 5=latenight

*sunglass data coded: 1=yes 2=sometimes 3=no

sample 1 28

read female age nearsght wrglass parents newspapr study tv movie bed posture computer video lighting nation studytm sunglass

0 32 1 7 2 1 2 5 1 3 1 2 1 3 2 1 1

0 21 1 19 3 1 1 1 2 2 1 2 1 2 2 3 3

1 20 1 10 2 0 2 1 3 4 1 3 1 3 4 3 1

1 20 1 16 2 0 3 2 2 4 1 1 1 2 1 3 2

1 23 1 6 1 0 1 3 2 3 1 2 1 3 1 2 1

1 22 0 -99999 2 0 3 1 2 4 1 5 1 4 6 3 3

1 21 1 9 3 0 2 1 2 4 1 4 1 4 1 3 3

1 21 1 19 3 1 4 2 2 4 1 4 1 2 7 3 1

1 20 1 19 2 1 1 1 2 5 3 2 1 2 1 3 2

0 21 1 9 2 0 1 2 2 4 1 3 1 2 3 3 3

1 22 0 -99999 2 0 2 2 2 4 3 5 1 3 3 3 1

1 21 1 13 2 0 3 4 2 3 3 4 1 2 1 4 3

1 20 0 -99999 1 0 2 3 2 4 4 5 1 2 1 4 2

1 22 1 18 2 0 3 2 2 4 1 3 1 3 3 3 3

1 21 1 14 1 1 1 1 2 4 1 3 1 2 -99999 4 2

0 28 1 7 2 0 1 5 2 5 1 5 1 3 1 3 1

1 21 0 -99999 1 1 5 1 2 5 1 3 1 2 2 3 3

1 20 1 9 2 0 2 2 1 4 1 5 1 2 1 3 1

0 21 1 9 1 0 1 1 2 5 3 3 1 3 1 5 1

1 21 1 13 1 1 2 1 2 4 4 2 1 2 -99999 4 1

0 24 0 -99999 1 1 3 2 2 6 1 5 1 3 -99999 4 1

1 24 0 -99999 3 0 2 1 2 4 1 5 1 3 5 3 1

0 21 1 6 1 0 2 3 2 5 1 3 1 3 1 3 1

1 21 0 -99999 2 0 4 1 2 3 1 4 1 3 1 1 1

0 23 1 16 3 0 1 4 2 4 1 4 3 3 1 3 2

1 22 0 -99999 3 0 2 3 2 4 1 3 1 2 2 4 1

1 21 1 19 2 1 2 2 2 5 4 1 1 3 1 3 2

1 22 0 -99999 3 0 2 4 2 4 3 3 1 2 1 3 2

stat female parents/pfreq

genr both=(parents.eq.1)

genr one=(parents.eq.2)

genr neither=(parents.eq.2)

stat tv/pfreq

genr lessfive=(tv.eq.1)

genr five=(tv.eq.2)

genr ten=(tv.eq.2)

genr fifteen=(tv.eq.2)

genr twenty=(tv.eq.2)

stat computer/pfreq

genr lessfive=(computer.eq.1)

genr five=(computer.eq.2)

genr ten=(computer.eq.2)

genr fifteen=(computer.eq.2)

genr twenty=(computer.eq.2)

stat sunglass/pfreq

genr yes=(sunglass.eq.1)

genr sometime=(sunglass.eq.2)

genr no=(sunglass.eq.3)

set noskipmiss

sort wrglass female age nearsght parents newspapr study tv movie bed posture computer video lighting nation studytm sunglass/desc

set skipmiss

genr q=time(0)

print q wrglass nearsght parents female tv computer

graph wrglass q / line

stat wrglass parents female tv computer

confid wrglass

confid parents

confid female

confid tv

confid computer

ols q wrglass/list

*try logs (for a better fit)

genr logq=log(q)

genr logp=log(wrglass)

ols logq logp / rstat loglog

*get the age of wearing glasses assuming indeps: parents, female, tv, computer

ols wrglass parents female tv computer/list

*using Logit to predict the probability of getting nearsighted

logit nearsght parents age female/list

stop

Hosted by www.Geocities.ws

1