Creating new variable?

#1
I think what I need to do is create/compute a new variable, but I'm not sure.

I'm looking at incidence of cavities in teeth. The way I collected the data is by individual tooth were 0 = no cavities, 1 = one cavity, 2 = one or more cavity in the tooth. But now I want to look at the incidence of cavities in the upper vs the lower jaw. Combine the data from all of the upper teeth to get a simple frequency/percent of cavities in the upper jaw.

It seems like it should be easy, but I'm having problems figuring it out.

Any suggestions would be great! Thanks.
 

Karabiner

TS Contributor
#2
What is the data structure like? Is it

Subject1 - Cavities in tooth 1 - Cavities in tooth 2 - ...
Subject2 - Cavities in tooth 1 - Cavities in tooth 2 - ...
...


or is it

Subject1 - Tooth1 - Cavities
Subject1 - Tooth2 - Cavities
...
Subject2 - Tooth1 - Cavities
Subject2 - Tooth2 - Cavities
...

Kind regards

K.