Chronomics Analysis Toolkit
  • Home
    • Citing this site
    • Reference Material
    • Contact Us
  • Analysis Techniques
    • Actogram
    • Smoothing
    • Autocorrelation
    • Crosscorrelation
    • Cosinor
    • Distributions
  • Running CAT
    • Running CAT Cosinor >
      • Interpreting CATCall
      • Data Formats
      • Errors
    • Running CAT PMC
    • Running CAT PMCTest
  • Installation
    • Installing R
    • Installing CAT >
      • Version Archive
    • Vignettes
  • Sample Output
    • CAT Output
    • Cosinor Output
  • Data
  • MBS Supplemental Materials
  • Supplemental

Running CAT Population-Mean Cosinor Parameter Test (PMCtest)

Examples of calling PMC Parameter Test can be found on the Vignettes page, and associated instructions.

Instructions for Calling the Chronomics Analysis Toolkit (CATkit) Cosinor
After installing R and RStudio:
1.  Download the Installing CATkit pdf
2.  Open Installing CAT from tar with a text editor (or R)
3.  Following the directions, open Vignette.r and modify it to run a vignette
4.  To run the vignette, double click on Vignette.r;
or, if you have Vignette.r open in R or RStudio, you can run it by selecting shift-cmd-S; or from the Menu, select Code-->Source
5.  After the program completes running, it will give you the name of the output file (in the same folder as the input was found).

Parameterization

Each parameter has default values that will be used if not explicitly set.  The call to Population-mean Cosinor Parameter Test (PMCtest), with defaults is:
CATparam(data, fileName, colNames, GrpID = NA, VarID = NA, alpha = 0.05, header=FALSE, sep="\t", Output=list(Doc=TRUE,Txt=FALSE), functionName="", title="")

Examples:
Ex1:  Call when using parameter fileName without headers:
filePath<-"/Users/user/Documents/Testing"
fileName<-file.path(filePath,'cos01x.txt')
cosdat <- c("PR", "MESOR", "Amp", "Phi", "age_grp", "id", "act_age", "gender", "diet", "smoking", " ")
CATparam(fileName=fileName, colNames=cosdat, GrpID="age_grp",sep=',',header=FALSE, functionName="File with no Hdr")

Ex2:  Call when using parameter data (array of data) without headers:
cosdat<-read.table("/Users/user/Documents/Testing/cos01x.txt",sep=",", stringsAsFactors=FALSE)  # stringsAsFactors=FALSE is required
cosdatnames <- c("PR", "MESOR", "Amp", "Phi", "age_grp", "id", "act_age", "Lipids","gender", "diet", "smoking")
CATparam(data=cosdat, colNames=cosdatnames, VarID=8, GrpID=c(9,11),header=FALSE,sep=",",functionName="VarID and GrpID", title="demo both VarID and GrpID from data.frame")


FileName:      (optional) A data file with path;  either a data frame or a fileName must be provided. "/" is used on Macs in the file pathname; "/"
                            changes to "\\" on PCs.
data:             (optional) An array of data;  either a data frame object or a fileName must be provided
colNames:     Specific column names are required by the program:  PR, MESOR, Amp, Phi (case insensitive).  Must be specified if column
                            headers are absent, or if you wish to rename columns. 
GrpID:          (required)  a vector of column names (or numbers) referring to factors to be used for comparing populations among levels (group
                            identifiers) within each factor (GrpID).  There must be at least 2 levels in any GrpID column, as a PMC test compares
                            parameters between two or more populations.  Populations are compared among all levels, as well as all level pairs, for each
                            factor (GrpID).  If multiple GrpIDs are specified, corresponding to multiple factors, comparisons are performed within each
                            factor separately -- populations from one GrpID are not compared to populations from a different GrpID.
VarID:          (optional) a single column can be included as a Variable.  There must be at least 2 unique names in any VarID column.  All
                            population comparisons defined under GrpID are performed separately for each level in VarID.  A column would be specified
                            as a VarID if it makes no sense to combine multiple levels (values) for PMC -- such as combining temperature with blood
                            pressure, or rhythm parameters related to different trial periods. 
alpha:           significance level (p) for testing  (default = .05)
header:         does the file have a header? (default = FALSE);  column headers are used as column names unless colNames is used
sep:               is the file tab delimited ("\t") or comma delimited (",")  (default = "\t")
Output:         Doc=TRUE will output an RTF file;  Doc=FALSE will not.  Output is always sent to the console
functionName:  a short descriptor, this will be used as a part of the file name for use in identifying output
title:              A longer text descriptor.  This is printed out in the header of the result file as a Title.

Input Data:

The PMCtest uses the parameters resulting from a single- or multiple-component single cosinor as input.

Data format:  Comma or tab delimited file.  There are four required column headers, one optional VarID (variable) column, and one or more GrpID (factor) columns:   
PR, MESOR, Amp, Phi, variable, factor1, factor2, ....

Output:

Data Format:  An .rtf data file is written to the same file path where the data file is found.

Returned:  An output data frame is returned from the function call, and printed to the console.
©Copyright June 2013, Cathy Lee Gierke