How to get various bits of software


JAGS

JAGS is Just Another Gibbs Sampler. It is a program for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo (MCMC) simulation not wholly unlike BUGS. JAGS was written with three aims in mind: Most program written for OpenBugs will run on JAGS with only minor modifications.

JAGS is available for Macintosh, Windoze, and Linux platforms.

Most people use R to use JAGS and so R and Rstudio should be installed on your machine as outlined elsewhere on this page.

  1. Install R and RStudio on your machine as noted elsewhere on this page.

  2. Install the packages as listed in the R installation instrucitons plus the following packages
         R2Jags,    coda,     digest
    Don't forget to check the box on installing dependencies when installing the packages.

  3. Download and install the latest version of JAGS from JAGS Website.

    To test that the installation is working on a Macintosh, open a Terminal window, and simply type jags If you get a message similar to
        Welcome to JAGS 4.x.x on Tue Feb 10 20:35:14 2015
    then you are ok.


LaTeX

LaTeX is a (mathetmatical) typesetting program that can be used with R/Rstudio to make turn-key documents that automatically update themselves if new data are added and the R code is re-run.

A brief introduction is available at https://rpubs.com/YaRrr/SweaveIntro

LaTeX is available for Macintosh, Windoze, and Linux platforms.

Download the LaTeX program from:


Quatro

Quatro is the next generation of RMarkdown. It includes RMarkdown as a subset, but had additional functionality.

A Quatro script mixes R code and text to create a living document. Great for reproducible research and breaking the copy-and-paste paradigm when using MSWord. Visit the Quatro installation page for details.


R (and Rstudio)

R is a free (but not cheap) statistical package available for download. Rstudio is the standard integrated development environment (IDE) for using R that most people use with R.

  1. Download the latest verson of R for your machine from The R Project for Statistical Computing or the local (SFU) mirror site.

  2. Install R using the downloaded files. You will need administrator privlidges for your machine.
    Additional (technical) information is available at: R Installation and Administration but you likely won't need this.

    If you are running Windoze, you should delete any earlier versions of R from previous installations. If you running a Macintosh, newer versions of R automatically overwrite older versions of R

  3. Create a personal (package) library. There are many extensions (packages) available for R. The default location for these packages will require administrative access everytime you update a package. Additionally, when you update to a new version of R, you will lose your installed packages unless you have a personal library.

    Here are instruction for Windoze and Macintosh machines. If you have a Unix machine that is not a Macintosh, the instructions will be similar to that from the Macintosh.

    Many corporate and goernment environments "lockdown" computers so users cannot install packages following the step above.
    Here are instruction on how to install packages when you do not have administrative access to your Windoze machine.

  4. Download Rstudio, an integrated development environment for running R, from the Rstudio website.

  5. Install Rstudio. You will need adminstrative access to your machine.

  6. Install the following packages into your personal library using R or Rstudio (you only need to this with either method).

          AICcmodavg,    arm,    binom,    boot,    car,    data.table,    devtools,    dplyr,    emmeans,    EnvStats,    GGally,    ggplot2,    ggforce,    ggfortify,    ggmap,
          gplots,    gmodels,    gridExtra,    hms,    Kendall,    knitr,    lme4,    lmerTest,    lmtest,    lubridate,    multcomp,    multcompView,
          nlme,    plyr,    pwr,    randtests,    readxl,    reshape2,    rkt,    sf    sp    SiZer,    survey    tidyverse    trend

    Instructions on installing packages ONE AT A TIME using R are availble on this video.
    Instructions on installing packages ONE AT A TIME using Rstudio are available on this video
    BE SURE TO CHECK THE BOX ASKING TO INSTALL DEPENDENCIES as some packages depend on other packages.

    You can install ALL of the above packages by copying and pasting the following into the R console once you open RStudio

    package.set <- c("AICcmodavg","arm",
                     "binom",     "boot",
                     "car",       'data.table',
                      "devtools",'dplyr',
                      "emmeans", "EnvStats",
                     "GGally",    "ggplot2",   
                     "ggforce",   "ggmap",
                     "ggfortify", "gplots",
                     "gmodels",   "gridExtra",
                     "hms",      
                     "Kendall",   "knitr",
                     "lme4",       "lmerTest",
                     "lmtest",     "lubridate",  
                     "multcomp",   "multcompView",
                     "nlme",       "plyr",
                     "pwr",        "randtests",
                     "readxl",     "reshape2",
                     "rkt",        "sf",
                     'sp',        "spData",
                     "SiZer",
                     "survey",   'tidyverse',
                     "trend")
    
    install.packages(package.set)
    

You are now ready to use R and Rstudio. There are many useful on-line manuals on the R site along with much contributed documentation.

CodeSchool has a brief introduction to R that is useful.

The short reference card here is also useful


RMark on a Mac without an emulator

RMark is an R package that calls the MARK optimization engine to fit capture-recapture, occupancy, nest survival, and other similar models.

The MARK program consists of two separate parts -- the user graphical interface which uses Windoze application program interfaces (API) and so can run only under Windoze, and an optimization engine which then actually the model and returns the results to the interface. RMark call the optimization engine only. Consequently, with some work, it is possible to install only the optimiztion engine on the Macintosh and run RMark natively on a Macintosh without the need for a virtualization engine such as VirtualBox.

The following instructions were created by Simon Bonner and follow the thread at Installing MARK on a Macintosh

had to change my shell to zsh before running Bonner's scripts

  1. Install home-brew
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  2. Install gcc
    brew install gcc

  3. Install Mark
    brew tap sjbonner/tap
    brew install mark-on-mac

  4. Check MARK - should return /usr/local/bin
    which mark

  5. Check that mark runs - should return "no input file...."
    mark
Everything seem to work now using RMark under Rstudio without any problems! Hurray,,, no more need for a Windoze virtual machine to run RMark!. YMMV.

SAS

The easiest way for most people to use SAS is via the SAS on Demand for Academic. Visit for more details.
Brought to you StatMathComp Consulting by Schwarz. Email comments or suggestions to Carl Schwarz (cschwarz.stat.sfu.ca@gmail.com) © 2023 Carl James Schwarz Last updated 2023-01-28.