Compute season from available dates

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

Re: Compute season from available dates

David Marso
Administrator
COMPUTE month=XDATE.MONTH(yourdatevariable) .
RECODE month (3 thru 5=1) (6 thru 8=2) (9 thru 11=3) (ELSE=4) INTO Season.
ADD VALUE LABELS Season 1 'Spring' 2 'Summer' 3 'Autumn' 4 'Winter' .



bdates wrote

> Try this (tested).
>
>
> compute season=XDATE.MONTH(yourdatevariable) .
> RECODE Season (3 thru 5=1) (6 thru 8=2) (9 thru 11=3) (ELSE=4).
> execute .
> add value labels season 1 'Spring' 2 'Summer' 3 'Autumn' 4 'Winter' .
>
>
>
> Brian
> ________________________________
> From: SPSSX(r) Discussion <

> SPSSX-L@.UGA

> > on behalf of spssdummy <

> mischa.lenaers@

> >
> Sent: Tuesday, May 7, 2019 3:53:43 PM
> To:

> SPSSX-L@.UGA

> Subject: Re: Compute season from available dates
>
> That's indeed true. I now have 12 months (like january has no.1 and
> december
> has no.12). Now I want to convert this into the seasons, so winter
> (12,1,2),
> spring (3,4,5), summer (6,7,8) and autumn (9,10,11). Any suggestions?
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (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

> LISTSERV@.UGA

>  (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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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: Compute season from available dates

spssdummy
In reply to this post by David Marso
Don't understand that



--
Sent from: http://spssx-discussion.1045642.n5.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
Reply | Threaded
Open this post in threaded view
|

Re: Compute season from available dates

David Marso
Administrator
Don't understand what?
--

spssdummy wrote
> Don't understand that
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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: Compute season from available dates

bdates
In reply to this post by spssdummy

What don't you understand, Mischa? My syntax and David's are virtually equivalent. He recoded into another variable and I didn't, but the end product is the same.


Brian

From: SPSSX(r) Discussion <[hidden email]> on behalf of spssdummy <[hidden email]>
Sent: Tuesday, May 7, 2019 4:28:41 PM
To: [hidden email]
Subject: Re: Compute season from available dates
 
Don't understand that



--
Sent from: http://spssx-discussion.1045642.n5.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: Compute season from available dates

Michael Kruger-3
In reply to this post by spssdummy

I suggest you get a basic book on using SPSS and play around with compute and transform features of the menu. You are asking to do some very basic stuff here. You don’t need to even use syntax for this to get recoded.

 

MK

 

Sent from Mail for Windows 10

 


From: SPSSX(r) Discussion <[hidden email]> on behalf of spssdummy <[hidden email]>
Sent: Tuesday, May 7, 2019 3:53:43 PM
To: [hidden email]
Subject: Re: Compute season from available dates
 
That's indeed true. I now have 12 months (like january has no.1 and december
has no.12). Now I want to convert this into the seasons, so winter (12,1,2),
spring (3,4,5), summer (6,7,8) and autumn (9,10,11). Any suggestions?



--
Sent from: http://spssx-discussion.1045642.n5.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: Compute season from available dates

David Marso
Administrator
In reply to this post by bdates
Reply was to:
"You need to post your syntax along with frequencies pre and post RECODE."

My only possible response to that is FACEPALM... WTF.




bdates wrote
> What don't you understand, Mischa? My syntax and David's are virtually
> equivalent. He recoded into another variable and I didn't, but the end
> product is the same.
>
>
> Brian
> ________________________________
> From: SPSSX(r) Discussion &lt;

> SPSSX-L@.UGA

> &gt; on behalf of spssdummy &lt;

> mischa.lenaers@

> &gt;
> Sent: Tuesday, May 7, 2019 4:28:41 PM
> To:

> SPSSX-L@.UGA

> Subject: Re: Compute season from available dates
>
> Don't understand that
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
> SPSSX Discussion | Mailing List
> Archive&lt;http://spssx-discussion.1045642.n5.nabble.com/&gt;
> spssx-discussion.1045642.n5.nabble.com
> SPSSX Discussion forum and mailing list archive. This forum is an archive
> for the mailing list

> spssx-l@.uga

>  (more options) Messages posted here will be sent to this mailing list.
>
>
>
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (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

> LISTSERV@.UGA

>  (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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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: Compute season from available dates

David Marso
Administrator
In reply to this post by spssdummy
You probably want to rethink that. Seasons are not delimited by month
boundaries.
Eg only about 10 days of June occur in Summer...etc



spssdummy wrote

> Hey,
> I would like to add the variable season to my data set, consisting of
> winter
> (december-february), spring (march-may), summer (june-august), and autumn
> (september-november). I want to do this by using the dates that are
> available in my dataset, which are formatted as day.month.year (e.g.
> 01.01.2010). I have tried compute variable and recode into different
> variables, but nothing has worked so far.
>
> Thank you for helping out x
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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: Compute season from available dates

Bruce Weaver
Administrator
I think the OP wants to code the meteorological seasons, not the astronomical
seasons.  

   https://www.timeanddate.com/calendar/aboutseasons.html



David Marso wrote

> You probably want to rethink that. Seasons are not delimited by month
> boundaries.
> Eg only about 10 days of June occur in Summer...etc
>
>
> spssdummy wrote
>> Hey,
>> I would like to add the variable season to my data set, consisting of
>> winter
>> (december-february), spring (march-may), summer (june-august), and autumn
>> (september-november). I want to do this by using the dates that are
>> available in my dataset, which are formatted as day.month.year (e.g.
>> 01.01.2010). I have tried compute variable and recode into different
>> variables, but nothing has worked so far.
>>
>> Thank you for helping out x





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
12