Data management: How to convert categorical string variables to labeled numeric variables

preview_player
Показать описание
This video demonstrates how to convert categorical string variables to labeled numeric variables in Stata using the *encode* command.

Copyright 2011-2019 StataCorp LLC. All rights reserved.
Рекомендации по теме
Комментарии
Автор

how do you ensure what categorical variable gets assigned a particular numeric value?

Adibayou
Автор

Big thank you!!! You and your video saved my life!!! Very helpful!!

justinali
Автор

Hey Chuck, this is a very useful tool. I've lost many hours encoding string variables. Thanks a lot!

betuelivey
Автор

save time, use encode + your variable name, generate (new name)

YahyaMarei
Автор

Thank you for your videos. I am learning a lot from them

wasafisafi
Автор

This is so helpful! I wanted to know though how stata assigns a particular value as the base value? Like in this base it assigned “Black” as our base value and we got the coefficients for other and white wrt Black, is there a way to change which value gets selected as the base value? This works exactly like creating multiple dummies except that you don’t need to create multiple variables but just indicate that it’s a categorical variable using the prefix “i.” And stata automatically calculates everything in the same way as if it was creating dummies but only in the background ??

manasichhabra
Автор

It's odd. On Stata, I hate using the drop down menus and prefer to find the commands and write them out only. In SPSS though, it's the opposite. Love the drop down menus in SPSS

awfan
Автор

I use this way to encode gender to numerik, but when I run the regress, it did not work. . it says variable sbp not found, help please

regress sbp i.Gender1
variable sbp not found

mrlz
Автор

Can't, we just replace the original string variable, rather than generating new variable ?

amolbuch
Автор

i wonder what the n stands for in the variable name

Youresmalltimebro
Автор

Why we are putting this i.race instead of just race which is the variable name

MrUsmanmarwat