Learn R Programming

GCalcium (version 1.0.0)

z_score: 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

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab