pstrat(intdir = NULL, estdir = NULL, pstdir = NULL, state = NULL,
year = NULL, stwave = NULL, endwave = NULL, psfactor = NULL)
year
.pestdir
directory as AG_
yyyywv.csv
(e.g., AG_
20075.csv
).extractMRFSS
. Post-stratification methodology follows
the SAS post-stratification program available from MRFSS. A dataframe must be created that contains
the MRFSS variable(s) linked to the variable AREA.G which identifies the post-stratification scheme.
As a first example, the State of Massachusetts post-stratifies catch estimates by county to examine regional fishing
harvest. The MRFSS variable CNTY is used to group the regions. To code the post-stratification variable, a dataframe
containing CNTY numbers and the associated grouping labels under variable AREA.G
is created as follows:
post<-data.frame(CNTY=c(9,21,25,23,1,7,5,18,17,27),
AREA.G=c("A","B","C","D","E","F","G","H","Y","Y"))
Each AREA.G
label is matched to a specific county. AREA.G
must be the name of the grouping label. More than one variable (other than CNTY) can be used to parse
the data into more specific strata by creating an additional column in the dataframe.
As a second example, the State of Florida post-stratifies catch estimates into four regions (Northeast, Southeast,
Southwest and Northwest Florida) related to spotted seatrout (Cynoscion nebulosus) management. The coding for
the four regions uses CNTY to create groupings:
post<-data.frame(CNTY=c(89,31,109,35,19,107,127,9,61,111,85,
99,11,25,87,21,51,71,15,27,115,81,
57,103,101,53,17,75,1,29,123,65,129,37,
77,45,5,133,131,91,113,33
),
AREA.G=c("N","N","N","N","N","N",
"S","S","S","S","S","S","S",
"S","S","S","S","S","S","S",
"S","S","S","S","N","N","N",
"N","N","N","N","N","N","N",
"N","N","N","N","N","N","N",
"N"))
Notice that there are not four AREA.G
labels for the different areas because post-stratification is automatically performed
over the sub-region variable (Florida East Coast SUB.REG=6 and Florida West Coast is SUB.REG=7). For states with only one SUB.REG code,
four AREA.G
labels would need to be created.
The AREA.S variable, which is the AREA.G and AREA.X labels combined, is created in the output file and designates the
post-stratification levels.
All variables coded found in the MRFSS Recreational Fisheries Data User's Manual.extractMRFSS
## An example of code - not a working example
post<-data.frame(CNTY=c(9,21,25,23,1,7,5,18,17,27),
AREA.G=c("A","B","C","D","E","F","G","H","Y","Y"))
pstrat(intdir="C:/Temp", estdir="C:/Temp",pstdir="C:/Temp",state=25,
year=2007,stwave=2,endwave=6,psfactor=post)
Run the code above in your browser using DataLab