sdplot: The Standard Deviation Plot

Description Usage Arguments Examples

Description

sdplot() takes a vector of data, a list or a data frame x and finds the standard deviations for the different parts in the dataset. sdplot() is able to divide a vector of data into a self-chosen number of parts. The function sdplot() returns a plot of the standard deviations and the median of those. One more function is to find kind of a continous standard deviation plot, where the first nr numbers of elements are evaluated and then continues through the whole dataset with steps 1.

Usage

1
sdplot(x, nr = 0, divide = TRUE, divided = TRUE, return = FALSE)

Arguments

x

The data to be analyzed. x needs to be a vector, a list or a data frame.

nr

If divide = TRUE: The total number of parts, the datasat has to be divided in, if x is a vector.\n If divide = FALSE: The number of elements which has to be evaluated at the same time while using the continous method.

divide

If set to FALSE, the continous method is used to find standard deviations. Default set to TRUE.

divided

Needs to be defined to tell the function whether the dataset x is already divided into parts (list or data frame) or not divided into parts (vector). If divided is set to TRUE the function divides the dataset into nr parts which are "as equal as possible". Default set to TRUE.

return

If set to TRUE, the function sdplot() returns a vector of the estimated standard deviations. Default set to FALSE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Simulate a dataset from a Poisson distribution:
x = rpois(1000, 3)
# Use sdplot() to divide x into 20 parts and to find the different standard deviations:
sdplot(x, divided = FALSE, nr = 20)
# Also return the estimated standard deviations:
sdplot(x, divided = FALSE, nr = 20, return = TRUE)

# Define a list (or data frame) of data:
x = list(c(1:4), c(4:10), c(1,6,1,8,0,0,98,6), c(10,11,11,11,11,6,3))
# Use sdplot() to find the standard deviations for the different parts:
sdplot(x)

AUMath-AdvancedR2018/StatEngPlots documentation built on May 23, 2019, 6:01 p.m.