Hello

I am finding a problem to clean my HIV related panel data. I would like to clean HIV status which is considered as time varying variable due to possibility of some observations sero-converting over time.

The data looks like this:
id time hiv_Status
1 1 N
1 2 TP
1 3 N
1 4 N
1 5 N
2 1 P
2 2 N
2 3 N
2 4 P
2 5 P
2 6 P
2 7 P
where N=negative= 0
P=Known positive=1
TP=Tested positive=2
U=Unknown=3

Those that are positive at an earlier time need to remain positive. this may have been a data capturing error.

Is there a single command i can use to replace the negatives with "positive" for all observations if they have a positive in an earlier time.

and which loop can be used for similar variables.

Thanks.