repeated measures first and last response

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

repeated measures first and last response

parisec
Hi all

I have a flat file that looks like this.

ID  Q1_T1  Q1_T2 Q1_T3 Q1_T4
1   5             6
2   3             4        5
3   4             4        4
4   2             1        3       6

Q1 was asked multiple times over time and some answered it more than others. The goal is to compute the difference between the first time and last time they answered the question.

So I want to tell SPSS:

look at Q1_T1 through Q1_T4
  compute Q1_First = Q1_T1
  compute Q1_Last = "the last T that has a value"

so that the file  looks like this.

ID  Q1_First  Q1_Last
1   5                6
2   3                5
3   4                4
4   2                6

Suggestions for syntax?

Thanks much.
Carol




Reply | Threaded
Open this post in threaded view
|

Re: repeated measures first and last response

David Marso
Administrator

http://spssx-discussion.1045642.n5.nabble.com/creating-last-available-score-from-multiple-measurement-occasions-td5728633.html

parisec wrote
Hi all

I have a flat file that looks like this.

ID  Q1_T1  Q1_T2 Q1_T3 Q1_T4
1   5             6
2   3             4        5
3   4             4        4
4   2             1        3       6

Q1 was asked multiple times over time and some answered it more than others. The goal is to compute the difference between the first time and last time they answered the question.

So I want to tell SPSS:

look at Q1_T1 through Q1_T4
  compute Q1_First = Q1_T1
  compute Q1_Last = "the last T that has a value"

so that the file  looks like this.

ID  Q1_First  Q1_Last
1   5                6
2   3                5
3   4                4
4   2                6

Suggestions for syntax?

Thanks much.
Carol
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: repeated measures first and last response

parisec
In reply to this post by parisec

Thank you!  I'll check this out.

 

From: Jignesh Sutar [mailto:[hidden email]]
Sent: Friday, February 13, 2015 3:18 PM
To: Parise, Carol A.
Cc: [hidden email]
Subject: Re: repeated measures first and last response

 

A very similar question with a solution was posted just this week:

 

 



On Friday, 13 February 2015, parisec <[hidden email]> wrote:

Hi all

I have a flat file that looks like this.

ID  Q1_T1  Q1_T2 Q1_T3 Q1_T4
1   5             6
2   3             4        5
3   4             4        4
4   2             1        3       6

Q1 was asked multiple times over time and some answered it more than others.
The goal is to compute the difference between the first time and last time
they answered the question.

So I want to tell SPSS:

look at Q1_T1 through Q1_T4
  compute Q1_First = Q1_T1
  compute Q1_Last = "the last T that has a value"

so that the file  looks like this.

ID  Q1_First  Q1_Last
1   5                6
2   3                5
3   4                4
4   2                6

Suggestions for syntax?

Thanks much.
Carol








--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/repeated-measures-first-and-last-response-tp5728695.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
<a href="javascript:;">LISTSERV@... (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: repeated measures first and last response

Jignesh Sutar
In reply to this post by parisec
This will calculate you the value of the last time period answered under single column:

VECTOR x=Q1_T1 to Q1_T4. 
LOOP Last_Position=4 TO 1 BY -1 .
END LOOP IF NOT MISSING(x(Last_Position)).
COMPUTE Last_Score=x(Last_Position).




On Friday, 13 February 2015, Jignesh Sutar <[hidden email]> wrote:
A very similar question with a solution was posted just this week:




On Friday, 13 February 2015, parisec <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;PariseC@sutterhealth.org&#39;);" target="_blank">PariseC@...> wrote:
Hi all

I have a flat file that looks like this.

ID  Q1_T1  Q1_T2 Q1_T3 Q1_T4
1   5             6
2   3             4        5
3   4             4        4
4   2             1        3       6

Q1 was asked multiple times over time and some answered it more than others.
The goal is to compute the difference between the first time and last time
they answered the question.

So I want to tell SPSS:

look at Q1_T1 through Q1_T4
  compute Q1_First = Q1_T1
  compute Q1_Last = "the last T that has a value"

so that the file  looks like this.

ID  Q1_First  Q1_Last
1   5                6
2   3                5
3   4                4
4   2                6

Suggestions for syntax?

Thanks much.
Carol








--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/repeated-measures-first-and-last-response-tp5728695.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: repeated measures first and last response

David Marso
Administrator
Wow Jignesh, that looks like a very interesting solution ;-)
Jignesh Sutar wrote
This will calculate you the value of the last time period answered under
single column:

VECTOR x=Q1_T1 to Q1_T4.
LOOP Last_Position=4 TO 1 BY -1 .
END LOOP IF NOT MISSING(x(Last_Position)).
COMPUTE Last_Score=x(Last_Position).




On Friday, 13 February 2015, Jignesh Sutar <[hidden email]> wrote:

> A very similar question with a solution was posted just this week:
>
>
> http://spssx-discussion.1045642.n5.nabble.com/creating-last-available-score-from-multiple-measurement-occasions-td5728633.html
>
>
>
> On Friday, 13 February 2015, parisec <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> wrote:
>
>> Hi all
>>
>> I have a flat file that looks like this.
>>
>> ID  Q1_T1  Q1_T2 Q1_T3 Q1_T4
>> 1   5             6
>> 2   3             4        5
>> 3   4             4        4
>> 4   2             1        3       6
>>
>> Q1 was asked multiple times over time and some answered it more than
>> others.
>> The goal is to compute the difference between the first time and last time
>> they answered the question.
>>
>> So I want to tell SPSS:
>>
>> look at Q1_T1 through Q1_T4
>>   compute Q1_First = Q1_T1
>>   compute Q1_Last = "the last T that has a value"
>>
>> so that the file  looks like this.
>>
>> ID  Q1_First  Q1_Last
>> 1   5                6
>> 2   3                5
>> 3   4                4
>> 4   2                6
>>
>> Suggestions for syntax?
>>
>> Thanks much.
>> Carol
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://spssx-discussion.1045642.n5.nabble.com/repeated-measures-first-and-last-response-tp5728695.html
>> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>> [hidden email] (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command
>> SIGNOFF SPSSX-L
>> For a list of commands to manage subscriptions, send the command
>> INFO REFCARD
>>
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"