R Cheat Sheets Page 3

ADVERTISEMENT

shapiro.test
Test for normality
ks.test
Test for specified distribution
punitroot
Computes the cumulative probability of MacKinnon’s unit root tes statistic
Decomposition
decompose()
Decompoes the series into seasonal, trend and irregular components using moving averages
filter()
Applies a linear filter to a series
stl()
Decomposes the series into seasonal, trend and irregular components using loess methods
Models
ar()
Fits an autoregressive model
ma()
Fits a simple moving average model
arima()
Fits an arima model with specified parameters
auto.arima()
Automatically fits an arima model
ets()
Fits an exponential smoothing model
HoltWinters()
Computes Holt-Winters Filtering of a given time series
forcast(model, n)
Forecasts the next n points from the time series model
Utility
index()
Returns the index (dates) of the time series
coredata()
Returns a matrix of data from the time series sans index
lag(ts, n)
Returns the time series shifted n times
diff(ts, n)
Returns the time series differences n times
acf() or Acf()
Returns the autocorrelation function of the time series (Acf() from the forecast package)
pacf() or Pacf()
Returns the partial autocorrelation function of the time series (Pacf() from the
forecast package)
ndiff()
Returns the number of differences needed for a time series to have stationarity
accuracy()
Computes the accuracy of a time series model
Quandl
The Quandl package enables Quandl
API
access from
Quandl is a search engine for numerical data, alowing easy
access to financial, social, and demographic data from
within R which makes acquiring and manipulating
hundreds of sources.
numerical data as quick and easy as possible. In your
first Quandl function call you should specifiy your
authtoken (found on Quandl’s website after signing up)
to avoid certain API call limits.
See
for more.
Quandl.auth(“AUTHETICATION_TOKEN”)
Call this first to increase your daily limit
Quandl(“QUANDL/CODE”)
Download Quandl data for a certain Quandl code as a data frame
Quandl.search(“query”)
Search Quandl. Prints first three outputs to screen, returns all in a list.
3

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 4