[R] question about categorical variables in R

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Fri Sep 11 17:00:44 CEST 2015


You need to read the Introduction to R, paying particular attention to the factors data type, which is designed for this problem.

You should also be aware that on this list failure to include a small example of your problem in R, using plain text email (a setting in your email program), often leads to getting no response at all. Conversely, if you do provide an example, the response will often include modifications to your example code that you can study.[1] Also, you really ought to read the Posting Guide given at the bottom of every R-help posting.

http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

On September 11, 2015 7:45:42 AM PDT, Lida Zeighami <lid.zigh at gmail.com> wrote:
>Hi dear experts,
>I have a general question in R, about the categorical variable such as
>Gender(Male or Female)
>If I have this column in my data and wanted to do regression model or
>feed
>the data to  seqmeta packages (singlesnp, skat meta) , would you please
>let
>me know should I code them first ( male=0 and female=1) or R
>programming do
>it for me?
>Because when I didn't code them, R still can do the analysis without
>any
>error but I'm not sure it's correct or not?
>Thanks
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list