How to display values of custom attributes.

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

How to display values of custom attributes.

Art Kendall
In preparing documentation for handing off a dataset, I would like to show what values occur in custom attributes.

For example, if there is a custom attribute called Var.Grouping.  
I would like to see something like a frequency count for its values without the numbers.
Var.Grouping
Bathing
Cooking
Medical
Financial

One way would be if the Variable View were turned into a dataset omitting Name, Label, Values, Missing.
I could then edit the output from a FREQUENCIES.
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: How to display values of custom attributes.

Art Kendall
With help from Jon about CODEBOOK and the OMS section, I ended up with this.

I can now easily copy the AttValues dataset to a word processor.

GET
  FILE='C:\Users\Art\Desktop\ Something\August 16 2021.sav'.
DATASET NAME DataSet1 WINDOW=FRONT.
CODEBOOK ALL /VARINFO ATTRIBUTES  /STATISTICS  NONE.
dataset declare attrs.
oms select tables /if subtypes='Variable Attributes'
/destination outfile=attrs format=sav.
display attributes.
omsend.
DATASET ACTIVATE attrs.
* remove Custom Attributes that are specific to each variable.
Select if var2 NE 'Question' and var2 NE 'Comment1'.
sort cases by var2 var3.
dataset declare AttValues.
aggregate outfile=AttValues /break = var2 Var3
    /val= first(var3).
*remove the redundant variable val.
DATASET ACTIVATE AttValues.
DELETE VARIABLES val.

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: How to display values of custom attributes.

Bruce Weaver
Administrator
Art, thanks for following up with the solution you arrived at.  If only all posters did that!  

Cheers,
Bruce

Art Kendall wrote
With help from Jon about CODEBOOK and the OMS section, I ended up with this.

I can now easily copy the AttValues dataset to a word processor.

GET
  FILE='C:\Users\Art\Desktop\ Something\August 16 2021.sav'.
DATASET NAME DataSet1 WINDOW=FRONT.
CODEBOOK ALL /VARINFO ATTRIBUTES  /STATISTICS  NONE.
dataset declare attrs.
oms select tables /if subtypes='Variable Attributes'
/destination outfile=attrs format=sav.
display attributes.
omsend.
DATASET ACTIVATE attrs.
* remove Custom Attributes that are specific to each variable.
Select if var2 NE 'Question' and var2 NE 'Comment1'.
sort cases by var2 var3.
dataset declare AttValues.
aggregate outfile=AttValues /break = var2 Var3
    /val= first(var3).
*remove the redundant variable val.
DATASET ACTIVATE AttValues.
DELETE VARIABLES val.
--
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/).
Reply | Threaded
Open this post in threaded view
|

Re: How to display values of custom attributes.

Art Kendall
I too wish OPs would respond with solutions they ended up with.  I also wish OPs would respond when a suggested solution worked.

Since LISTSERV became common in the '80s the SPSS list has been a major way for me to avoid re-inventing the wheel.


Custom attributes and the ability to export what is in the Variables View help me show why I think SPSS is a useful tool.
Art Kendall
Social Research Consultants