Hi.
I'd like to ask for help due to difficulties during the stata work.

I have weekly data.
I'd like to extract the row data for the last week of each month(by ID).
For example, I want to make DataSet2 with DataSet1.

- DataSet1
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str8 id float(check week)
"A0007146" 2 18232
"A0007146" 4 18233
"A0007146" 1 18234
"A0007146" 5 18235
"A0007146" 1 18236
"A0007146" 2 18263
"A0007146" 1 18264
"A0027040" 7 18265
"A0027040" 5 18266
"A0027040" 1 18294
"A0027040" 1 18295
end
format %td week
- DataSet2
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str8 id float(check week)
"A0007146" 1 18236
"A0027040" 5 18266
"A0027040" 1 18295
end
format %td week
Please give me some advice.
Thank you.