This post was updated on .
Hi, I would like you to help me with a problem.
I have too many variables, but as an example I have variables such as: * passengers_in * passenger_out * CArgo_in * CArgo_out * Total_cargo (cargo_in + CArgo_out) And in some cases, Total_cargo is empty, but it has passenger_in or passenger_out. Consequently, I would like a syntax as an IF condition to eliminate data that has passengers and total_cargo empty. What I did was create a new variable = (passengers_in + passenger_out + Total_cargo) and then SELECT IF new_var>0. But it deleted all the data. -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (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 |
Hi, if empty variables are generally boring you: Jon Peck's concise solution might be easiest: begin program. import spss, spssaux2 spssaux2.FindEmptyVars(delete=True) end program. Mario Giesel Munich, Germany
Am Mittwoch, 28. August 2019, 05:15:37 MESZ hat gc_edelman <[hidden email]> Folgendes geschrieben:
Hi, I would like you to help me with a problem. I have too many variables, but as an example I have variables such as: * passengers_in * passenger_out * CArgo_in * CArgo_out * Total_cargo (cargo_in + CArgo_out) And in some cases, Total_cargo is empty, but it has passenger_in or passenger_out. Consequently, I would like a syntax as an IF condition to eliminate data that has passengers and total_cargo empty. -- ===================== 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 |
In reply to this post by gc_edelman
" I would like a syntax as an IF condition to eliminate data that has passengers and total_cargo empty. If you want to eliminate these cases you can say: SELECT IF NOT (SYSMIS(passengers_in) AND SYSMIS(passengers_out) AND SYSMIS(Total_cargo)) /*numerics needed*/. EXECUTE. Mario Giesel Munich, Germany ---------------------------------------
Am Mittwoch, 28. August 2019, 05:15:37 MESZ hat gc_edelman <[hidden email]> Folgendes geschrieben:
Hi, I would like you to help me with a problem. I have too many variables, but as an example I have variables such as: * passengers_in * passenger_out * CArgo_in * CArgo_out * Total_cargo (cargo_in + CArgo_out) And in some cases, Total_cargo is empty, but it has passenger_in or passenger_out. Consequently, I would like a syntax as an IF condition to eliminate data that has passengers and total_cargo empty. -- ===================== 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 |
In reply to this post by gc_edelman
what do you define as missing values for those variables?
if zero is defined as missing for one or more of the variables the addition will result as missing. DO you just want to skip those cases for a particular analysis but use them in some other analyses? check help on TEMPORARY. and on MISSING ----- Art Kendall Social Research Consultants -- 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
Art Kendall
Social Research Consultants |
Free forum by Nabble | Edit this page |