Tabulate frequencies of ID values with a Universe of cases

What would you like to see in CSPro?
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Tabulate frequencies of ID values with a Universe of cases

Post by AriSilva »

Hi folks,
In the DataViewer, if you apply a universe using variables of a specific record, say, age = 0, and you want to know which cases have these persons, the program issues an invalid subscript message.
I understand that the id variables "belong" to all the records in the file, and, as such, should be able to have their frequencies taken.

Another minor issue: is that possible to execute the frequencies only to the cases listed (selected)? That is, if you type a key prefix to select some cases, I would like to apply the frequencies only to those cases. Now, as it is, in order to do that, I have to type the universe selecting all the variables in the ID, which might mean a lot of them, for instance: department, county, province, area, block, census tract, etc
Best
Ari
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Tabulate frequencies of ID values with a Universe of cases

Post by Gregory Martin »

Are both of your queries ultimately related to the Tabulate Frequencies tool? Are you saying that a universe of "AGE = 0" gives you subscript errors? If so, are you tabulating frequencies of items that are not part of the record to which AGE belongs? If that is the case, you might want to look into the frequency syntax from logic:

https://www.csprousers.org/help/CSPro/f ... named.html

Using that, you can fine-tune your frequency generation so that you have universes that apply to some frequencies and not to others.

Regarding a key prefix universe, you could use as part of your universe something like:
startswith("010203", key(MY_DICT));
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Re: Tabulate frequencies of ID values with a Universe of cases

Post by AriSilva »

Thanks Greg, for your very prompt answer (as always).
I´m talking about having frequencies taken from the Dataviewer tool.
I need to have frequencies from the variables in the IDS0 (identifiaction part), such as the one in the dataviewer.png attached file.
That is, the universer ha a variable from the D_MORADOR record, and I need frequencies from the IDSO part. As I understand, this should be possible since the IDSO "belongs" to all records.
Furthermore, even using a universe with variables from a multiple record (B04_IDADE), I should be able to have frequencies from all the variables from a single record, like C_MORADOR, for instance.

Thank you also for the tip about using the frequency command in logic, I´ll try that, although I would prefer solving this need with Dataviewer, much easier with its point and click facilities (no programming needed).

As for the key prefix, I did not know that the universe expression could be that powerful, using commands like starswith. Thnak you very much for that.
All the best
Attachments
dataviewer.png
dataviewer.png (28.11 KiB) Viewed 2264 times
Best
Ari
Post Reply