Posted by
Maguin, Eugene on
Mar 08, 2013; 10:43pm
URL: http://spssx-discussion.165.s1.nabble.com/time-interval-and-threshold-making-in-SPSS-or-excel-tp5718477p5718500.html
Vishal,
I'd say that it's time for you to learn spss syntax. The menus aren't going to work for this problem.
Read up on Casestovars, Vector, and Loop.
What follows an example syntax fragment that represents what I understand you want for one condition, meaning one temperature threshold and one time period. It's not tested.
So you have 1440 records per cow, 28800 records total.
Restructure the file using Casestovars to get 20 records with 1440 data values times 4 variables = 5760 + 1 (cow id) columns. The default will arrange the variables as cowid date.1 to date.1440, etc, which is what you need. Then put body temperature, call it 'temp', in a vector. Loop through the vector until you find an element that is greater than the target threshold temperature. However, there is no need to check past temp.1435 as a starting point. See why? Starting there check the next 5 items to see if each is over the threshold. If the count is 6, set the marker variable and exit the loop.
Rich and David are right in that you have a many more elements of the computations to make clear. For instance, do you want to know if the body temp is over threshold at every time point over, for example, the three day period, i.e., 144*3 timepoints?
Gene Maguin
-----Original Message-----
From: SPSSX(r) Discussion [mailto:
[hidden email]] On Behalf Of vishal
Sent: Friday, March 08, 2013 3:32 AM
To:
[hidden email]
Subject: time interval and threshold making in SPSS or excel
Dear Sir/ Madum/Friends,
I am a doctorate student working on the continuous body temperature measurement in domestic animals. I have measured body temperature at every
10 min for 10 days in 25 cows. The measured body temperature range is 37.8 to 41 ⁰C. After generating the data-set for my research, I produced certain thresholds like ≥ 39 ⁰C, ≥ 39.5⁰C and ≥ 40 ⁰C. It is easy with the Record Variable in to Different Variable function in Transfer menu of SPSS. Now my problem is, I would like to separate body temperature defining above 3 thresholds including certain time intervals. For example:
1. ≥ 39 ⁰C for 1hour, 3 hour, 6 hour, 1 day, 3 days etc
2. ≥ 39.5 ⁰C for 1hour, 3 hour, 6 hour, 1 day, 3 days etc
3. ≥ 40 ⁰C for 1hour, 3 hour, 6 hour, 1 day, 3 days etc
Is it possible in SPSS or Excel? If yes, how?
Please guide me for this this problem.
Below is the example of data table that I have generated:
Cow No Date Time (hh:mm) Days in Milk Body temperature (⁰C)
1 20/10/2012 10:10 2 39.0
1 20/10/2012 10:20 2 39.1
1 20/10/2012 10:30 2 39.1
1 20/10/2012 10:40 2 39.1
1 20/10/2012 10:50 2 39.1
1 20/10/2012 11:00 2 39.2
For 10 days
2 20/10/2012 10:10 2 38.6
2 20/10/2012 10:20 2 38.6
2 20/10/2012 10:30 2 38.7
2 20/10/2012 10:40 2 38.7
2 20/10/2012 10:50 2 38.7
2 20/10/2012 11:00 2 38.9
For 10 days
3 20/10/2012 10:10 2 38.8
3 20/10/2012 10:20 2 38.8
3 20/10/2012 10:30 2 38.8
3 20/10/2012 10:40 2 38.7
3 20/10/2012 10:50 2 38.7
3 20/10/2012 11:00 2 38.8
Like viz., I have data for 25 cows
Thanking you in advance!
Vishal
-----
vishal suthar
--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/time-interval-and-threshold-making-in-SPSS-or-excel-tp5718477.htmlSent 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