lraisanen.bsky.social
@lraisanen.bsky.social
The United States withdraws from WHO. In the official statement it says: "China, with a population of 1.4 billion, has 300 percent of the population of the United States, yet contributes nearly 90 percent less to the WHO. " Can you find the rather obvious error here?

#trump #poormathskills
January 21, 2025 at 2:11 PM
In STATA, this is probably one of my most used for-loops. This iterates over every row:

forvalues i=1/`=_N' {
//do some action on `i'
}

#stata #cleancode
January 21, 2025 at 11:50 AM
Using the inrange function in STATA can be safer and quicker than comparison operators: > = <

For example, intead of:

replace somevar = 1 if someothervar >= 3 & someothervar <=5

use:

replace somevar = 1 if inrange(someothervar, 3, 5)

#stata #cleancode
January 8, 2025 at 3:13 PM
While tempfile can be useful in STATA, I find savesome easier to use and maintain:

ssc install savesome
input byte(tx age)
0 18
0 19
1 21
1 24
1 17
end

savesome if tx== 1 using txonly
savesome if tx == 0 using ctrlonly

use txonly, clear
tab tx

use ctrlonly, clear
tab tx

#stata #cleancode
January 7, 2025 at 4:45 PM
ictmc.org/workshop-pro...
I gave a presentation on an algorithm for auto-coding MedDRA, PS.6B - Electronic health records and machine learning.
Workshop Programme – ICTMC 2024
ictmc.org
January 7, 2025 at 1:16 PM