Download Spotfire S+ User`s Guide for UNIX

Transcript
Statistics
STATISTICS
S-PLUS includes functions for doing all kinds of statistical analysis,
including hypothesis testing, linear regression, analysis of variance,
contingency tables, factor analysis, survival analysis, and time series
analysis. Estimation techniques for all these branches of statistics are
described in detail in the manual Guide to Statistics.
This section gives overviews of the functions that produce summary
statistics, perform hypothesis tests, and fit statistical models. This
section is geared specifically to statistical analyses that are generated
by S-PLUS command-line functions. For information on the options
available under the Statistics menu in the GUI, see the Statistics
chapter.
Summary
Statistics
S-PLUS includes functions for calculating all of the standard
summary statistics for a data set, together with a variety of robust and/
or resistant estimators of location and scale. Table 2.6 lists of the most
common functions for summary statistics.
The summary function is a generic function that provides appropriate
summaries for different types of data. For example, an object of class
lm created by fitting a linear model has a summary that includes the
table of estimated coefficients, their standard errors, and t-values,
along with other information. The summary for a standard vector is a
six-number table of the minimum, maximum, mean, median, and
first and third quartiles:
> summary(stack.loss)
Min. 1st Qu. Median Mean 3rd Qu. Max.
7
11
15 17.52
19
42
Table 2.6: Common functions for summary statistics.
cor
Correlation coefficient
cummax, cummin,
cumprod, cumsum
Cumulative maximum, minimum, product,
and sum
diff
Create sequential differences
max, min
Maximum and minimum
71