[MINC-users] calculating r-squared values

Jason Lerch jason at phenogenomics.ca
Wed Jun 6 13:35:10 EDT 2012


This should work, though is going to be slow:

fff <- function(x) { return(summary(lm(x ~ genotype, gf))$r.squared) }

mincApply(filenames, quote(fff(x)))

Note: replace the formula in that function with the appropriate formula for your purposes, and filenames should be a vector of your filenames. Could be worth specifying a mask, as this will run for a few hours.

And I haven't actually tested it, so it might not run at all!

Jason

On 2012-06-05, at 4:18 PM, Jared Rowley wrote:

> Hi Minc Users,
> 
> I was wondering if anyone knows a way calculate R-squared values on a voxel
> level from a linear regression.
> 
> I assume there is a way with either glim_image or RMINC however reading
> though the documentation I could not find a solution.
> 
> Thanks very much,
> 
> Jared
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users



More information about the MINC-users mailing list