Return to the Pittsburgh Sleep Quality Index - Revised (PSQI - Revised) page

Script Author: Katja Borchert, Ph.D. ( for Millisecond Software, LLC
Date: 09-25-2013
last updated:  06-22-2018 by K.Borchert for Millisecond Software LLC

Script Copyright © 06-22-2018 Millisecond Software


This script implements the Pittsburgh Quality Sleep Index (PQSI) as described in:

Buysse, D.J., Reynolds, C.F. III, Monk, T.H., Berman, S.R. & Kupfer, D.J. (1989).
The Pittsburgh Sleep Quality Index: a new instrument for psychiatric practice and research. 
Psychiatry Research, 28, 193-213.

Note: the PSQI-Revised inquires only about one's sleep over the past week instead of the entire last month.

The PQSI poses 19 questions to participants (+ 5 optional ones to their partner at the very end).
The 19 questions assess 7 different components (or subscales):

Component1: Subjective Sleep Quality
Component2: Sleep Latency
Component3: Sleep Duration
Component4: Habitual Sleep Efficiency
Component5: Sleep Disturbances
Component6: Use of Sleep Medication
Component7: Daytime Dysfunction

Each of those components are scored on a scale from 0-3.
A Global PQSI Score is the sum of all those component scores (range: 0-21).

The default data stored in the data files are:

(1) Raw data file: 'PSQI_revised.iqdat' 

date, time, group, subject:		date and time script was run with the current group/subjectnumber 
build:							the Inquisit build 

q*_response:					response given (in assigned values)
q*_latency:						how much time (in ms) the participant spent on the surveypage with this particular question (the last time this particular surveypage was visited)

(2) Summary data file: 'PSQI_revised.summary*.iqdat' (a separate file for each participant)

script.startdate:				date script was run
script.starttime:				time script was started
script.subjectid:				subject id number
script.groupid:					group id number
script.elapsedtime:				time it took to run script (in ms)
computer.platform:				the platform the script was run on
/completed:						0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run)

Summarydata for each participant: file saves the scores for the subscales and totalscore 

textbox.age.response:			the reported age of the participant
/skippartnerquestions:			1 = partner questions were omitted; 0 = partner questions were run

included to check accuracy of scoring:
/bedduration:					the calculated time a participant spent in bed (though not necessarily sleeping)

/q5j:							contains the stored response for question 5j that is used to evaluate the response to calculate
								the component 5 score. The defaultresponse is "Not during the past week" unless participant
								provided another sleep disturbing reason AND selected a different response other than the defaultresponse.
								The value recorded under values.q5j MAY differ from the response recorded under radiobuttons.q5j2.response (see raw data file).
								This happens IF no other sleep disturbing reason was provided by participant but yet the defaultresponse
								for radiobuttons.q5j2 was changed. In this case, values.q5j still stores the defaultresponse which
								will evaluate to 0. 
								=> Without another sleep disturbing reason provided, the response will always be scored as 0

subcomponent scores on a scale from 0 (least problematic) to 3 (most problematic)									
Component 1 Score:
/comp1_subjectivesleepquality:	component1 score

Component 2 Score with subscores:

Component 3 Score: 
!Note: the scoring guidelines in the article were a bit fuzzy in regard to the boundaries
in this script: anything 7 or greater gets assigned a 0

Component 4 Score:
!Note: the scoring guidelines in the article were a bit fuzzy in regard to the boundaries
in this script: anything 85 or greater gets assigned a 0

Component 5 Score with subscores:
!Note: question 5j is optional as it requires participant to think of another reason
that could potentially disturb their sleep. Since not all participants might think of
something, this question was left optional (and the default response is "not during the past week")
=> the guidelines still include question 5j
*Note: /comp5_sleepdisturb_5j uses values.q5j instead of radiobuttons.q5j2.response

Component 6 Score:

Component 7 Score with subscores:

Global Score:
/Global_PSQIscoreR: sum of all sub component scores

check below for (relatively) easily editable parameters, stimuli, instructions etc. 
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment.

The parameters you can change are:

/skippartnerquestions:			true = the last 5 questions (partner questions) are skipped (default)			
								false = the last 5 questions are NOT skipped

Copyright © Millisecond Software. All rights reserved.
Contact | Terms of Service | Privacy Statement | Security Statement | GDPR