Create new variable x by selecting the value of a cell in a row conditional on the variable name containing the value of a variable z

I have a dataset of individuals. Each individual is observed across different years and countries. I have two independent variables x2002 and x2010 (see Dataex example: Before). These contain the values of a variable X for each year for a specific country. For example, all individuals observed in 2002 in France have a value of… Read More Create new variable x by selecting the value of a cell in a row conditional on the variable name containing the value of a variable z

Add days to datetime

I would like to add 24 hours or 1 day to my timedate variable in Stata. read_date Desired_date 2009-01-01 14:00:00 2009-01-02 14:00:00 I formatted my read_date with format read_date %tcCCYY-NN-DD_HH:MM:SS which worked without errors. I have been trying to add days by adding 86400 seconds as: replace Desired_date = Desired_date+86400 It executes without errors but… Read More Add days to datetime