z_score {GCalcium}R Documentation

Transform values into z scores

Description

'z_score' transforms input values to z scores. Allows user input of mu and sigma values for comparing distributions.

Usage

z_score(xvals, mu = FALSE, sigma = FALSE)

Arguments

xvals

vector of numbers

mu

the population mean

sigma

the population standard deviation

Value

a numeric vector of z scores

Examples

# Format data
df.new <- format_data(GCaMP)

# Split data
basevals <- df.new$Trial1[df.new$Time <= 0]
eventvals <- df.new$Trial1[df.new$Time > 0]

# Find baseline (pre-epoc) values
base.mu <- mean(basevals)
base.sigma <- sd(basevals)

# Compute values
z_score(x = eventvals, mu = base.mu, sigma = base.sigma)

[Package GCalcium version 1.0.0 Index]