% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/grs.R
\name{grs_standardize}
\alias{grs_standardize}
\alias{grs_zscore}
\title{Standardise GRS columns by Z-score transformation}
\usage{
grs_standardize(data, grs_cols = NULL)

grs_zscore(data, grs_cols = NULL)
}
\arguments{
\item{data}{A \code{data.frame} or \code{data.table} containing at least
one GRS column.}

\item{grs_cols}{Character vector of column names to standardise.
If \code{NULL} (default), all columns whose names contain \code{"grs"}
(case-insensitive) are selected automatically.}
}
\value{
The input \code{data} as a \code{data.table} with one additional
\code{_z} column per GRS column appended after its source column.
}
\description{
Adds a \code{_z} column for every selected GRS column:
\code{z = (x - mean(x)) / sd(x)}.  The original columns are kept
unchanged.  \code{\link{grs_zscore}} is an alias for this function.
}
\examples{
dt <- data.frame(
  IID   = 1:5,
  GRS_a = c(0.12, 0.34, 0.56, 0.23, 0.45),
  GRS_b = c(1.1,  0.9,  1.3,  0.8,  1.0)
)
grs_standardize(dt)
grs_zscore(dt)   # identical
}
