I have a multiple cross-sectional dataset, where I am trying to create the following index:
Dit = (Sum all dit until k)/Kt
In other words, sum the values for all d variables and then divide by the number d variables for that year.
In my dataset, i have 4 variables that i need to look at but for some years only three or two are present so to calculate my index I don't want to just include individuals that had all four. I don't want them to be treated as missing. Instead, i want the aggregated variables to be divided by say 3 instead of 4 if only 3 variables are present. How do i go about creating this Kt?
My four variables are: racmar, racpeers, racpres and racseg. They are byte variables (not string) and are non binary.
Related Posts with How to count the number of relevant variables present for an individual
Predict using multilevel versus logitHello! I'd like to know why when I use multilevel models the estimates in of sample are differents …
sum of dummy coefficients?Dear All, Suppose that I run the regression Code: webuse grunfeld, clear reg invest mvalue kstock …
Multiple Response and Chi-SquaresHello, I am following up on my previous post on multiple response variables (available here: ) with…
variable labels sex age response freq 0 0 0 26 0 0 1 12 0 0 2 7 0 1 0 9 0 1 1 21 0 1 2 15…
teffects and covariates for matching.Hi. I am trying to use the teffects to implement matching using Nearest Neighbor Matching. The stata…
Subscribe to:
Post Comments (Atom)
0 Response to How to count the number of relevant variables present for an individual
Post a Comment