Re: [R] Confidence Intervals on Standard Curve

2011-02-20 Thread nzcoops
model <- lm(Approximate.Counts~X..Light.Transmission + I(Approximate.Counts^2), data=Standards) Might not be addressing the problem, don't you have Y ~ X + Y^2 here? That's a violation of the assumptions of an lm isn't it? Also for plotting CI on a curve look into ggplot2::geom_ribbon, it's muc

Re: [R] Legend for radial.plot?

2010-12-09 Thread nzcoops
Thanks Jim, I couldn't get xpd=T to work in the way I assume it should, which is expanding the region to whatever it is asked to display? Maybe I was using it wrong but I had jpeg/png wrapped around as I was saving the output. The workaround I had was to increase the width of the jpeg/png (leg

Re: [R] ggplot2 - bar colour

2010-09-20 Thread nzcoops
Thanks Thierry, will have a go when back in the office tomorrow. I had tried ggplot as opposed to qplot but didn't get any further. I'm actually after a greyscale graph for black and white printing (red etc was just so I could see the change before tweaking further). A reasonably thorough online

[R] ggplot2 - bar colour

2010-09-20 Thread nzcoops
Hi All, I have trying to do what I thought was a reasonably simple graph but I think I'm now going in circles with the colour. Attached is a picture of where I'm up to. The line creating this is: qplot(ageincgraph$age, ageincgraph$rate, position="dodge", stat="identity", geom="bar" ) + aes( colo

Re: [R] Calculate difference between dates in years

2010-09-16 Thread nzcoops
Just expanding on Brians code to something that will work for vector. age_years <- function(first, second) { lt <- data.frame(first, second) age <- as.numeric(format(lt[,2],format="%Y")) - as.numeric(format(lt[,1],format="%Y")) first < as.Date(paste(format(lt[,1],format="%Y"),"-",

Re: [R] Adding column to dataframe

2010-08-25 Thread nzcoops
To update on this. I ran the same command on a grid of computers with 32gb ram, and it completed in 15 seconds, compared to the ~20 minutes on my desktop. Simply a ram issue as suspected by a few on the list here. Thanks -- View this message in context: http://r.789695.n4.nabble.com/Adding-col

[R] Longitudinal negative binomial regression - robust sandwich estimator standard errors

2010-07-14 Thread nzcoops
Hi All, I have a dataset, longitudinal in nature, each row is a 'visit' to a clinic, which has numerous data fields and a count variable for the number of 'events' that occurred since the previous visit. ~50k rows, ~2k unique subjects so ~25 rows/visits per subject, some have 50 some have 3 or