Detect and Fix String-Encoded Numerics in Stata
Stata imports may store numeric-looking variables as strings, breaking analysis commands. Learn to detect the type with describe and convert safely using destring.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Stata imports may store numeric-looking variables as strings, breaking analysis commands. Learn to detect the type with describe and convert safely using destring.
Learn how to pull spreadsheet data directly into Stata with `import excel`, the trade‑offs involved, and a step‑by‑step example that shows how to verify the import’s integrity.
Learn when to use Stata's 1:1 and m:1 merge commands, how the _merge variable works, and how to avoid type mismatches and data duplication when combining datasets.
Use Stata frames as named in-memory workspaces to isolate raw, cleaned and analysis data. Move results explicitly with frame put and frame get instead of relying on nested preserve/restore or disk tempfiles.
Step‑by‑step guide to identify memory and variable‑limit causes, apply fixes, and verify the solution in Stata.
Compute age‑varying marginal effects after a logistic regression in Stata, verify with manual calculation or bootstrap, and watch for speed and SE limitations.
Logit coefficients don't answer real questions. Stata's margins command turns them into adjusted predictions and average marginal effects — here's how to use it, and where it can mislead.
Fixed-effects regression in Stata sweeps out entity-specific intercepts, but the within transformation drops all time-invariant variables and requires strict exogeneity. This blog walks through the mechanics, a worked firm-level example, and the trade-offs you accept when you type xtreg, fe.
How to pick the right Stata merge type (1:1, 1:m, m:1), validate keys with isid and duplicates tag, and read the _merge variable to catch mismatches before they corrupt your data.