medianData: Calculate the data median

Description Usage Arguments Value Author(s) Examples

View source: R/medianData.R

Description

Calculates the mean or median value of a response within a replicate for every replicate within a treatment.

Usage

1
2
medianData(Data, Treatment, Response, Replicate)
averageData(Data, Treatment, Response, Replicate)

Arguments

Data

A data set.

Treatment

The name (as a string) of the treatment variable.

Response

The name (as a string) of the response variable.

Replicate

The name (as a string) of the replicate variable.

Value

Returns a data set containing mean or median values for every replicate and treatment.

Author(s)

Joe Swintek

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
	#Data 
		data(lengthWeightData)
	#Subset the data
		SubData<-lengthWeightData[lengthWeightData$Age=='8 week', ] 
		SubData<-SubData[SubData$Generation=='F1', ]
		SubData<-SubData[SubData$SEX=='M', ]
	#Run 	
	medianData(Data=SubData, Treatment='Treatment', Response='WEIGHT',
		Replicate='Replicate')
	averageData(Data=SubData, Treatment='Treatment', Response='WEIGHT',
		Replicate='Replicate')

StatCharrms documentation built on June 10, 2018, 5:04 p.m.