Learn R Programming

Luminescence (version 0.3.1)

calc_Statistics: Function to calculate statistic measures

Description

This function calculates a number of descriptive statistics for De-data, most fundamentally using error-weighted approaches.

Usage

calc_Statistics(data, weight.calc = "reciprocal")

Arguments

data
data.frame or RLum.Results object (required): for data.frame two columns: De (data[,1]) and De error (data[,2]). To plot
weight.calc
character: type of weight calculation. One out of "reciprocal" (weight is 1/error), "square" (weight is 1/error^2).

Value

  • Returns a list with weighted and unweighted statistic measures.

Function version

0.1 (2014-04-13 14:28:51)

Examples

Run this code
## load example data
data(ExampleData.DeValues, envir = environment())

## show a rough plot of the data to illustrate the non-normal distribution
plot_KDE(ExampleData.DeValues)

## calculate statistics and show output
str(calc_Statistics(ExampleData.DeValues))

## now the same for 10000 normal distributed random numbers with equal errors
x <- as.data.frame(cbind(rnorm(n = 10^5, mean = 0, sd = 1),
                         rep(0.001, 10^5)))

## note the congruent results for weighted and unweighted measures
str(calc_Statistics(x))

Run the code above in your browser using DataLab