Menu

t-Test with Groups?

Help
kklein
2012-08-14
2013-01-15
  • kklein

    kklein - 2012-08-14

    Hi all. I was hoping to standardize on RKWard for an intro stats class I'm teaching next semester, but I can't seem to find something I need, and I suspect I just don't know where to look.

    I need to do t-tests by groups, e.g.,:

    t.test(formula = Weight ~ Sex)
    

    -Where "Weight" is a number variable and "Sex" is a two-level factor.

    This works fine in the R console at the bottom of the RKWard window, so I know that the appropriate packages are installed (I'm running this in a MacOS "Lion" VM to simulate what most of my students will have-installed with the very handy DMG), but I can't find anything in the GUI to set a "by" variable.

     
  • Thomas Friedrichsmeier

    Hi!

    The functionality you are looking for is simply not implemented, in the "official" RKWard distribution.

    However, the RKWard GUI can be extended by plugins. And, in fact, Meik Michalke has written a plugin that allows to do t-tests on "long" format data. Use Settings->Manage R Packages, and install package "rk.ANOVA". You will find a new GUI entry "Pairwise t-Tests". The main point of the plugin is to allow comparing pairwise differences between 3 or more groups, but it will also work for 2. Perhaps that is good enough for you, or perhaps you would like to look into extending our standard t-test dialog yourself: http://rkward.sourceforge.net/documents/devel/plugins/index.html.

    Regards
    Thomas

     
  • kklein

    kklein - 2012-08-15

    I'll take a look! Actually, I was wondering where I could find ANOVA as well.

    I have been hoping that some enterprising developers would write a good GUI for R for a very long time. I find that I usually prefer to just type the commands in, if I know exactly what I want to do, but for students, that can be a little daunting. No matter what, though, I wanted them to learn on something they could (legally) just have on their machines and continue to use in their own research, unlike SPSS, which is what I learned on. So far, I think RKWard is going to make that possible.

    …As long as I can get it to install on Mountain Lion, for the students who have upgraded, or people like me who have new Apple laptops… That's the next experiment.

     
  • kklein

    kklein - 2012-08-15

    Nope, it's missing something:

    Error in ezANOVA_main(data = data, dv = dv, wid = wid, within = within,  : 
      argument "wid" is missing, with no default
    Calls: local ... eval -> eval -> eval -> eval -> ezANOVA -> ezANOVA_main
    

    But it's not the end of the world. We're not doing ANOVAs at all, so I'll just have them type the code for the t-tests.

    Thanks for the help.

     
  • m.eik

    m.eik - 2012-08-15

    hi,

    regarding the ANOVA error: i assume you tried a pure between subject design? it seems ezANOVA of the ez package still insists on a subject identifier even for those designs. i've added a workaround for this in rk.ANOVA 0.01-12, could you give that a try?

    as for the mac version of RKWard: we're still working on this and are happy for feedback! most of us are not actually mac users, and it could probably progress much faster if we had more eyes looking at it. a lot of people seem to experience problems with missing MIME types (an error pops up, in bad cases you can't really open *.R files with RKWard). the reason is found and a workaround in place (see https://sourceforge.net/mailarchive/message.php?msg_id=29650937 for details), but before you give this to your students, we should probably fix this one for good ;-)

    viele grüße :: m.eik

     
  • kklein

    kklein - 2012-08-16

    Thanks for the extra info.

    I don't see rk.ANOVA 0.01-12 on CRAN (Tokyo mirror). Do I need to look at a specific mirror, or get off stable releases?

    I also found a new submenu under "Data" for setting up within-subject data. Is that what was missing? I didn't look in there at all.

    I have gotten the MIME error, but it hasn't seemed to cause any problems, at least for what I need the students to do for this class. I'll give that new directory a shot.

     
  • kklein

    kklein - 2012-08-16

    Sorry. Version 0.01-12 showed up after restarting.

    When I try to run a between groups ANOVA, it now asks for the ez package. I install it, and it asks for it again. Evidently there are a bunch of installation errors.

     
  • kklein

    kklein - 2012-08-16

    Ah, but it works on my main installation (also a Mac with 10.7.x, but installed the "long" way through MacPorts). It does not, however, run a t-test, so it doesn't really help me with my class, although it's nice to be able to do ANOVAs in RKWard now.

    I have added the linked mime directory to the "fast" installation on the VM, and have not seen the MIME errors again. The only caveat to the installation of those files, though, is very weird: The unarchiving utility bundled in MacOS does not like that .zip file. It decompresses it to another compressed file of type .cpgz. Then, when you decompress that, it just makes another copy of the .zip! Ad infinitum.

    If you use the popular The UnArchiver freeware utility to decompress (most power users use this-as far as I know, it just makes calls to the BSD archive tools, rather than rolling its own), it works fine.

    Decompressing with The UnArchiver to a folder, and then re-compressing it with the MacOS, however, results in the same weird .cpgz behavior! There are some baffled threads about this around the 'net. Even making a new folder called "mime" in MacOS and just moving the contents in, and then compressing, results in the same. Crazy.

    It is looking like the safest way to go on the Mac is still the MacPorts installation, unsurprisingly, although I will still probably recommend the .dmg route to the students, as what we need it to do, it largely does, and if it doesn't, they can just type out the code in the console.

    BTW, I'd be happy to test out Mac versions of RKWard. I have access to machines running 10.6 through 10.8. I'm afraid I'm pretty hopeless with actually diagnosing code, though.