2022년 11월 17일 목요일

Excel and Statistics(3), Naming nominal variables

  

Excel and Statistics, everybody should know.  : Contents

Naming nominal variables

If you code 0 and 1 in the sex variable name, as in the case on the left, you need to remember or write down whether you set the man to 1 or 0. Moreover, depending on the nature of the statistical program, there is room for completely different interpretations.

So the way I recommend is to make the variable name male, and if you code 0 and 1, you can naturally understand that if you are a man, it will be 1, and if not, it will be 0.

In other cases, saying 0 and 1 for result would require another explanation as to whether result is a cure or a death, but if we say cure or death, it becomes clear what 1 and 0 mean.

It may also be a good idea to set the variable life to sex, M or F. However, in some programs, logistic regression requires that the dependent variable be coded only as 0 and 1, so in that case use Ctrl H. We’ll learn about ‘Ctrl H’ later.


 


=================================================

  • R data visualization book 2
https://tinyurl.com/R-plot-II-2  simple variables
https://tinyurl.com/R-plot-II-3-4   many variables / map
https://tinyurl.com/R-plot-II-5-6   time related / statistics related
https://tinyurl.com/R-plot-II-7-8   others / reactive chart 
 


 
 

댓글 없음:

댓글 쓰기