Hi,
If your dates are in date format I would for each interview create a variable that is 1 if completed, 0 if not, and a similar variable for each of the other statuses.
If it is not a date variable you will have to convert it to a date first or days since the start as Jon suggests.
Then I would aggregate to count the response types for each day, and finally, compute a cumulative i.e.
compute completed=0.
if (responsestatus=1) completed=1.
compute incomplete=0.
if responsestatus=2 incomplete=1.
dataset declare respaggregate.
aggregate outfile=respaggregate
/break interviewdate
/complete=sum(completed)
/incomplete=sum(incomplete)
/totalinterviews=N(responsestatus).
* Then do cumulative.
dataset activate respaggregate.
numeric cumcomplete cumincomplete cumtotal (F4.0).
do repeat daily=complete incomplete totalinterviews
/cumulative=cumcomplete cumincomplete cumtotal.
compute cumulative=0.
do if missing(lag(cumulative)).
compute cumulative=daily.
else.
compute cumulative=daily+lag(cumulative).
end if.
end repeat.
exe.
Hope this is what you asked.
best
Jon
------------------------------
Jon Pedersen
------------------------------
Original Message:
Sent: Thu April 28, 2022 09:23 AM
From: Jon Peck
Subject: Cumulative frequency of dates
If what you are looking for is a transformation that extracts the number of days since the start date, you can use the DATEDIFF function. If the start date is, for example,1,1,2022, you could write
compute days = datediff(thedate, yrmoda(2022,1,1), 'days').
where thedate is a date variable recording the end date.
--
Original Message:
Sent: 4/28/2022 4:10:00 AM
From: Aaron Timoshanko
Subject: Cumulative frequency of dates
Hi there,
I am very new to SPSS. I have tried to find an answer online with no luck. I suspect it is because I am not using the correct terms for my queries.
I am wanting to graphically represent the number of complete and incomplete survey responses over time. The survey data has been successfully imported from LimeSurvey. I have calculated a cumulative tally of the complete and incomplete survey responses into two new variables. What I am struggling to do is create a variable for the time (X) axis.
For example, two respondents completed the survey on the 16th and 7 respondents on the 17th. I am somehow wanting each date to be counted once, regardless of the number of responses received for each day. So I can then graph 2 completions on day 1 and 7 completions on day 2 etc. and do the same (on the same graph) with the total of each incomplete survey response for each day to see whether certain interventions have improved the completion rate.
I appreciate any help or advice you can provide.
Kind Regards
Aaron
------------------------------
Aaron Timoshanko
------------------------------
#SPSSStatistics