|
Hi everyone,
I would really appreciate it if someone could give me some guidance: I am working on a data file that contains two lines for each individual, one weekend diary and one weekend diary for each. I have created a dichotomous variable (weekday active 0/1) from the first line of each person, namely the weekeday diary. I now want to analyze the other line of all individuals (the weekend diary) that are weekday active = 1 (in their other line). Is there a way that I can do that with an spss command to filter out people that are weekday active = 0 in the one line to be able to analyze only the ones that are 1? Many thanks in advance, Anna |
|
Not quite clear what your data look like, but have
you tried:
select if
weekday = 0.
..then do the analysis. If you want to keep
all the data intact, you need to write:
temporary.
select if
weekday = 0.
...otherwise you'll lose all the other cases in the
file.
Sorry, but I only use syntax. To do this in
Mickey-Mouse use:
File
New
Syntax <IMG height=245 src="file://C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image002.jpg" width=625 v:shapes="_x0000_i1025">
write the commands in the box (including full stops) and then run.
|
|
In reply to this post by annastella
Anna
Not sure you needed do
if
What's wrong with...
if ((freetime > 8.9) & (weekend = 1)) timepoor=0.
if ((freetime < 9) & (weekend = 1)) timepoor=1.
If you want me to have a look at your SPSS
*.sav file and your questionnaire/schedule or whatever
instrument you've used, send me an attachment and I'll have a look at
it.
Meanwhile check out the absolute
beginner stuff under Teaching Documents on my
webpage
Years ago (1972-ish) I used to joke about writing
The Clods' Guide to Survey Analysis (using SPSS). In 2009
I'm well on the way!
Meanwhile, back to some more tutorials for the
site.
John
|
|
Administrator
|
In reply to this post by annastella
Try this: use all. compute weekend = NOT weekday. format weekend(f1.0). filter by weekend. exe. * Analyses of weekend data here . filter off. /* use all records again. Note that the line "compute weekend = NOT weekday" could have been written as: "compute weekend = (weekday EQ 0)". But in SPSS, variables that have only 1 and 0 as values (like your WEEKDAY) can be treated the same way as boolean variables in other programming languages,with 1=True, and 0=False. This allows you to write somewhat more readable code like "compute weekend = NOT weekday".
--
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/). |
| Free forum by Nabble | Edit this page |
