Question: * * 1. Identify players who switched teams * * gen team _ switch = 0 replace team _ switch = 1

** 1. Identify players who switched teams **
gen team_switch = 0
replace team_switch = 1 if strpos(team, ",") > 0
** 2. Define the team at start of season for players who switched **
gen team_start = team
replace team_start = 
 subinstr(team, 1, strpos(team, ",")-1) if team_switch == 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!