Project

General

Profile

Support #1486

Constructing a reference group using weights

Added by Leilah Plant-Tchenguiz over 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Weights
Start date:
01/20/2021
% Done:

100%


Description

Hi, I am trying to construct an income reference group for each individual in each wave but am having issues incorporating the population weights into the Stata code. I would like each individual's reference income to be the mean income for people of the same sex, region and education level.

The code I have written is:
svyset, clear
svyset psu [pweight=g_indscus_lw], strata(strata)
svy: bysort gor_dv sex hiqual_dv: egen refgrs1 = mean(fimngrs_dv) if fimngrs_tc==0

However, Stata cannot run the last line because of the 'svy'. How I can resolve this issue?

Also available in: Atom PDF