+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 36

Thread: Statistics with R - absolute beginner

  1. #1
    Points: 9,891, Level: 66
    Level completed: 61%, Points required for next Level: 159

    Posts
    187
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Statistics with R - absolute beginner




    Could any recommend where to start with learning R. Which websites/books/videos explain R in the simplest possible manner?

  2. #2
    Super Moderator
    Points: 31,766, Level: 100
    Level completed: 0%, Points required for next Level: 0
    bugman's Avatar
    Posts
    2,255
    Thanks
    290
    Thanked 324 Times in 265 Posts

    Re: Statistics with R - absolute beginner

    Certainly.

    I would first recommend having a look at the home page an becoming familiar with it:

    http://www.r-project.org/

    You'll find links, pdfs on how to get started and links also to the R-Journal.

    Also however is this thread on the TS forum. This is loaded with info for beginners and more advanced users:

    http://www.talkstats.com/showthread....-Books-etc.%29
    The earth is round: P<0.05

  3. #3
    Devorador de queso
    Points: 95,705, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,931
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: Statistics with R - absolute beginner

    Do you have previous programming experience? What other stats packages have you used before?

  4. #4
    ggplot2orBust
    Points: 71,220, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    User with most referrers
    trinker's Avatar
    Location
    Buffalo, NY
    Posts
    4,417
    Thanks
    1,811
    Thanked 928 Times in 809 Posts

    Re: Statistics with R - absolute beginner

    I recommend you get a copy of The R Book and also Peter Daalagard's book of Introductory Stats with R as well as the R cookbook by Paul Teetor. In conjunction with the numerous manuals from Cran including Kickstarting R and an Introduction to R. Also the website Quick R was very helpful to me. Plus simple typing in help(object) and example(object) into the command line ie. example(hist) help(hist). Theres a ton to learn about this powerrful program. Just keep in mind the learning process is recursive. Read and reread until you understand. I've reread Daalgard and the R Book 2 and 3 times respectively and keep using them as a quick reference. Welcome to R.

  5. #5
    Devorador de queso
    Points: 95,705, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,931
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: Statistics with R - absolute beginner

    I've never actually read a single book that was focused on learning R. I think I've turned out alright. But I did have programming knowledge coming into the experience and there are a lot of useful guides online. The best way to learn is to just jump into it. You might not be the most efficient R programmer but over time you'll learn how to do things better. Heck I'm still learning and a lot of times when Mike White makes a post in the R/Splus section I'm either reminded of something I had forgotten about or learn something new completely.

  6. #6
    ggplot2orBust
    Points: 71,220, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    User with most referrers
    trinker's Avatar
    Location
    Buffalo, NY
    Posts
    4,417
    Thanks
    1,811
    Thanked 928 Times in 809 Posts

    Re: Statistics with R - absolute beginner

    Good Point Dason. It all depends on your programming back ground. Mine was nil so those things were very helpful.

    Once you begin getting a hang of it you'll wonder what you did before you had R.

  7. #7
    Points: 9,891, Level: 66
    Level completed: 61%, Points required for next Level: 159

    Posts
    187
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Re: Statistics with R - absolute beginner

    Many thanks for replies. I've got as far as reading an Excel sheet into R.

    I now need to perform a 2 way ANOVA (with replication) on the data in the attached screenshot. How do I do this?
    Attached Images  

  8. #8
    Devorador de queso
    Points: 95,705, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,931
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: Statistics with R - absolute beginner

    Typically you would use the lm function. It looks like you'll need to transform your data into 'long' format though. Also would you mind explaining your dataset a little more? The way the spreadsheet is setup implies that there might be some correlation you're not telling us about.

  9. #9
    Points: 9,891, Level: 66
    Level completed: 61%, Points required for next Level: 159

    Posts
    187
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Re: Statistics with R - absolute beginner

    To read the data from the Excel sheet and into R, I followed the clear, step-by-step process as given in this video: http://www.youtube.com/watch?v=Hq0Jm...=FLGrc1Q2TKYkw

    I now need an equivalent clear, step-by-step process for performing a two factor ANOVA with replication in R. Where can I find this?

  10. #10
    R purist
    Points: 35,103, Level: 100
    Level completed: 0%, Points required for next Level: 0
    TheEcologist's Avatar
    Location
    United States
    Posts
    1,921
    Thanks
    303
    Thanked 607 Times in 341 Posts

    Re: Statistics with R - absolute beginner

    Quote Originally Posted by Layo909 View Post
    To read the data from the Excel sheet and into R, I followed the clear, step-by-step process as given in this video: http://www.youtube.com/watch?v=Hq0Jm...=FLGrc1Q2TKYkw

    I now need an equivalent clear, step-by-step process for performing a two factor ANOVA with replication in R. Where can I find this?
    clear, step-by-step process? The video show a pretty complicated way to that!

    Open excel, copy the section you want to load into R, then type data=read.table('clipboard').. (you type the last part, yes, dont copy as the data should be in the clipboard and nothing else).

    As for an anova, there are hundreds of wegpages showing how to do that. E.g. http://www.personality-project.org/r/r.anova.html
    The true ideals of great philosophies always seem to get lost somewhere along the road..

  11. #11
    Points: 9,891, Level: 66
    Level completed: 61%, Points required for next Level: 159

    Posts
    187
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Re: Statistics with R - absolute beginner

    Quote Originally Posted by TheEcologist View Post
    clear, step-by-step process? The video show a pretty complicated way to that!

    Open excel, copy the section you want to load into R, then type data=read.table('clipboard').. (you type the last part, yes, dont copy as the data should be in the clipboard and nothing else).

    As for an anova, there are hundreds of wegpages showing how to do that. E.g. http://www.personality-project.org/r/r.anova.html
    I get following message when trying to copy from Excel using your method:

    Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, line 2 did not have 6 elements

    Any suggestions?

  12. #12
    R purist
    Points: 35,103, Level: 100
    Level completed: 0%, Points required for next Level: 0
    TheEcologist's Avatar
    Location
    United States
    Posts
    1,921
    Thanks
    303
    Thanked 607 Times in 341 Posts

    Re: Statistics with R - absolute beginner

    You need to format your data correctly, remove all spaces in variable names e.g. name 1 should be changed to name_1. If you have blank entries replace them with NA, this means 'not available' and is good practice to use instead of black spaces.

    In excel 2007:
    1) On the home tab & select the “find and select” menu

    2) Select “go to specials” and select “blanks”

    3) Type NA or any other character that you want to replace the blanks with

    9 out of 10 times this solves the problems for users who are used to the 'lazy data' entry formats of Excel and SPSS and want to read data into something like R.
    The true ideals of great philosophies always seem to get lost somewhere along the road..

  13. #13
    Points: 9,891, Level: 66
    Level completed: 61%, Points required for next Level: 159

    Posts
    187
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Re: Statistics with R - absolute beginner

    Quote Originally Posted by TheEcologist View Post
    You need to format your data correctly, remove all spaces in variable names e.g. name 1 should be changed to name_1. If you have blank entries replace them with NA, this means 'not available' and is good practice to use instead of black spaces.

    In excel 2007:
    1) On the home tab & select the “find and select” menu

    2) Select “go to specials” and select “blanks”

    3) Type NA or any other character that you want to replace the blanks with

    9 out of 10 times this solves the problems for users who are used to the 'lazy data' entry formats of Excel and SPSS and want to read data into something like R.
    Great, thank you.

    Also, I'm still very unclear on how to perform an ANOVA on the data which has been read in from the Excel sheet. If I copy and paste the commands in the link you gave (http://www.personality-project.org/r/r.anova.html ), then I am able to achieve the same results as given on the webpage. However I'm still clueless as to what to do with my data once it has been read into R from Excel.

    Are there any idiots/dummies/4 years old guides out there?
    Last edited by Layo909; 05-30-2011 at 04:20 AM.

  14. #14
    R purist
    Points: 35,103, Level: 100
    Level completed: 0%, Points required for next Level: 0
    TheEcologist's Avatar
    Location
    United States
    Posts
    1,921
    Thanks
    303
    Thanked 607 Times in 341 Posts

    Re: Statistics with R - absolute beginner

    for starters, give a screenshot of your data or post the first few lines with head(yourdata), this way we know how your data looks like - or if its the same as the above attachment, tell us what the columns mean and what you want to achieve (basically what Dason also suggested; also read this). Secondly, post the commands you were just using and errors you are getting so we can tell what went wrong.
    The true ideals of great philosophies always seem to get lost somewhere along the road..

  15. #15
    Points: 9,891, Level: 66
    Level completed: 61%, Points required for next Level: 159

    Posts
    187
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Re: Statistics with R - absolute beginner


    Attached is what R currently looks like on my screen. I need to perform a two factor ANOVA (with replication) on the data in the attached screenshot. How do I do this?

    Basically, I need to know exactly what to type and which buttons to press in the R. Please explain like you're talking to a 4 year old.

    Many thanks for your great help.
    Attached Images  

+ Reply to Thread
Page 1 of 3 1 2 3 LastLast

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats