Re: [R] ordinal variables

From: Joris Meys <jorismeys_at_gmail.com>
Date: Fri, 04 Jun 2010 12:24:53 +0200

Hi,

If you look around a bit, there is some great material on the web about the powers and quirks of R. I've taught myself most of what I know from R through reading a lot and trying it out on the console. The help list is also a darn fine source of efficient code for a set of general problems.

It won't help any more this year, but I'm working on a guide for R to bundle valuable information I got from the help list and the internet. It should be ready in a couple of months, and it will be available for all to use. In any case, Owen's guide is of great value for an introduction to the command line and basic statistics: http://cran.r-project.org/doc/contrib/Owen-TheRGuide.pdf

Also the introduction to R is a must-read for all our students : http://cran.r-project.org/doc/manuals/R-intro.pdf

Next to that, a couple of websites are great additional sources of code : Quick-R, a guide for those who come over from SAS/SPSS/Stata. It contains tons of examples for statistical analyses in about every field. If you didn't know it yet, you'll love it for sure : http://www.statmethods.net/

The R graph gallery, to show what exactly can be done with the graphical power of R :
http://addictedtor.free.fr/graphiques/

The R Graphics gallery, doing the same : http://research.stowers-institute.org/efg/R/

There's many more to be found, a whole community of users is contributing to the information in various ways. We give the sources mentioned here to our students, with the message that they should never underestimate the power of Google.

Last but not least, there is a specific mailing list regarding teaching statistics using R:
https://stat.ethz.ch/mailman/listinfo/r-sig-teaching

You might want to take a look at their archives as well.

Cheers
Joris

On Fri, Jun 4, 2010 at 6:39 AM, Iasonas Lamprianou <lamprianou_at_yahoo.com> wrote:
> Thanks, I'll have a go and will let you know. I guess that the success has to do with how efficiently I help them to demonstrate the efficiency of code over menues. So part of the issue is how I teach them as well...
>
>
> Dr. Iasonas Lamprianou
>
>
> Assistant Professor (Educational Research and Evaluation)
> Department of Education Sciences
> European University-Cyprus
> P.O. Box 22006
> 1516 Nicosia
> Cyprus
> Tel.: +357-22-713178
> Fax: +357-22-590539
>
>
> Honorary Research Fellow
> Department of Education
> The University of Manchester
> Oxford Road, Manchester M13 9PL, UK
> Tel. 0044  161 275 3485
> iasonas.lamprianou_at_manchester.ac.uk
>
>
> --- On Thu, 3/6/10, S Ellison <S.Ellison_at_lgc.co.uk> wrote:
>
>> From: S Ellison <S.Ellison_at_lgc.co.uk>
>> Subject: Re: [R] ordinal variables
>> To: "Joris Meys" <jorismeys_at_gmail.com>, "Iasonas Lamprianou" <lamprianou_at_yahoo.com>
>> Cc: r-help_at_r-project.org
>> Date: Thursday, 3 June, 2010, 15:44
>> If you set them a problem that has
>> them doing the same sort of thing
>> five times and compare the time it takes with code pasted
>> from an editor
>> (eg Tinn-R) and the time it takes via menius, you may have
>> more luck
>> convincing them.
>>
>> A command line sequence is harder than menus the first two
>> times but
>> easier for any n iterations thereafter.
>>
>> Steve ellison
>>
>> >>> Iasonas Lamprianou <lamprianou_at_yahoo.com>
>> 03/06/2010 14:51 >>>
>> Thank you Joris,
>> I'll have a look into the commands you sent me. They look
>> convincing. I
>> hope my students will also see them in a positive way
>> (although I can
>> force them to pretend that they have a positive attitude)!
>>
>> Dr. Iasonas Lamprianou
>>
>>
>>
>>
>>
>> Assistant Professor (Educational Research and Evaluation)
>>
>> Department of Education Sciences
>>
>> European University-Cyprus
>>
>> P.O. Box 22006
>>
>> 1516 Nicosia
>>
>> Cyprus
>>
>> Tel.: +357-22-713178
>>
>> Fax: +357-22-590539
>>
>>
>>
>>
>>
>> Honorary Research Fellow
>>
>> Department of Education
>>
>> The University of Manchester
>>
>> Oxford Road, Manchester M13 9PL, UK
>>
>> Tel. 0044  161 275 3485
>>
>> iasonas.lamprianou_at_manchester.ac.uk
>>
>>
>> --- On Thu, 3/6/10, Joris Meys <jorismeys_at_gmail.com>
>> wrote:
>>
>> From: Joris Meys <jorismeys_at_gmail.com>
>> Subject: Re: [R] ordinal variables
>> To: "Iasonas Lamprianou" <lamprianou_at_yahoo.com>
>> Cc: r-help_at_r-project.org
>>
>> Date: Thursday, 3 June, 2010, 14:35
>>
>> see ?factor and ?as.factor. On ordered factors you can
>> technically do a
>> spearman without problem, apart from the fact that a
>> spearman test by
>> definition cannot give exact p-values with ties present.
>>
>> x <- sample(c("a","b","c","d","e"),100,replace=T)
>>
>> y <- sample(c("a","b","c","d","e"),100,replace=T)
>>
>> x.ordered <-
>> factor(x,levels=c("e","b","a","d","c"),ordered=T)
>>
>> x.ordered
>> y.ordered <-
>> factor(y,levels=c("e","b","a","d","c"),ordered=T)
>> y.ordered
>>
>> cor.test(x.ordered,y.ordered,method="spearman")
>>
>> require(pspearman)
>>
>> spearman.test(x.ordered,y.ordered)
>>
>> R commander has some menu options to deal with factors. R
>> commander
>> also provides a scripting window. Please do your students a
>> favor, and
>> show them how to use those commands.
>>
>>
>> Cheers
>> Joris
>>
>>
>> On Thu, Jun 3, 2010 at 2:25 PM, Iasonas Lamprianou
>> <lamprianou_at_yahoo.com>
>> wrote:
>>
>> Dear colleagues,
>>
>>
>>
>> I teach statistics using SPSS. I want to use R instead. I
>> hit on one
>> problem and I need some quick advice. When I want to work
>> with ordinal
>> variables, in SPSS I can compute the median or create a
>> barchart or
>> compute a spearman correlation with no problems. In R, if I
>> "read" the
>> ordinal variable as numeric, then I cannot do a barplot
>> because I miss
>> the category names. If I read the variables as characters,
>> then I cannot
>> run a spearman. How can I read a variable as numeric, still
>> have the
>> chance to assign value labels, and be able to get table of
>> frequencies
>> etc? I want to be able to do all these things in R
>> commander. My
>> students will probable be scared away if I try anything
>> else other than
>> R commander (just writing commands will not make them
>> happy).
>>
>>
>>
>>
>> I hope I am not asking for too much. Hopefully there is a
>> way
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ______________________________________________
>>
>> R-help_at_r-project.org
>> mailing list
>>
>> 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.
>>
>>
>>
>>
>> --
>> Joris Meys
>> Statistical Consultant
>>
>> Ghent University
>> Faculty of Bioscience Engineering
>> Department of Applied mathematics, biometrics and process
>> control
>>
>>
>> Coupure Links 653
>> B-9000 Gent
>>
>> tel : +32 9 264 59 87
>> Joris.Meys_at_Ugent.be
>>
>> -------------------------------
>> Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php
>>
>>
>>
>>
>>
>>
>>     [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help_at_r-project.org
>> mailing list
>> 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.
>>
>> *******************************************************************
>> This email and any attachments are confidential. Any use,
>> copying or
>> disclosure other than by the intended recipient is
>> unauthorised. If
>> you have received this message in error, please notify the
>> sender
>> immediately via +44(0)20 8943 7000 or notify postmaster_at_lgc.co.uk
>>
>> and delete this message and any copies from your computer
>> and network.
>> LGC Limited. Registered in England 2991879.
>> Registered office: Queens Road, Teddington, Middlesex, TW11
>> 0LY, UK
>>
>
>
>
>

-- 
Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control

tel : +32 9 264 59 87
Joris.Meys_at_Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

______________________________________________
R-help_at_r-project.org mailing list
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.
Received on Fri 04 Jun 2010 - 10:28:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Jun 2010 - 11:50:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive