Skip to main content

Table 1 The steps and SPSS syntax to calculate and recode the statistical variable of Admmonth

From: Data preparation techniques for a perinatal psychiatric study based on linked data

Step

Variable and label

SPSS syntax

Explanation

1

Admdays: number of days between hospital admission and birth.

COMPUTE Admdays = AGEAdmMum – AgeBirthMum.VARIABLE LABELS Admdays 'Hospital admission days before and after birth'.EXECUTE.

If the value of Admdays is less than 0, it means the hospital admission is before birth.A positive value means the admission is after birth.

2

Admmonth: admission month before pregnancyGage : gestational age in days

IF (Admdays < 0) Admmonth = Admdays + Gage.EXECUTE.RECODE Admmonth (lowest thru −361 = 0)(−360 thru −331 = 1)(−330 thru −301 = 2)……(−60 thru −31 = 11) (−30 thru −1 = 12).EXECUTE.

Value 0 refers to the admission before the 12th month before pregnancy.1: the admission in the 12th month before pregnancy……11: the admission in the second month before pregnancy.12: the admission in the first month before pregnancy.

3

Admmonth: admission month during pregnancy

RECODE Admmonth (0 thru 29 = 13) (30 thru 59 = 14)…… (300 thru 329 = 23).EXECUTE.

13: the admission in the first month of pregnancy.14: the admission in the second month of pregnancy……23: the admission in the 11th month of pregnancy.

4

Admmonth: admission month after birth

DO IF (Admdays > = 0).RECODE Admdays (0 thru 29 = 24) (30 thru 59 = 25)…… (330 thru 359 = 35) (360 thru Highest = 36) INTO Admmonth.END IF.EXECUTE.VARIABLE LABELS Admmonth 'Hospital admission month before and after birth'.VALUE LABELS Admmonth 0 'before' 1 ' the 12th month before pregnancy' ……11 ' the 2nd month before pregnancy' 12 ' the 1st month before pregnancy’ 13 ' the first month of pregnancy ' 14' the second month of pregnancy '……23' the 11th month of pregnancy' 24 ' the first month after birth ' 25' the second month after birth '……35' the 12th month after birth '36' after'.

24: refers to the admission in the first month after birth.25: refers to the admission in the second month after birth……35: refers to the admission in the 12th month after birth.36: refers to the admission after the 12th month after birth.