SDQ: Generating scores in STATA

The scoring algorithm is based on the 25 variables plus impact items for each questionnaire. The algorithm expects to find these variables with specific names: the first letter of each variable name is 'p' for the parent SDQ, 's' for the self-report SDQ and 't' for the teacher SDQ. After this first letter, the variable names are as follows:

consid =Item 1 : considerate
restles =Item 2 : restless
somatic =Item 3 : somatic symptoms
shares =Item 4 : shares readily
tantrum =Item 5 : tempers
loner =Item 6 : solitary
obeys =Item 7 : obedient
worries =Item 8 : worries
caring =Item 9 : helpful if someone hurt
fidgety =Item 10 : fidgety
friend =Item 11 : has good friend
fights =Item 12 : fights or bullies
unhappy =Item 13 : unhappy
popular =Item 14 : generally liked
distrac =Item 15 : easily distracted
clingy =Item 16 : nervous in new situations
kind =Item 17 : kind to younger children
lies =Item 18 : lies or cheats [for the SDQ for 2-4 year olds, replace 'lies' with 'argues']
bullied =Item 19 : picked on or bullied
helpout =Item 20 : often volunteers
reflect =Item 21 : thinks before acting
steals =Item 22 : steals [for the SDQ for 2-4 year olds, replace 'steals' with 'spite']
oldbest =Item 23 : better with adults than with children
afraid =Item 24 : many fears
attends =Item 25 : good attention
ebddiff =Impact question: oveall difficulties in at least one area
distres =Impact question: upset or distressed
imphome =Impact question: interferes with home life
impfrie =Impact question: interferes with friendships
impclas =Impact question: interferes with learning
impleis =Impact question: interferes with leisure

For each of these items, if the first response category (not true, no, not at all) has been selected, this is coded as zero, the next response category (somewhat true, yes-minor, just a little) is coded as one and so on.

For each informant, the algorithm generates six scores. The first letter of each derived variable is 'p' for parent-based scores, 's' for self-report-based scores and 't' for teacher-based scores. After this first letter, the names of the scores are as follows:

emotion =emotional symptoms
conduct =conduct problems
hyper =hyperactivity/inattention
peer =peer problems
prosoc =prosocial
ebdtot =total difficulties
impact =impact

*** Recoding variables and then scoring the parent SDQ scores

recode pobeys (0=2) (1=1) (2=0) (else=.), gen(qobeys)
recode preflect (0=2) (1=1) (2=0) (else=.) , gen(qreflect)
recode pattends (0=2) (1=1) (2=0) (else=.), gen(qattends)
recode pfriend (0=2) (1=1) (2=0) (else=.), gen(qfriend)
recode ppopular (0=2) (1=1) (2=0) (else=.), gen(qpopular)

recode pdistres (0=0) (1=0) (2=1) (3=2) (.=0), gen(qqdistres)
recode pimphome (0=0) (1=0) (2=1) (3=2) (.=0), gen(qqimphome)
recode pimpfrie (0=0) (1=0) (2=1) (3=2) (.=0), gen(qqimpfrie)
recode pimpclas (0=0) (1=0) (2=1) (3=2) (.=0), gen(qqimpclas)
recode pimpleis (0=0) (1=0) (2=1) (3=2) (.=0), gen(qqimpleis)

egen nemotion=robs(psomatic pworries punhappy pclingy pafraid)
egen pemotion=rmean(psomatic pworries punhappy pclingy pafraid) if nemotion>2
replace pemotion=round(pemotion*5)

egen nconduct=robs(ptantrum qobeys pfights plies psteals)
egen pconduct=rmean(ptantrum qobeys pfights plies psteals) if nconduct>2
replace pconduct=round(pconduct*5)

egen nhyper=robs(prestles pfidgety pdistrac qreflect qattends)
egen phyper=rmean(prestles pfidgety pdistrac qreflect qattends) if nhyper>2
replace phyper=round(phyper*5)

egen npeer=robs(ploner qfriend qpopular pbullied poldbest)
egen ppeer=rmean(ploner qfriend qpopular pbullied poldbest) if npeer>2
replace ppeer=round(ppeer*5)

egen nprosoc=robs(pconsid pshares pcaring pkind phelpout)
egen pprosoc=rmean(pconsid pshares pcaring pkind phelpout) if nprosoc>2
replace pprosoc=round(pprosoc*5)

egen nimpact=robs(pdistres pimphome pimpfrie pimpclas pimpleis)
gen pimpact=qqdistres+qqimphome+qqimpfrie+qqimpclas+qqimpleis if (nimpact!=0)
replace pimpact=0 if pebddiff==0

drop qobeys qreflect qattends qfriend qpopular qqdistres qqimphome qqimpfrie qqimpclas qqimpleis nemotion nconduct nhyper npeer nprosoc nimpact

gen pebdtot=pemotion+pconduct+phyper+ppeer

*** Recoding variables and then scoring the child SDQ scores

recode sobeys (0=2) (1=1) (2=0) (else=.), gen(robeys)
recode sreflect (0=2) (1=1) (2=0) (else=.) , gen(rreflect)
recode sattends (0=2) (1=1) (2=0) (else=.), gen(rattends)
recode sfriend (0=2) (1=1) (2=0) (else=.), gen(rfriend)
recode spopular (0=2) (1=1) (2=0) (else=.), gen(rpopular)

recode sdistres (0=0) (1=0) (2=1) (3=2) (.=0), gen(rrdistres)
recode simphome (0=0) (1=0) (2=1) (3=2) (.=0), gen(rrimphome)
recode simpfrie (0=0) (1=0) (2=1) (3=2) (.=0), gen(rrimpfrie)
recode simpclas (0=0) (1=0) (2=1) (3=2) (.=0), gen(rrimpclas)
recode simpleis (0=0) (1=0) (2=1) (3=2) (.=0), gen(rrimpleis)

egen nemotion=robs(ssomatic sworries sunhappy sclingy safraid)
egen semotion=rmean(ssomatic sworries sunhappy sclingy safraid) if nemotion>2
replace semotion=round(semotion*5)

egen nconduct=robs(stantrum robeys sfights slies ssteals)
egen sconduct=rmean(stantrum robeys sfights slies ssteals) if nconduct>2
replace sconduct=round(sconduct*5)

egen nhyper=robs(srestles sfidgety sdistrac rreflect rattends)
egen shyper=rmean(srestles sfidgety sdistrac rreflect rattends) if nhyper>2
replace shyper=round(shyper*5)

egen npeer=robs(sloner rfriend rpopular sbullied soldbest)
egen speer=rmean(sloner rfriend rpopular sbullied soldbest) if npeer>2
replace speer=round(speer*5)

egen nprosoc=robs(sconsid sshares scaring skind shelpout)
egen sprosoc=rmean(sconsid sshares scaring skind shelpout) if nprosoc>2
replace sprosoc=round(sprosoc*5)

egen nimpact=robs(sdistres simphome simpfrie simpclas simpleis)
gen simpact=rrdistres+rrimphome+rrimpfrie+rrimpclas+rrimpleis if (nimpact!=0)
replace simpact=0 if sebddiff==0

drop robeys rreflect rattends rfriend rpopular rrdistres rrimphome rrimpfrie rrimpclas rrimpleis nemotion nconduct nhyper npeer nprosoc nimpact

gen sebdtot=semotion+sconduct+shyper+speer

*** Recoding variables and then scoring the teacher SDQ scores

recode tobeys (0=2) (1=1) (2=0) (else=.), gen(uobeys)
recode treflect (0=2) (1=1) (2=0) (else=.) , gen(ureflect)
recode tattends (0=2) (1=1) (2=0) (else=.), gen(uattends)
recode tfriend (0=2) (1=1) (2=0) (else=.), gen(ufriend)
recode tpopular (0=2) (1=1) (2=0) (else=.), gen(upopular)

recode tdistres (0=0) (1=0) (2=1) (3=2) (.=0), gen(uudistres)
recode timpfrie (0=0) (1=0) (2=1) (3=2) (.=0), gen(uuimpfrie)
recode timpclas (0=0) (1=0) (2=1) (3=2) (.=0), gen(uuimpclas)

egen nemotion=robs(tsomatic tworries tunhappy tclingy tafraid)
egen temotion=rmean(tsomatic tworries tunhappy tclingy tafraid) if nemotion>2
replace temotion=round(temotion*5)

egen nconduct=robs(ttantrum uobeys tfights tlies tsteals)
egen tconduct=rmean(ttantrum uobeys tfights tlies tsteals) if nconduct>2
replace tconduct=round(tconduct*5)

egen nhyper=robs(trestles tfidgety tdistrac ureflect uattends)
egen thyper=rmean(trestles tfidgety tdistrac ureflect uattends) if nhyper>2
replace thyper=round(thyper*5)

egen npeer=robs(tloner ufriend upopular tbullied toldbest)
egen tpeer=rmean(tloner ufriend upopular tbullied toldbest) if npeer>2
replace tpeer=round(tpeer*5)

egen nprosoc=robs(tconsid tshares tcaring tkind thelpout)
egen tprosoc=rmean(tconsid tshares tcaring tkind thelpout) if nprosoc>2
replace tprosoc=round(tprosoc*5)

egen nimpact=robs(tdistres timpfrie timpclas)
gen timpact=uudistres+uuimpfrie+uuimpclas if (nimpact!=0)
replace timpact=0 if tebddiff==0

drop uobeys ureflect uattends ufriend upopular uudistres uuimpfrie uuimpclas nemotion nconduct nhyper npeer nprosoc nimpact

gen tebdtot=temotion+tconduct+thyper+tpeer

The predictive algorithm was converted into STATA syntax by Anna Goodman, Richard Rowe and Ye Gan


Last modified : 8/01/10