Hi everyone, I have a panel dataset from a monthly survey with many repeat respondents that are identified through a variable called UNIQUE_FIRM_REFERENCE and a MONTHLY variable that indicates which month the survey was from. My problem is that for one of the questions (the variable is FOREIGNSALES_YN), the respondent's answers are only recorded the first time the respondent answered the survey. They other observations are noted as N/A. I would like to take the answer from the first observation and apply it to the rest of the responses with the same UNIQUE_FIRM_REFERENCE
.
My dataset is below. As an example, for the unique firm reference S35495785 observations, I want the FOREIGNSALES_YN variables to all be "No". Same for the firm S91060053.
Thanks,
Mathieu
.
My dataset is below. As an example, for the unique firm reference S35495785 observations, I want the FOREIGNSALES_YN variables to all be "No". Same for the firm S91060053.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str11 UNIQUE_FIRM_REFERENCE str119 FIRM_NAME long YEAR_MONTH str3 FOREIGNSALES_YN "S77422335" "0812805 B.C. Ltd." 202301 "No" "S35495785" "1 Hour Signs" 202301 "No" "S35495785" "1 Hour Signs" 202302 "N/A" "S35495785" "1 Hour Signs" 202303 "N/A" "S35495785" "1 Hour Signs" 202304 "N/A" "S68292422" "1-800-Got-Junk? Vancouver Metro" 202211 "N/A" "S68292422" "1-800-Got-Junk? Vancouver Metro" 202212 "N/A" "S91060053" "1. Abundance Bakery 2. Jovic Bakery" 202301 "No" "S91060053" "1. Abundance Bakery 2. Jovic Bakery" 202302 "N/A" "S91060053" "1. Abundance Bakery 2. Jovic Bakery" 202303 "N/A" end
Mathieu
Comment