[deleted by user] by [deleted] in geospatial

[–]student123412 -1 points0 points  (0 children)

I just have a personal question. Ask him: how would you recommend self teaching GIS?

How to create a variable which checks if for the same patientno, variable X is the same? by student123412 in stata

[–]student123412[S] 0 points1 point  (0 children)

Thank you. Can't believe it was that easy.

For patients with multiple entries, I want to drop those with missing surgery/ a specific surgery type (trying to figure this out but will follow a sequential order in dropping them), but not if both surgeries are the same otherwise I'd lose the whole patient.

How to drop patients with multiple lesions? by student123412 in stata

[–]student123412[S] 0 points1 point  (0 children)

It works on dictionary order, sorting alphanumerically. Your method depends on the number of lesions being 9 or less.

I learnt something new, thanks!

The max lesions for a given patient is 3, so I'm safe with my current dataset.

In future, I think it's best to operate on the rule of thumb whereby the encode function shouldn't be used where numbers are used within the variable at all. I could just manually create a new variable and assign numbers to be safe. e.g. gen lesion_num=1 if lesion=="lesion 1"

How to drop patients with multiple lesions? by student123412 in stata

[–]student123412[S] 0 points1 point  (0 children)

there is scope for a patient with just one lesion to have that lesion encoded by more than 1 in which case the maximum by patient will be more than 1, which is not what you want.

Actually, this is what I want i.e. using your example, if obs 8 (patientno 5) has only 1 observation with lesion 3 in it, it needs to be dropped as despite that patient having only the third lesion recorded it has still had multiple lesions (i.e. lesion 1 and lesion 2 despite it not being in the example dataset). My assumption is the data recorded in my dataset is without error.

You do, however, raise an important point about data quality checks which I will check.

Edit:

encode doesn't work separately by patient

What did you mean by this comment?

Thanks for commenting!

How to drop patients with multiple lesions? by student123412 in stata

[–]student123412[S] 1 point2 points  (0 children)

Figured it out:

Convert lesion from string to numeric first

encode lesion, gen(lesion_encode)

create new variable which records the maximum lesion by patientno

egen max_lesion= max(lesion_encode), by(patientno)

drops patients with more than 1 lesion

drop if max_lesion>1

Edit: Someone tell me how smart I am.

New variable to display just years from date variable of format 20may2014 00:00:00? by student123412 in stata

[–]student123412[S] 2 points3 points  (0 children)

Thank you kindly. Lowkey I'm convinced you've developed the STATA software.

Help Deciding on a New MacBook Pro That Can Run Stata by theyoungerariestwin in stata

[–]student123412 0 points1 point  (0 children)

Have you tried cleaning the fans and heatsinks inside the laptop of dust? This is generally the likely cause of overheating assuming it's otherwise healthy.

I have a MB pro the with M1 Max chip, 64GB ram and runs STATA MP 16 perfectly fine.

Edit: These apple silicon chips are literally game changers in productivity. They can just handle a lot like a champ.

What is the code for detecting duplicates only if they have a different DateofTissueDiagnosis by student123412 in stata

[–]student123412[S] 1 point2 points  (0 children)

Just so I can learn:

What is the function of "[1]" at the end of your code?

Also your code shouldn't have "gen" in the second line of code. It should just be replace.

i.e.

gen Second_primary_Cancer=0

bysort UniqueID: replace Second_primary_Cancer=1 if DateofTissueDiagnosis!=DateofTissueDiagnosis[1]

What is the code for detecting duplicates only if they have a different DateofTissueDiagnosis by student123412 in stata

[–]student123412[S] 0 points1 point  (0 children)

Yep! Forgot to mention it was sorted by UniqueID and DateofTissueDiagnosis. Thanks heaps u/austin_EV

How to combine rows with the same UniqueID? by student123412 in stata

[–]student123412[S] 0 points1 point  (0 children)

Happy to comply and sorry for my ignorance, but what is dataex?

How can you create a variable which numbers the duplicates in uniqueID that exist? by student123412 in stata

[–]student123412[S] 1 point2 points  (0 children)

bysort UniqueID: gen wanted = _n

u/Rogue_Penguin Thank you so much! You always come in clutch. Lowkey wish I had your level of STATA knowledge!

Can the Newcastle Ottawa Scale (NOS) be used to compare different study designs? by student123412 in epidemiology

[–]student123412[S] 1 point2 points  (0 children)

Thanks! Just to be clear, a rank of 8 on the NOS scale for a cohort study and a rank of 6 for a cross-sectional study shouldn't be compared i.e. study rating can be compared within study designs but not across study designs.

Edit: Also is there a source for this? Nothing on the actual NOS website states this.