Articles by aghaynes

Mixed model R2 (UPDATED)

March 28, 2013 | aghaynes

R2 is a useful tool for determining how strong the relationship between two variables is. Unfortunately, the definition of R2 for mixed effects models is difficult – do you include the random variable or just the fixed effects? Including just the fixed effects is essentially a standard linear model, while including ... [Read more...]


August 28, 2012 | aghaynes

A post over on Dang, another error (show me yours and I’ll show you mine) has a method of working with R which uses an IDE called Eclipse in conjunction with a plugin called StatET. Eclipse is one of a number of IDEs that I’m aware of (Tinn-R ... [Read more...]

Importing data directly from MS Excel

August 10, 2012 | aghaynes

R is great for exploring, analysing and graphing your valuable data. No question about it. Unfortunately though, there’s no base package support for importing data directly from MS Excel. This means that you have to faff about saving it in another format, and THEN import this new file. This ... [Read more...]

The inner workings of R objects

June 29, 2012 | aghaynes

R is an object oriented language. You provide a name and R supplies that name with various properties. In the simplest case, you can assign a number to a name. This will only have a few attributes, such as its class, length etc: i [Read more...]

Grouped means (again)

June 26, 2012 | aghaynes

So, the post I did yesterday on aggregate seemed to go down well. One of the comments suggested I add an example. Other comments had other useful hints which I thought I’d pass on more formally. So here goes… The mtcars dataset in base has data on various aspects ... [Read more...]

Grouped means (or anything else…)

June 25, 2012 | aghaynes

An easy one today, but something that stumped me for a while* the first time I tried it out. How do you get a group mean (or other summary statistic) from R? Lets say you have a Y variable that represents repetitions for each of however many factors. You could ... [Read more...]

Normalising data within groups

June 21, 2012 | aghaynes

Occasionally it proves useful to normalise data. By this I mean to scale it between zero and one. Admittedly, most people frown of this but there are papers out there with this method in use*. How do we go about this? Its a very simple formula to calculate: y'[i] = ... [Read more...]


June 12, 2012 | aghaynes a fun little page!About 90 two minute tutorials (twotorials, haha) on various things in R!From "what does object oriented programming [...] mean" to calculating the number of days youve been alive.The guy has an amusing voice too!!Great for newbies to R I should ... [Read more...]

Labelling panels in R graphics

March 8, 2012 | aghaynes

Labelling a graphics panel in R is easy right? Sure it is, just use text and define the coordinates. text(x=5, y=10, "a") But is there an easy way to get in the same place all the time, even if you have different axis lengths (e.g. 0 to 5 on the ... [Read more...]
1 2

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)