makedat: Set up the catch and covariate data as anomalies. It takes a...

Description Usage Arguments Value Examples

View source: R/makedat.R

Description

Creates a data frame for the demeaned LOG Kerala catch anomalies and standardized covariate anomolies. You can specify that covariate value is lagged by 'lag' quarters or use a specific quarter from a specific year as the covariate for all qtrs in a 'sardine year'. A sardine year starts in Q3 and goes to Q2 the next calendar year.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
makedat(
  region = "Kerala",
  covname = "Precip",
  boxes = 1:14,
  rm.trend = TRUE,
  rm.season = TRUE,
  startyear = 1956,
  endyear = 2016,
  lag = 0,
  yearlag = 0,
  cov.qtr = 1:4
)

Arguments

region

"Kerala", "Karnataka", "Goa" or "SWCoast"

covname

name of the covariate. Must be a colname in seio_covariates_qtr. If one of the covariates is from the boxes, then specify the part of the name in front of the number.

boxes

for covariate from a box, the box number or numbers to use

rm.trend

whether to detrend the catch and covariates

rm.season

whether to deseason the catch and covariates

startyear

first year

endyear

last year

lag

lag to use for the covariate. Do not set both this and yearlag.

yearlag

If 0, it means covariate in year when sardine year starts; a sardine year starts in Q3.

cov.qtr

the quarter to use for the covariate IF a specific quarter is wanted for the covariate.

Value

data frame

Examples

1
2
3
4
5
6
7
8
#covariate is rain in qtr 2 of the previous year
#my numbering is weird.  yearlag=1 & cov.qtr=2 would have the starred Q2 as the cov for the year in > <
Q1 *Q2* Q3 Q4 Q1 Q2 | >Q3 Q4 Q1 Q2< |
makedat(covname="Precip.Kerala", boxes=4, rm.trend=TRUE, rm.season=FALSE, yearlag=1, cov.qtr=2)

#yearlag=0 & cov.qtr=2 would have the starred Q2 as the cov for the sardine year in > <
Q1 Q2 Q3 Q4 Q1 *Q2* | >Q3 Q4 Q1 Q2< |
makedat(covname="Precip.Kerala", boxes=4, rm.trend=TRUE, rm.season=FALSE, yearlag=0, cov.qtr=2)

eeholmes/SardineForecast documentation built on July 17, 2021, 2:56 a.m.