|
I’m
trying to create output that provides frequencies for a date variable in the
DD-MMM-YYYY format without including the day or year so that I have a count of
the number of responses that are on a day in January, the count in February,
and so on. If I just run frequencies on the variable as is I get a count for
every day that there was a response. I
tried changing the date variable type from “DD-MMM-YYYY” to “January,
February” and only the months are then shown but then the frequencies are
still listed for every day AND the days are represented as numbers. How do I
get a list of the months with a count for each? Thanks! ____________________________________ Justin
Meyer Researcher Rowland
Reading Foundation 6120
University Avenue Middleton,
WI 53562 phone:
866-370-7323 fax: 608-204-3846 ____________________________________ |
|
I’m not sure how you changed the date variable type but changing the format doesn’t change the underlying value. Use the XDATE function to extract the month and year as variables in COMPUTE commands. Then summarize your data using the SUMMARIZE command. Use Month and Year as grouping variables and response as your summary variable. If you don’t have a response variable, and just want to count cases, create a constant variable equal to 1. The Count or Sum statistics will give you a count of cases for each combination of month and year. From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Justin Meyer I’m trying to create output that provides frequencies for a date variable in the DD-MMM-YYYY format without including the day or year so that I have a count of the number of responses that are on a day in January, the count in February, and so on. If I just run frequencies on the variable as is I get a count for every day that there was a response. I tried changing the date variable type from “DD-MMM-YYYY” to “January, February” and only the months are then shown but then the frequencies are still listed for every day AND the days are represented as numbers. How do I get a list of the months with a count for each? Thanks! ____________________________________ Justin Meyer Researcher Rowland Reading Foundation 6120 University Avenue Middleton, WI 53562 phone: 866-370-7323 fax: 608-204-3846 ____________________________________ |
|
I do this kind of thing all the time. Create a variable like this. Numeric month_year(moyr8). Compute month_year = date.moyr(xdate.month(date_variable),
xdate.year(date_variable)). Run frequencies on month_year. Matthew Pirritano, Ph.D. Research Analyst IV Medical Services Initiative (MSI) Orange County Health Care Agency (714) 568-5648 From: SPSSX(r)
Discussion [mailto:[hidden email]] On
Behalf Of ViAnn Beadle I’m not sure how you changed the
date variable type but changing the format doesn’t change the underlying
value. Use the XDATE function to extract the month and year as variables in
COMPUTE commands. Then summarize your data using the SUMMARIZE command. Use
Month and Year as grouping variables and response as your summary variable. If
you don’t have a response variable, and just want to count cases,
create a constant variable equal to 1. The Count or Sum statistics will
give you a count of cases for each combination of month and year. From: SPSSX(r)
Discussion [mailto:[hidden email]] On
Behalf Of Justin Meyer I’m trying to
create output that provides frequencies for a date variable in the DD-MMM-YYYY
format without including the day or year so that I have a count of the number
of responses that are on a day in January, the count in February, and so on. If
I just run frequencies on the variable as is I get a count for every day that
there was a response. I tried changing the
date variable type from “DD-MMM-YYYY” to “January,
February” and only the months are then shown but then the frequencies are
still listed for every day AND the days are represented as numbers. How do I
get a list of the months with a count for each? Thanks! ____________________________________ Justin Meyer Researcher Rowland
Reading Foundation phone: 866-370-7323 fax: 608-204-3846 ____________________________________ |
| Free forum by Nabble | Edit this page |
