Hi, I haven't had much experience using Stata and was wondering whether one could generate a dummy variable which is attributed to all observations of an ID provided one specific observation out of the ID's observations' meets a certain criteria.

Here is an example of data:
name_id year value_share dummy variable I want
city1 1 0.127 1
city1 2 0 1
city2 1 0.0530 0
city2 2 0.275 0
city3 1 0 0
city3 2 0.235 0
city4 1 0.874 1
city4 2 0.573 1
I'd like to create a dummy variable taking the value 1 for both the observations/years of each city, provided the value_share in the year 1 is >=0.1 (value_share in year 2 is irrelevant for the criteria of condition being met).

This seems rather rudimentary but I can't seem to think of any way of doing this using only one command (one line) ideally. Also, I don't wish to drop any IDs from the data (like dropping those who don't meet criteria) nor creating a subset nor combining years 1 and 2 into a single row per city.

Out of interest, how would the command differ if one needed to generate a dummy variable attributed to all observations of an ID provided at least one observation (non-specific) out of the ID's observations' meets a certain a certain criteria?