I think you want to know which variables have no valid data although I’m not quite sure since this part is confusing (… with
100% missing data means. ) First off, I figure that this type of job is probably going to be more easily done with python. I don’t think that a macro per se help you.
This is not tested but it is how I’d start.
Recode v1 to v1000(missing=1)(else=0).
Aggregate outfile=*/cum1 to cum1000=sum(v1 to v1000).
Flip. /* this is the key. Make sure you read the documentation on this command.
*You will have to check variable names at this point. I will assume two colums: variable_name and var_value. Variable_name is just the name of the variable and var_value is its sum. Then.
Do if (var_value eq N_cases). /* N_cases is the number of cases.
Print / var_name var_value.
End if.
Execute.
Here’s another way that uses oms.
OMS /SELECT TABLES/IF COMMANDS=['descriptives'] SUBTYPES=[' descriptive statistics']/
DESTINATION FORMAT=SAV OUTFILE='>your file location-name<'.
descriptives v1 to v1000/statistics sum.
oms end.
Get FILE='>your file location-name<'.
*Look at at this file carefully and notice how it compares to the descriptives output table. I think you will see it has four variables:
Command_
Subtype_
Label_
Var1
N
Mean.
*Var1 is the names of variables listed in the descriptives command,
*N is the count of valid cases.
*Mean is, well, the mean.
*You want Var1 and N. Specifically:
Do if (N eq 0).
Print / var1 N.
End if.
Execute.
Gene Maguin
From: SPSSX(r) Discussion [mailto:[hidden email]]
On Behalf Of Manoj Arora (DEL/Abacus Analytics)
Sent: Tuesday, August 27, 2013 8:00 AM
To: [hidden email]
Subject:
Hi All,
In my data file I have around 1000 variables and I want to know all the variables with 100% missing data means. With the help of Descriptive command we can check the valid response but in that case I will have to pass
all 1000 variables. If anyone have some macro to print the missing data it will help a lot.
Regards
Manoj
http://www.imrbint.com/disclaimer.html