CATparam: Population-mean Cosinor Test (PMCtest)

Description Usage Arguments Input Data: Output: Author(s) References Examples

View source: R/CATparam.R

Description

Statistical test performed on the output parameters from the PMC, testing the equality of rhythm parameters (MESOR, Amplitude, Acrophase) from two or more populations, considered singly or (Amplitude, Acrophase) jointly.

Usage

1
2
3
CATparam(data, fileName, colNames, GrpID = NA, VarID = NA, alpha = 0.05, 
       header=FALSE, sep="\t", Output=list(Doc=TRUE, Txt=FALSE), 
       functionName="", title="")

Arguments

data

(optional) An array of data; either a data frame object or a fileName must be provided

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.

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 identified by one GrpID are not compared to populations identified by 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 = TRUE); 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 printed out in the header of the result file.

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.

Author(s)

Cathy Lee Gierke, Germaine Cornelissen-Guillaume

Maintainer: Cathy Lee Gierke <leegi001@umn.edu>

References

http://564394709114639785.weebly.com/running-cat-PMCtest.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
                # Data is from east Indian subjects:  lipids, smoking, diet, gender, age group
                #        every 6 hours.
                #---------------------  Vignette5    Population-Mean Cosinor Parameter test
                # testing equivalency of parameters from the Population Mean Cosinor
                # according to behavioral factors and lipids for a population of subjects

                #  Normally you would use these lines to read a file for use in CATkit 
                #        (use filePath format for your OS)
                # filePath<-"~/file/path/Installing CAT/Vignette4"          # use for mac
                # filePath<-"c:\file\path\Installing CAT\Vignette4"     # use for PC
                # fileName<-file.path(filePath,'cos02x03.csv')
                
                # this line is used instead of the above since it is part of a package.
                file.copy(system.file("extdata", "cos02x03.csv", package = "CATkit"), 
                    tempdir(), overwrite = TRUE, recursive = FALSE, copy.mode = TRUE, 
                    copy.date = FALSE)
                filePath<-tempdir()
                fileName<-file.path(filePath,'cos02x03.csv')

                #fileName<-system.file("extdata", "cos02x03.csv", package = "CATkit")
                CATparam(fileName=fileName, VarID=8, GrpID=c(5,10),header=TRUE,
                sep=",",functionName="V8,G5,10", title="PMCtest V8,G5,10")
                

CATkit documentation built on May 2, 2019, 2:31 p.m.