Learn R Programming

RMark (version 3.0.0)

Whatsnew: Summary of changes by version

Description

A good place to look for changes. Often I'll add changes here but don't always get to it in the documentation for awhile. They are ordered from newest to oldest.

Arguments

Author

Jeff Laake

Details

Version 2.0.9 (1 Dec 2011)

  • Patch was made to make.mark.model to fix bug in PIM creation for a multi-session model and there was just 1 session. Thanks to Erin Roche for helping to identify this bug.

  • Patch was made to make.mark.model to fix bug in handling of mlogits for pi and Omega parameters with more than one group. These parameters were introduced with the RDMSMisClass and other new models that were recently added.

  • Additional changes were made to export.MARK to re-fix changes for robust and nest survival model export to MARK.

  • A function mark.wrapper.parallel written by Eldar Rakhimberdiev provides a parallel processing version of mark.wrapper. See the example in the help for the function. The parallel version is functionally the same and can be used in place of mark.wrapper to run sequentially or in parallel. It does not include the run argument however.

  • A bug was fixed in get.real which caused an R error for a triangular PIM that had only a single entry. Thanks to Amanda Goldberg for discovering and reporting this error.

Version 2.0.8 (7 Oct 2011)

  • Both setup.model and setup.parameters were re-written to use data files models.txt and parameters.txt to define models and parameters which should make it easier to add new models. The latter function is now much simpler and smaller.

  • Model RDOccupEG now allows sharing Epsilon and Gamma parameters. Epsilon is the dominant parameter which gets the share=TRUE argument. See RDOccupancy for an example. Thanks to Jake Ivan for an example of what was needed.

  • To avoid confusion, the arguments component and component.name were removed from the parameter specification because these have not been required since v1.3 when full support for individual covariates were included. Likewise the argument covariates in mark and make.mark.model was removed because it was only needed to support the component approach.

  • export.MARK was modified so that if all individual covariates are output, it excludes factor covariates.

  • Many more models were added to those supported in RMark. Now 92 of the 137 models in MARK are supported. See MarkModels.pdf in the RMark directory of your R library to see which models are supported (in red). Most of the remaining unsupported models are versions with mis-identification error and they are not shown in MarkModels.pdf.

  • Previously RMark stored the input file in a temporary file Markxxx.tmp. Using a common filename caused problems when more than one model were spawned to different CPUs, so now it uses a random temporary file name. It also no longer uses common file markxxx.vcv. Thanks to Glenn Stauffer for testing these changes.

  • Sessions are now labelled using value of session time rather than numerically from 1 to largest session number in robust designs. Thanks to Tommy Garrison for this suggestion.

  • A bug was fixed in get.real which caused incorrect assignments of fixed parameter values in the unusual case where a fixed parameter had a non-zero design matrix row.

  • mark.wrapper was modified so it returns a list of the models that were constructed if run==FALSE. Thanks to Eldar Rakhimberdiev for the suggestion and code.

  • Code was added to extract.mark.output to extract deviance degrees of freedom. Thanks again to Eldar for contributing this code.

  • A bug was fixed in make.mark.model that prevented use of sin link on within session parameters in a robust design model. Thanks to Tommy Garrison for reporting this bug.

  • A bug was fixed in make.mark.model which prevented the use of time varying covariates with shared parameters. Thanks to Andre Breton for reporting this bug.

  • simplify argument was removed from functions because I have not found a reason not to simplify and I have not been testing code with simplify=FALSE.

Version 2.0.7 (25 August 2011)

  • Change to make.mark.model to fix bug in which mlogits were incorrectly assigned in ORDMS model when both Psi and pent used mlogit links. Thanks to Glenn Stauffer for identifying and tracking down this error.

  • Fixed export.chdata and export.MARK so Nest survival models can be exported. Also changed default of argument ind.covariates to "all" which will use all individual covariates in the data in the file sent to MARK. Thanks to Jay Rotella for his help.

  • Made change to process.data and mark to include a new argument reverse, which if set to TRUE with model="Multistratum" will reverse the timing of transition and survival. See mstrata for an example of a reverse multistratum model.

  • Made change to make.design.data to allow for zero time intervals in non-robust design model. This was needed to allow use of the reverse time structure in multi-state models. In addition, for the reverse multistate model the function now adds an occasion (occ) field to the design data because the time field will be constant when with a 0 time interval. The row names of the design matrix and real parameters was extended for this model to include occasion (o) and occasion cohort (oc) to create unique labels because cohort and time are not unique with 0 time intervals.

Version 2.0.6 (1 July 2011)

  • Change to MR resight examples so the output does not appear in notepad which was causing problem with check on CRAN submission

Version 2.0.5 (29 June 2011)

  • Order of arguments for model.average.marklist were switched incorrectly such that ... was the second argument. This has been fixed to the original format where ... is at the end. This resulted in the value of any arguments other than the first to be ignored unless specifically named e.g., parameter="Phi". Thanks to Rod Towell for reporting this error.

  • Additional changes were made to .First.lib to 1) examine any MarkPath setting, 2) look in C:/program files/mark or c:/program files (x86)/mark, 3) or to search the path. If MARK executable cannot be found in any of those ways then a warning is issued that the user needs to set MarkPath to the path specification for the location of the MARK executable. Thanks to Bryan Wright for help with tracking down a bug.

  • A bug in add.design.data was fixed where the function gave incorrect results in pim.type was anything other than "all". Thanks to Jeff Hostetler for reporting this error.

  • The mark-resight models PoissonMR, LogitNormalMR, and IELogitNormalMR were added. This required some changes to make.mark.model,make.design.data and compute.design.data and the addition of an argument counts to process.data to provide mark-resight count data that are not in the capture history format. The format for counts is a named list of vectors (one group) or matrices (each group is a row) where the names of the list elements are specific to the model. Currently there is no checking to make sure these are named correctly. Some of these models are very sensitive to starting values; thus the use of initial values in the examples. Thanks to Brett McClintock for his help incorporating these models.

Version 2.0.4 (1 June 2011)

  • Change made to .First.lib to check for availability of mark software that depends on operating system. It now provides a warning rather than stopping package attachment. This allows the user to set MarkPath to some location outside of default location Program Files or Program Files (x86) without changing path which requires administrator privilege on Windows.

  • Change made to run.mark.model to use shQuote because link to mark.exe was not working in some cases.

Version 2.0.3 (17 May 2011)

  • Now requires R 2.13 to use path.package function

  • Change made to .First.lib to check for availability of mark software that depends on operating system.

Version 2.0.2 (16 May 2011)

  • MarkPath no longer needs to be set if mark.exe is no longer in the default location (c:/Program Files/mark) but is specified in the path. The code now uses the R function Sys.which to find the correct location for mark.exe, if it is contained in the Path.

  • Code for crm models was removed from RMark and moved to a different R package called marked that is under-development. This removes the FORTRAN code and accompanying dll and some functions and help files that were extraneous to RMark capabilities. There is still some code in some functions for crm that could be removed at some point. None of this matters to those who use RMark for its original purpose as an interface to mark.exe.

  • Many superficial changes were made to code so it could be posted on CRAN. Three changes that may be noticed by users involved renaming deriv.inverse.link, summary.ch and merge.design.covariates to deriv_inverse.link, summary_ch, and merge_design.covariates. These names conflicted with the generic functions deriv, summary and merge. It is only the last 2 that you may have in your scripts and you will have to rename them. The deprecated function merge.occasion.data was removed. Sorry for any inconvenience.

  • The dependency on Hmisc for the examples was removed by replacing errbar with plotCI.

Version 2.0.1 (21 Feb 2011)

  • Made a change to run.mark.model to handle output filenames that exceeded mark9999.

  • Added an argument prefix in mark, run.mark.model and cleanup. Like other parameters for mark, it can also be used in mark.wrapper as one of the ... arguments. Previously the mark files have always been named "marknnn.*". By specifying prefix you can now create sets of models with different prefixes. For example, prefix="cu" would result in cu001.*(cu001.out, cu001.inp, etc), cu002.* etc. This provides the ability to name files to do things like naming them based on the species being analyzed. In general, there is no need to work with these files directly because the filename.* is stored with each mark object and the various R functions use that link to provide the information from the files. If you use prefixes other than "mark", you'll need to call call cleanup with each prefix to remove unused files. See run.mark.model for an example that shows use of the prefix argument to split the dipper data into separate analyses for each sex. Note that use of prefix was not mandatory here to separate the analyses but it provided a useful example.

  • Additional usefulness has been coded for argument initial for assigning initial values to beta parameters. Previously, the options were either a vector of the same length as the new model to be run or a previously run model in a mark object from which equivalent betas are extracted based on their names in the design matrix. Now if the vector contains names for the elements they will be matched with the new model like with the model option for initial. If any betas in the new model are not matched, they are assigned 0 as their initial value, so the length of the initial vector no longer needs to match the number of parameters in the new model as long as the elements are named. The names can be retrieved either from the column names of the design matrix or from rownames(x$results$beta) where x is the name of the mark object.

  • Using the feature above, I added a new argument use.initial to mark.wrapper. If use.initial=TRUE, prior to running a model it looks for the first model that has already been run (if any) for each parameter formula and constructs an initial vector from that previous run. For example, if you provided 5 models for p and 3 for Phi in a CJS model, as soon as the first model for p is run, in the subsequent 2 models with different Phi models, the initial values for p are assigned based on the run with the first Phi model. At the outset this seemed like a good idea to speed up execution times, but from the one set of examples I ran where several parameters were at boundaries, the results were discouraging because the models converged to a sub-optimal likelihood value than the runs using the default initial values. I've left this option in but set its default value to FALSE.

  • A possibly more useful argument and feature was added to mark.wrapper in the argument initial. Previously, you could use initial=model and it would use the estimates from that model to assign initial values for any model in the set defined in mark.wrapper. Now I've defined initial as a specific argument and it can be used as above but you can also use it to specify a marklist of previously run models. When you do that, the code will lookup each new model to be run in the set of models specified by initial and if it finds one with the matching name then it will use the estimates for any matching parameters as initial values in the same way as initial=model does. The model name is based on concatenating the names of each of the parameter specification objects. To make this useful, you'll want to adapt to an approach that I've started to use of naming the objects something like p.1,p.2 etc rather than naming them something like p.dot, p.time as done in many of the examples. I've found that using numeric approach is much less typing and cumbersome rather than trying to reflect the formula in the name. By default, the formula is shown in the model selection results table, so it was a bit redundant. Now where I see this being the most benefit. Individual covariate models tend to run rather slowly. So one approach is to run the sequence of models (eg results stored in initial_marklist), including the set of formulas with all of the variables other than individual covariates. Then run another set with the same numbering scheme, but adding the individual covariates to the formula and using initial=initial_marklist That will work if each parameter specification has the same name (eg., p.1=list(formula=~time) and then p.1=list(formula=~time+an_indiv_covariate)). All of the initial values will be assigned for the previous run except for any added parameters (eg. an_indiv_covariate) which will start with a 0 initial value.

  • I added a new function search.output.files to the set of utility functions. This can be useful to search all of the output files in a marklist for a specific string like "numerical convergence suspect" or just "WARNING". The function returns the model numbers in the marklist that contain that string in the output file.

  • Further changes were needed to popan.derived to handle data that are summarized (i.e. frequency of capture history >1). Thanks to Carl Schwarz for reporting and finding the change needed.

  • A bug was fixed in create.dm was fixed so it would return a matrix instead of a vector with the formula ~1

Version 2.0.0 (14 Jan 2011)

  • The packages msm, Hmisc, nlme, plotrix are now explicitly required to install RMark. These were used in examples or for specialty functions, but to avoid problems these must be installed as well.

  • Added example for "CRDMS" model that was created by Andrew Paul. See crdms.

  • Change was made for gamma link in v1.9.3 was only made to Pradel model and not Pradsen like it stated. Both now correctly use the logit link as the default for gamma. Thanks to Gina Barton for bringing this to my attention.

  • Change was made in make.mark.model that prevented use of groups with Nest survival models. Thanks to Jeff Warren for bringing this to my attention.

  • Change was made in make.design.data because re-ordering of parameters caused issues with the CRDMS model because the subtract.stratum were not being set for Psi.

Version 1.9.9 (2 Nov 2010)

  • This version was built with R 2.12 and will not work with earlier versions of R. It contains both 32 and 64 bit versions and R will automatically ascertain which to use.

  • Parameter ordering for some models (RDHet, RDFullHet, RDHHet, RDHFHet, OccupHet, RDOccupHetPE, RDOccupHetPG, RDOccupHetEG, MSOccupancy, ORDMS, and CRDMS) had to be changed such that the models could be imported into the MARK interface. This change can influence any code you have written for those models if you specified parameter indices because the ordering of the parameters were changed. For example, see change in example for RDOccupancy to use indices=c(1) from c(10). Thanks to Gary White for helping me work this out.

  • Modified code in extract.mark.output to handle cases with more than 9999 real parameters because MARK outputs **** when it exceeds 9999.

Version 1.9.8 (15 Sept 2010)

  • Added model="CRDMS" with parameters S, Psi, N, p, and c for closed robust design multi-state models

  • Patched popan.derived which produced incorrect abundance estimates with unequal time intervals. Thanks to Andy Paul for finding this error and testing for me.

  • Patched export.MARK which failed for robust design models. Thanks to Dave Hewitt and Gary White for discovering and isolating the problem.

Version 1.9.7 (14 April 2010)

  • Added model="Brownie" with parameters S and f which is the Brownie et al. parameterization of the recovery model. "Recovery only" (in RMark) model="Recovery" which is also encounter type "dead" in MARK uses the Seber parameterization with parameters S and r which is also used in the models for live and dead encounter models.

  • Added model="MSLiveDead" with parameters S, r, Psi and p. It is the multistate version of the Burnham model in which F=1.

  • Added compute.Sn to utility functions for computation of natural survival from total survival when all harvest is reported. Patched nat.surv which was incorrectly rejecting based on model type.

  • Added var.components.reml to provide an alternate variance components estimation using REML or maximum likelihood. It allows a random component that is not iid which is all that var.components can do.

  • Replaced all T/F values with TRUE/FALSE to avoid conflicts with objects named TRUE or FALSE.

Version 1.9.6 (1 February 2010)

  • Writing the popan.derived function has led me down all sorts of paths. I had to make one small change to this function to handle externally saved models. However, various changes listed below were brought on by using this function with a relatively large POPAN model.

  • Most importantly I discovered an error in computations of real parameters with an mlogit link in which some of the real parameters involved in the mlogit link were fixed. This is NOT a problem if you simply used the real parameter values extracted from MARK; however, if you were using either compute.real (model.average uses this function) or covariate.predictions to compute those real parameters (with an mlogit link) then they may be incorrect. This would have been apparent because their value would have changed relative to the original values extracted from the MARK output. Correcting this error involved changes in compute.real, convert.link.to.real and covariate.predictions to correct the real parameter estimates and their standard errors. I've not found it in the MARK documentation but deduced that if you use the mlogit link and fix real parameters it uses those fixed real parameter values in the calculation. A simple example will make it clear. Consider pent for 5 occasions where the first is computed by subtraction and you then have 4 real parameters. Let's assume that the 3rd and fourth parameters were fixed to 0. Then the real parameters are calculated as follows: pent2=exp(beta2)/(1+ exp(beta2)+exp(beta3)+exp(0)+exp(0)), pent3=exp(beta3)/(1+ exp(beta2)+exp(beta3)+exp(0)+exp(0)), pent4=0, pent5=0 and pent1=1-pent2-pent3-0-0 (in this case). Obviously you would not want to fix any real parameters to be >1, <0 or to have the sum to be <0 or >1. This structure also had implications on how the standard error was calculated.

  • In addition the coding was made more efficient in covariate.predictions for the case where data(index=somevector) is used without any data entries for covariate values in the design matrix. While the task performed with that use of the function could be done with compute.real, it is useful to have the capability in covariate.predictions as well because it will then model average over the listed set of parameters. The previous approach to coding was inefficient and led to very large matrices that were unnecessary and could cause failure with insufficient memory for large analyses.

  • Calculation of NGross was added to popan.derived and logical arguments N and NGross were added to control what was computed in the call. In addition, argument drop was added which is passed to covariate.predictions to control whether models are dropped when variance of betas are not all positive.

  • var.components was modified to use qr matrix inversion. The returned value for beta is now a dataframe that includes the std errors which are extracted from the vcv matrix. Also, if the design matrix only uses a portion of the vcv matrix, the appropriate rows and columns are now extracted. Prior to this change, the standard errors would have been unreliable if the design matrix didn't use the entire set of thetas and vcv matrix.

Version 1.9.5 (4 December 2009)

  • A bug in covariate.predictions was fixed that would assign fixed values incorrectly if the parameter indices were specified in anything but ascending order. The error would have been obvious to anyone that may have encountered it because estimated parameters would likely have been assigned a fixed value. In most cases indices would be passed in order if they were selected from the design data unless indices were chosen from more than one parameter type. I discovered it using the popan.derived function I added in v1.9.4 because it requests indices for multiple parameters in a single function call.

Version 1.9.4 (6 November 2009)

  • Note that this version was built with R 2.10 which no longer supports compiled help files (chtml). If you were using compiled help files to get help with RMark, you'll need to switch to regular html files by using options(help_type="html") in R. You can put this command in your RProfile.site file so it is set up that way each time you start R. The functionality is the same but it is not as pretty. You can find the index (what used to be in a window on the left) as a link at the bottom of each help page.

  • Changed export.MARK so it will not allow selection of a project name that would over-write an existing .inp file.

  • Added the function popan.derived which for POPAN models computes derived abundance estimates by group and occasion and sum of group abundances for each occasion. For some reason RMark is unable to extract all of the derived parameters from the MARK binary file for POPAN models. This function provides the derived abundance estimates and their var-cov matrix and adds the abundance estimate sum across groups for each occasion which is not provided by MARK. Note that by default confidence intervals are based on a normal distribution to match the output of MARK, but if you want log-normal intervals use normal=FALSE.

  • The model.average.list and model.average.marklist functions were modified to use revised estimator for the unconditional standard error (eq 6.12 of Burnham and Anderson (2002)) which is now the default in MARK. To use eq 4.9 (the prior formula) set the argument revised=FALSE.

  • Fixed bug in model.average.list which in some cases failed when the list of var-cov matrices were specified.

  • Code in model.average.marklist was changed to set standard error to 0 if the variance is negative. The same is done in the var-cov matrix for the variance and any corresponding covariances. The results from RMark will now match the model average results from MARK for this case. It is not entirely clear that this is the best approach when ill-fitted models are included.

  • Changed code in cleanup to handle case in which a model did not run.

  • Changed use of grep and regexpr in convert.inp and extract.mark.output to accomodate change in R.2.10. The code should work in earlier versions of R but if not update to R2.10.

  • Created a function adjust.value and kept special case of adjust.chat. For any field other than chat it will adjust the value in model$results. As an example, to adjust the effective sample size (ESS) use model.list=adjust.value("n",value,model.list) where value is replaced with the ESS you want to use. As part of the change model.table was changed to recompute AICc.

Version 1.9.3 (24 September 2009)

  • Default link function for Gamma in the Pradel seniority model had been incorrectly set to log and has now been changed to logit to restrict it to be a probability.

  • A bug was fixed in compute.real and covariate.predictions in which confidence intervals were being incorrectly scaled by c (chat adjustment) instead of sqrt(c). The reported standard errors were correctly using sqrt(c) and only the confidence intervals for the real predictions were too large. Simply re-running the prediction computations for a model will provide the correct results. There is no reason to re-run the models. Also this in no way affects model selection.

  • A related bug was fixed in compute.real and covariate.predictions which created invalid confidence intervals for real parameters if a probability link other than logit was used and a single type of link was used for all real parameters (e.g., sin).

Version 1.9.2 (10 August 2009)

  • Added the function export.MARK which creates a .Rinp, .inp and optionally renames one or more output files for import to MARK. The July 2009 version of MARK now contains a File/RMARK Import menu item which will automatically create the MARK project using the information in these files. This prevents problems that have been encountered in creating MARK projects with RMark output because the data/group structures are setup exactly in MARK as they were in RMark. See export.MARK for an example and instructions.

  • Fixed a problem in make.design.data which prevented use of remove.unused with unequal time intervals and more than one group.

  • At least one person has encountered a problem with a very large number of parameters in which RMark created the input file with PIMs written in exponential notation for the larger indices. MARK will not accept that format and it will fail. The solution to this is to set the R option scipen to a positive number. Start with options(scipen=1) and increase if necessary.

Version 1.9.1 (2 June 2009)

  • Fixed a problem make.design.data which was not using begin.time to label the session values

  • Made a change in export.chdata like the change in make.mark.model to accomodate change with release of version R2.9.0.

  • Made a change in process.data so that strata.labels can be specified for Multistrata designs like with ORDMS so an unobserved strata can be included.

  • A warning was added to the help file for export.chdata and export.model so it is clear that the MARK database must be created correctly and with the .inp file created by export.chdata from the processed data that was used to create the models that are being exported. This is to ensure that the group structure is setup such that the assumed model structure for groups matches the model structure setup in the .inp file.

Version 1.9.0 (30 April 2009)

  • Fixed a bug in summary.mark which occasionally produced erroneous results with showall=FALSE.

  • Made a change in make.mark.model to accomodate change with release of version R2.9.0.

  • RMark now requires R version 2.8.1 or higher.

Version 1.8.9 (9 March 2009)

  • Changed model.average.marklist and covariate.predictions to set NaN or Inf results in v-c matrix to 0 to cope with poorly determined models. Also, for each function the dropping of models is now restricted to cases in which there are negative variances for the betas being used in the averaged parameter estimates. Unused betas are ignored. For example, if model.average is called with parameter="Phi", then the model will only be dropped if there is a negative variance for one of the betas associated with "Phi".

  • In var.components the tolerance value (tol) in the call to uniroot was reduced to 1e-15 which should provide better estimates of the process variance when it is small. Previously a process variance less than 1e-5 would be treated as 0.

  • Made changes to cleanup, coef.mark, and make.mark.model to accomodate externally saved model objects (external=TRUE).

Version 1.8.8 (5 December 2008)

  • An error was fixed in make.time.factor which created incorrect assignments when only some of the time dependent variables contained a "." for occasions with no data.

  • Patched compute.design.data which was not creating the design data in the same order as the PIM construction for the newly added ORDMS model.

  • Generalized section of code in make.mark.model to handle mlogit structure for ORDMS model.

  • Fixed a bug in process.data in which the initial ages were not correctly assigned in some situations with multiple grouping variables. Note that it is always a good idea to examine the design data after it is created to make sure it is structured properly because it relates the data and model structure via the grouping variables and the pre-defined variables (ie age, time etc), While I've done a lot of testing, I have certainly not tried every possible example and there is always the potential for an error to occur in a circumstance that I've not encountered.

Version 1.8.7 (13 November 2008)

  • An argument common.zero was added to function make.design.data and compute.design.data. It can be set to TRUE to make the Time variable have a common time origin of begin.time which is useful for shared parameters like p and c in closed capture and similar models.

  • The function read.mark.binary was patched to work with the newer versions of MARK.EXE since 1 Oct 2008.

  • The model type ORDMS for open robust design multi-state models was added. An example data set will be added at a later date after further testing has been completed.

  • Some patches were made to fix some aspects of profile intervals and to fix adjustment by chat in summary.mark when showall=F. The notation for profile intervals is now included in the field model$results$real$note where model is the name of a mark model. Previously an incomplete notation was kept in model$results$real$fixed but that field is now used exclusively to denote fixed parameters. It is important to realize that profile intervals computed by MARK are only found in model$results$real$note and are not changed by a chat adjustment unless the model is re-run. None of the intervals computed by RMark and displayed by summary.mark are profile intervals.

Version 1.8.6 (28 October 2008)

  • A bug in an error message for initial.ages in process.data was fixed.

  • A new function var.components was added to provide variance components capability as in the MARK interface except that shrinkage estimators are not computed currently.

  • Fixed parameter values are now being reported correctly by covariate.predictions. Also over-dispersion (c>1) was not being included in the variances for parameters except those using the mlogit link.

  • Some utility functions were added including pop.est,nat.surv, and extract.indices.

  • The function model.average has been changed to a generic function. Currently it supports 2 classes: 1) list, and 2) marklist. The latter was the original model.average which has been renamed model.average.marklist and the first argument has been renamed x instead of model.list to match the standard generic function approach. The previous syntax model.average(...) will work as long as the usage does not name the first agument as in the example model.average(model.list=dipper.results,...). The list formulation (model.average.list) was created to enable a generic model averaging of estimates instead of just real parameter estimates from a mark model. It could be used with any set of estimates, model weights and estimates of precision.

  • A change is needed to read.mark.binary to accomodate the change to mark.exe with the version dated 1 Oct 2008. Some data types (notably Nest survival) may not work with the new version of mark.exe. Working with Gary to make the patch. If you need an older version of mark.exe contact me.

Version 1.8.5 (8 October 2008)

  • A bug in process.data was fixed that prevented use of a dataframe contained in a list while using the groups argument.

  • Profile intervals on the real parameters can now be obtained from MARK using the arguments profile.int and optionally chat in mark. The argument profile.int can be set to TRUE and a profile interval will be constructed for all real parameters, or a vector of parameter indices can be specified to restrict the profiling to certain parameters. The value specified by chat is passed to MARK for over-dispersion.

  • References to cjs, js etc have been removed from here because this code was removed 5/11/11.

  • Yet another fix to summary.ch which gave incorrect results for the number recaptured at least once when marray=F and the data contained non-unity values for freq.

Version 1.8.4 (29 August 2008)

  • A generic function coef.mark was added to extract the table of betas from the model with the expression coef(model) where model is a mark model that has been run and contains output. The table includes standard errors and confidence intervals.

  • An argument brief was added to summary.mark. If brief=TRUE the real parameters are not included in the summary.

  • References to cjs, js etc have been removed from here because this code was removed 5/11/11.

  • A bug in summary.ch was fixed. It would produce erroneous results when the data contained a non-constant freq field. Results with the default of freq=1 were fine.

  • The function adjust.chat and its help file were changed such that it was clear that a model.list argument was needed.

Version 1.8.3 (25 July 2008)

  • For robust design models, an error trap was added to process.data to make sure that the capture history length matches the specification for the time.intervals. This error was already trapped for non-robust models.

  • Fixed an error in make.mark.model that prevented interaction model of session/time-specific individual covariates in a robust design model.

  • Fixed an error in process.data so that the field freq is optional for nest survival data sets.

  • print.mark was modified to add an argument input which if set to input=TRUE will have the MARK input file be displayed rather than the output file. Also, wait=FALSE was set in the system command which means the viewer window will be opened and you can carry on with R. Before you had to close the viewer window before proceeding with R.

  • An example RDOccupancy provided by Bret Collier was added for the Robust Occupancy model which shows the use of session and time-varying individual covariates in a robust design model.

Version 1.8.2 (26 June 2008)

  • summary.ch was modified to allow missing cohorts (no captures/recaptures) for an occasion and to fix a bug in which bygroup=FALSE did not work when groups were defined.

  • To avoid running out of memory, an argument external has been added to collect.models, mark, rerun.mark, and run.mark.model. As with all arguments of mark, external can also be set in mark.wrapper. Likewise, external can also be set in run.models and it is passed to run.mark.model. The default is external=FALSE but if it is set to TRUE then the mark model object is saved in an external file with an extension .rda and the same base filename as its matching MARK output files. The mark object in the workspace is a character string which is the name of the file with the saved image (e.g., "mark001.rda"). If external=TRUE with mark.wrapper then the resulting marklist contains a list entry for each mark model which is only the filename and then the last entry is the model.table. All of the functions recognize the dual nature of the mark object (i.e., filename or mark object) in the workspace. So even if the mark object only contains the filename, functions like print.mark or summary.mark will work. However, if you have used external=TRUE and you want to look at part of a mark object without using one of the functions, then use the function load.model. Whereas, before you may have typed mymark$results, if you use external=TRUE, you would replace the above with load.model(mymark)$results.

  • Functions store and restore were created to store externally and restore models from external storage into the R workspace. They work on a marklist and are only needed to store externally existing marklist models or ones originally created with external=FALSE or to restore if you change your mind and decide to keep them in the R workspace.

  • Error in setup for robust design occupancy models with more than 2 primary sessions was fixed. The error resulted in mark.exe crashing.

  • The concept of time-varying individual covariates has been expanded to include robust design models which have both primary (session) and secondary (time) occasion-specific data. For a robust design, a time-varying individual covariate can be either session-dependent or session-time dependent. As an example, if there are 3 primary sessions and each has 4 secondary occasions, then the individual covariates can be named x1,x2,x3 to be primary session-dependent or named x11,x12,x13,x14,x21,x22,x23,x24,x31,x32,x33,x34. The value of x can be any name for the covariate. In the formula only the base name is used (e.g., ~x) and RMark fills in the individual covariate names that it finds that match either the session or session-time individual covariates.

Version 1.8.1 (19 May 2008)

  • Added function summary.ch to provide summaries of the capture history data (resighting matrices and m-arrays). It will not work with all types of models at present. It will work with CJS and Jolly-type models.

  • Added argument model.name to model.table to be able to use alternate names in the model table. It can use either the model name with each mark object which uses a formula notation (the current approach) or it can use the name of the R object containing the mark model (model.name=FALSE). See model.table for an example. Also, the help file for model.table was updated to reflect the code changes implemented in version 1.7.3.

  • Code in mark.wrapper was modified to output the number of columns and column names of the design matrix for each model if run=FALSE. This allows a check of each of the columns included in the model. By reviewing these you can assess whether the model was constucted as you intended. If there is any question you can either use model.matrix or make.mark.model to examine the design matrix more thoroughly.

  • A bug in the new function merge.design.covariates was fixed in which merge was sorting the design data which does obvious bad things. Adding sort=FALSE does not appear to mean that the data frame is left in its original order. To prevent this, the dataframe is forced to remain in its original order by adding a sequence field for re-sorting after the merge.

Version 1.8.0 (8 May 2008)

  • Fixed a bug in model.average that caused it to fail and issue an error when any of the models included a time dependent covariate in the parameter being averaged.

  • Added merge.design.covariates which is meant to replace merge.occasion.data. This new function allows covariates to be assigned by time, time and group, or just group. It also uses a simplified list of arguments and works with individual design dataframes rather than the entire ddl. It uses the R function merge which can be used on its own to merge design covariates into the design data. You can use merge directly as this function only checks for some common mistakes before it calls merge and it handles reassignemnt of row names in the case were design data have been deleted. An example, where you might want to use merge instead of this function would be situations where the design data are not just group, time or group-time specific. For example, if groups were specified by two different factor variables say initial age and region and the design covariates were only region-specific. It would be more efficient to use merge directly rather than this function which would require an entry for each group which would be each pairing of inital age and region. If you use merge and you deleted design data prior to merging, save the row.names, merge and then reassign the row.names.

  • An argument run was added to mark.wrapper. If set to FALSE, then it will run through each set of models in model.list and try to build each model but does not attempt to run it. This is useful to check for and fix any errors in the formula before setting off a large run. If you use run=FALSE do not include arguments that are meant to be passed to run.mark.model like adjust.

Version 1.7.9 (7 April 2008)

  • make.design.data was fixed so that remove.unused=T will work properly when different begin.time values are specified for each group.

Version 1.7.8 (12 March 2008)

  • Changed the default link for N to log in the setup.parameters for the HetClosed and FullHet. It was incorrectly set to logit which created incorrect estimates to be computed in model.average because MARK forces the log link for N regardless of what is set in the input file.

Version 1.7.7 (6 March 2008)

  • Supressed warning message that occurred with code to check the validity of the sin link in make.mark.model.

  • Fixed a couple of bugs in covariate.predictions that prevented it from working for some cases after including code for the sin link.

  • Added function release.gof to construct the RELEASE goodness of fit test and extract the TEST2 and TEST3 final chi-square, df and P-values.

Version 1.7.6 (26 Feb 2008)

  • make.mark.model was modified to change the capitalization of the link functions and to remove all spaces after "=" in the input file for mark.exe. These differences were preventing the MARK interface from fully importing the model. Although the model would be imported and could be run inside the MARK interface, median c-hat would not run and would give an error stating "Invalid Link" for any model imported from RMark. Now transfering a model from RMark to the MARK interface is fully functional (I hope). If you want to import an output file that was created with a prior version of RMark without re-running it, use a text editor on the output file and remove any spaces before and after an = sign. Then change the capitalization of the links to "Logit", "MLogit", "Log", "LogLog", "CLogLog", "Identity".

  • The sin link is now supported if the formula for the parameter generates an identity matrix for the parameter. For example, if you use ~-1+time instead of ~time then the resulting design matrix will be an identity for time. Likewise, for interactions use ~-1+group:time instead of ~group*time. If you select the sin link and the resulting design matrix is not an identity for the parameter, an error will be given and the run will stop.

  • To match the output from MARK, the confidence intervals for real parameters using any 0-1 link including loglog,cloglog,logit and sin are now computed using the logit transformation. For previous versions this will only affect any results that were using loglog and cloglog. Previously, it was using the chosen link to compute the se and the interval endpoints. The latter is still used for the log and identity links which are not bounded in 0-1.

  • The model "Jolly" was added to the supported list of models. Parameters include Phi,p,Lambda,N. It is not a particularly numerically stable model and often will not converge. Use of options="SIMANNEAL" in call to mark is recommended for better convergence. It will take much longer to converge but is mroe reliable.

Version 1.7.5 (24 Jan 2008)

  • model.average was modified to ignore any models that did not run and either had no attached output file or no results.

  • read.mark.binary and extract.mark.output were modified to extract and store the real.vcv matrix (var-cov matrix of the simplified real parameters) in the mark object if realvcv=TRUE. The default is realvcv=FALSE. This argument has been added to functions mark, run.mark.model and rerun.mark.

  • An argument delete has also been added to mark and run.mark.model. The default value is FALSE but if set to TRUE it deletes all output files created by MARK after extracting the results. This is most useful for simulations that could easily create thousands of output files and after extracting the results the model objects are no longer needed. This is just a convenience to replace the need to call cleanup.

Version 1.7.4 (10 Jan 2008)

  • A bug in make.mark.model was fixed. It was preventing creation of individual (site) covariate models for parameters with only a single parameter (single index) in certain circumstances like Psi1 in the MSOccupancy model.

  • The fix to merge.occasion.data in version 1.7.1 did not work when design data had been deleted. That has been remedied.

  • Various functions with some operating specific calls have been modified so they will work on either Windows or Linux. Thus, the there is a single file for all source/help for both operating systems in RMarkSource.zip. It can be downloaded to either Windows or Linux to build the package. You need to build the package for Linux but not for Windows. For Windows, you only need RMark.zip which contains the pre-built package which only needs to be installed. Currently, with Linux the variable MarkPath is ignored and mark.exe is assumed to be in the path. Also, for Linux the default for MarkViewer is "pico" (an editor on some Linux machines). This can be modified in print.mark or by setting MarkViewer to a different value. The one Linux specific function is read.mark.binary.linux. The function extract.mark.output calls either read.mark.binary.linux or read.mark.binary depending on the operating system. A Linux version of mark.exe (32 or 64 bit) can be obtained from Evan.

Version 1.7.3 (4 Jan 2008)

  • In working with the occupancy models, it became apparent that it would be useful to have a new function called make.time.factor which creates time-varying dummy variables from a time-varying factor variable. An example is given using observer with the occupancy dataset weta from the MacKenzie et al Occupancy modelling book.

  • To match the results in the book, I added arguments use.AIC and use.lnl to function model.table to construct a results table with AIC rather than AICc and -2LnL values. The latter is more useful with a mix of models some using individual covariates and others not.

  • A modification was made to make.mark.model with the MSOccupancy model to fix the name of the added data for parameter p1 when share=TRUE to be p2. For an example which uses p2 to construct an additive model, see NicholsMSOccupancy.

Version 1.7.2 (20 Dec 2007)

  • In changing code for the occupancy models, a brace was misplaced which prevented the nest survival models from working. This has been fixed. Also, the example code for mallard and killdeer was modified to exclude the calls to process the input file. This enables use of the function example() to run the example code (e.g. example(mallard)). From now on as I add examples they are being included in my test set to avoid this type of problem in the future.

Version 1.7.1 (14 Dec 2007)

  • If you update with this version of RMark make sure to update MARK also, so you get the fixes for some of the occupancy models.

  • A minor bug was fixed in function merge.occasion.data that created duplicate row names and prevented the design data from being used in a model.

  • Thirteen different occupancy models were added. Models in the following list use the designation from MARK: Occupancy, OccupHet, RDOccupEG, RDOccupPE, RDOccupPG, RDOccupHetEG, RDOccupHetPE, RDOccupHetPG,OccupRNPoisson, OccupRNNegBin,OccupRPoisson,OccupRNegBin,MSOccupancy. Het means it uses the Pledger mixture and those with RD are the robust design models. The 2 letter designations for the RD models are shorthand for the parameters that are estimated. For EG, Psi, Epsilon, and Gamma are estimated, for PE gamma is dropped and for PG, Epsilon is dropped. For the latter 2 models, Psi can be estimated for each primary occasion. The last 5 models include the Royle/Nichols count (RPoisson) and presence (RNPoisson) models and the multi-state occupancy model. See salamander for an example of Occupancy, OccupHet, Donovan.7 for an example of OccupRNPoisson,OccupRNNegBin, Donovan.8 for an example of OccupRPoisson,OccupRNegBin, see RDSalamander for an example of the robust design models and NicholsMSOccupancy for an example of MSOccupancy. salamander data.

  • The functions create.model.list and mark.wrapper were modified so that a list of parameters can be used to loop. This is useful in the situation with shared parameters such as p1 and p2 in the MSOccupancy model, closed models etc. See p1.p2.different.dot in NicholsMSOccupancy for an example. It can also be useful if the model definitions are linked conceptually (e.g., when one parameter is time dependent, the other should also be time dependent).

  • The "." value in an encounter history is now acceptable to RMark and gets passed to MARK for interpretation as a missing value.

  • print.marklist was fixed to show the model table properly after a c-hat adjustment was made. The change in the code in version 1.6.5 to add parameter specific values to the model table had the side-effect of dropping the model name if c-hat was adjusted.

Version 1.7.0 (7 Nov 2007)

  • A function deltamethod.special for computation of delta method variances of some special functions was added. It uses the function deltamethod from the package msm. You need to install the package msm from CRAN to use it.

  • A more complete example (mallard) created by Jay Rotella was added for the nest survival model. His script provides a nice tutorial for RMark and the utility of R to provide a wide-open capability to calculate/plot etc with the results. It also demonstrates the advantages of scripting in R to document your analysis and enable it to be repeated. Before you use his tutorial you need to install the package plotrix from CRAN. At a later date, Jay has said he will add some additional examples to demonstrate use of the deltamethod function to create variances for functions of the results from MARK.

  • Various changes were made to help files. A more complete description of cleanup was given to tie into mallard example.

Version 1.6.9 (10 Oct 2007)

  • Nest survival model was added to list of MARK models supported by RMark. See killdeer for an example. Note that the data structure for nest models is completely different from the standard capture history so the functions import.chdata, export.chdata and convert.inp do not work with nest data structure.

  • Slight change was made to run.mark.model and print.markto accomodate change in R 2.6.0.

Version 1.6.8 (2 Oct 2007)

  • Changes were made to merge.occasion.data to enable group and time-specific design covariates to be added to the design data.

  • Change was made to setup.parameters to use a log-link for N in the closed-capture models. MARK forces that link for N but the change was needed for model.average which does the inverse-link computation. Note that the reported N in model.average is actually f0 (number not seen). To get the correct values for N simply add M_t+1 (unique number captured) to f0. That is the way MARK computes N. The std error and confidence interval is on f0 such that the lower ci on N will never be less than M_t+1.

  • An error was fixed in the output of model.average. When you selected a specific parameter, it was giving a UCL which was a copy from one of the models and not the UCL from the model averaging. If you didn't specify vcv=T it only showed the errant UCL and if you did specify vcv=T then it showed the correct LCL and UCL but then added the errant UCL in a column. This occurred because it was adding covariate data for the specific parameter and was shifted a column because of a change in 1.6.1.

Version 1.6.7 (7 Aug 2007)

  • Changes were made in print.mark, print.summary.mark and compute.design.data to acommodate changes in V2.5.1 of R. When upgrading versions of R problems may occur if RMark was built with an earlier version of R. The version of R that was used to build RMark is listed on the screen each time it is loaded with library(RMark) This is RMark 1.6.7 Built: R 2.5.1; i386-pc-mingw32; 2007-08-07 09:00:33; windows

  • The help file for import.chdata was expanded to clarify the differences between it and convert.inp and the use of the freq field.

Version 1.6.6 (14 May 2007)

  • Function make.mark.model was fixed so that the real label indices were properly written when simplify=FALSE is used.

  • Function make.mark.model was also changed to remove the parameter simplification for mlogit parameters that was added in v1.4.5. I mistakenly assumed that the mlogit parameters were setup such that the normalization to sum to 1 was done will all the real parameters in the set (i.e., all PSI for a single stratum). In fact, the mlogit values are only specified for the unique real parameters so if there is any simplification and the sum of the probabilities is close to 1 (excluding subtraction value) the values will not be properly constrained. For example, with the mstrata data if the problem was constrained such that PSI from AtoB was equal to AtoC, it is still necessary to have these as separate real parameters and constrain them with the design matrix. As it turns out, with the mstrata example it does not matter because the problem is such that the sum of Psi for AtoB and AtoC is not close to 1 (same for other strata) and any link will work. This change will only be noticeable in situations in which the constraint matters (i.e., the probability for the subtraction parameter is near 0). The change back to non-simplification for mlogit parameters may increase execution times because the design matrix size has been increased. Previous users of the Multistrata design will see very little difference in there results if they only used models containing stratum:tostratum because that will create an all-different PIM within each mlogit set. When I ran the mstrata examples with this version and compared them to v1.6.5 the results were different but they were differences in the 5th or smaller decimal point due to differences in numerical optimization.

Version 1.6.5 ( 3 May 2007)

  • Function model.table was modified to include parameter formula fields in the model.table dataframe of a marklist. Previously only the model.name was included which is a concatenation of the individual parameter formulas. The additional fields allows extracting the model table results based on one of the parameter formulas or to create a matrix of model AICc or other values with rows as one parameter and colums as the other. See model.table for an example.

  • Function process.data was modified such that factor variables used for grouping retain the ordering of the factor levels in the data file. Previously they would revert back to default ordering and the re-leveling would also have to be repeated on the design data also.

  • An argument brief was added to mark to control amount of summary output.

  • Fixed a bug in get.real that prevented computation for models without the stored covariate values.

  • Added code to make.mark.model that prevents constructing models with empty rows in the design matrix unless the parameter is fixed. For example, if you were to try ~-1+Time for the dipper data, it will fail now because there is no value for the intercept (Time=0).

  • Function mark.wrapper outputs the model name to the screen before running the model which helps associate any error messages to the model if output=F.

Version 1.6.4 (7 March 2007)

  • A new function export.model was created to copy the output files into the naming convention needed to append them into a MARK .dbf/.fpt database so they can be used with the MARK interface features. This is useful to be able to use some of the features not contained in RMark such as median c-hat and variance component estimation. To create a MARK database, first use export.chdata to create a .inp file to pass the data into MARK. Start MARK and use File/New to create a new database. Select the appropriate Data Type (model in RMark) and fill in the appropriate values for encounter occasions etc. For the Encounter Histories File Name, select the file you created with export.chdata. Once you have created the database in the Program MARK interface, click on the Browse menu item and then Output/Append and select the output file(s) (i.e those with a Y.tmp) that you exported with export.model. Note that this will not work with output files run with versions of RMark prior to this one because the MARK interface will give a parse error for the design matrix. To get around