# Posts Tagged ‘ R code ’

## Quantile LOESS – Combining a moving quantile window with LOESS (R function)

April 1, 2010
By

In this post I will provide R code that implement’s the combination of repeated running quantile with the LOESS smoother to create a type of “quantile LOESS” (e.g: “Local Quantile Regression”). This method is useful when the need arise to fit robust and resistant (Need to be verified) a smoothed line for a quantile (an example for such a...

## R Tips in Stat 511

March 22, 2010
By
$\reverse C(X'X)^{-1}X'$

Here are some (trivial) R tips in the course Stat 511. I’ll update this post till the semester is over. Formatting R Code Reading code is pain, but the well-formatted code might alleviate the pain a little bit. The function tidy.source() in the animation package can help us format our R code automatically. By default

## Nutritional supplements efficacy score – Graphing plots of current studies results (using R)

February 25, 2010
By

In this post I showcase a nice bar-plot and a balloon-plot listing recommended Nutritional supplements , according to how much evidence exists for thier benefits, scroll down to see it(and click here for the data behind it) * * * * The gorgeous blog “Information Is Beautiful” recently publish an eye candy post showing a “balloon race” image...

## Siegel-Tukey: a Non-parametric test for equality in variability (R code)

February 22, 2010
By

Daniel Malter just shared on the R mailing list (link to the thread) his code for performing the Siegel-Tukey (Nonparametric) test for equality in variability. Excited about the find, I contacted Daniel asking if I could republish his code here, and he kindly replied “yes”. From here on I copy his note at full. p.s: (The R function can be downloaded from...

## Post hoc analysis for Friedman’s Test (R code)

February 22, 2010
By

My goal in this post is to give an overview of Friedman’s Test and then offer R code to perform post hoc analysis on Friedman’s Test results. (The R function can be downloaded from here) Preface: What is Friedman’s Test Friedman test is a non-parametric randomized block analysis of variance. Which is to say it is a non-parametric version of...

## Updated R code for Bayesian Core

February 8, 2010
By

Simply to mention a minor change made in the prog4.R code for Bayesian Core. Nothing life-threatening, mind you!, just a term replacing a term… Filed under: Books, R, Statistics Tagged: Bayesian Core, R, R code, typo

## Barnard’s exact test – a powerful alternative for Fisher’s exact test (implemented in R)

February 7, 2010
By

(The R code for Barnard’s exact test is at the end of the article, and you could also just download it from here) About Barnard’s exact test About half a year ago, I was studying various statistical methods to employ on contingency tables. I came across a promising method for 2×2 contingency tables called “Barnard’s exact test“. Barnard’s test is a non-parametric alternative to Fisher’s exact...

## Enhanced tidy.source() (Preserve Some Comments)

March 31, 2009
By

After a few hours’ work, I modified the function tidy.source() in the animation package so that it can preserve complete comment lines. See the tidy.source() wiki page for example. tidy.source <- function(source = "clipboard", keep.comment = TRUE, keep.blank.line = FALSE, begin.comment, end.comment, ...) { # parse and deparse the code tidy.block = function(block.text)