[R] Normality tests

Tobias Verbeke tobias.verbeke at telenet.be
Sat Aug 4 21:17:12 CEST 2007

Hi Alexandre,

Alexandre Christie wrote:
> I am new to R, and I am writing to seek your advice on how best to use it to run
> R's various normality tests in an automated way.
> In a nutshell, my situation is as follows. I work in an investment bank, and my
> team and I are concerned that the assumption we make in our models that the
> returns of assets are normally distributed may not be justified for certain
> asset classes. We are keen to check this statistically.
> To this end, we have an Excel document which contains historical data on the
> returns of the asset classes we want to investigate, and we would like to run
> R's multiple normality tests on these data to check whether any asset classes
> are flagged up as being statistically non-normal.
> I see from the R documentation that there are several R commands to test for
> this, but is it possible to progamme a tool which can (i) convert the Excel data
> into a format which R can read, then (ii) run all the relevant tests from R,
> then (iii) compare the results (such as the p-values) with a user-defined
> benchmark, and (iv) output a file which shows for each asset class, which tests
> reveal that the null hypothesis of normality is rejected?

The short answer is `yes, this is perfectly possible' by putting all
the pieces in an R script file and sourcing it or processing it in
batch mode.

ad (i): there are several ways of accessing Excel files.
	Using RODBC is one of them. Section 8 of the R
	Data Import / Export gives an overview of all options.

ad (ii): this is a matter of conducting the tests and storing
	the test results in appropriate data structure

ad (iii): straightforward

ad (iv): you did not specify

> My team and I would be very grateful for your advice on this.
> Yours sincerely,
> Alex.
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list