MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/R/library/OREeda/doc/man/en/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/R/library/OREeda/doc/man/en/ore.corr.Rd

%
% Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. 
%
\name{ore.corr}
\alias{ore.corr}
\title{Oracle R Enterprise Correlation Analysis}
\description{
  Performs correlation analysis across numeric columns in
  \code{\link[OREbase:ore.frame-class]{ore.frame}} objects.
  Supports partial correlations with a control column specification and
  allows the specification of aggregations prior to computing
  correlations.
}
\usage{
  ore.corr(data, var, stats = "pearson", group.by = NULL, freq = NULL,
           with = NULL, weight = NULL, partial = NULL)
}
\arguments{
  \item{data}{An \code{\link[OREbase:ore.frame-class]{ore.frame}} object.}
  \item{var}{A comma-separated character string specifying the names of
    numeric columns within argument \code{data}.}
  \item{stats}{A character string specifying the correlation type; one
    of \code{"pearson"} (default), \code{"spearman"} or \code{"kendall"}.}
  \item{group.by}{An optional character vector specifying the group by
    column names within argument \code{data}.}
  \item{freq}{An optional character string specifying a numeric column
    within argument \code{data} to use as a frequency count. If a
    frequency value is less than 1 or missing, the observation is
    excluded from correlation calculation. If a frequency value is not
    an integer, it is truncated.}
  \item{with}{An optional character vector specifying the numeric columns
    in argument \code{data} to pair with columns specified in argument
    \code{var}. For example, with \code{var = c('x1','x2')} and
    \code{with = c('y1','y2','y3')}, function \code{ore.corr} will
    compute the following correlation pairs: \code{(x1, y1)},
    \code{(x1, y2)}, \code{(x1, y3)}, \code{(x2, y1)}, \code{(x2, y2)}
    and \code{(x2, y3)}.}
  \item{weight}{An optional character string specifying a numeric column
    within argument \code{data} to use as analytic weights.}
  \item{partial}{An optional character vector specifying the numeric
    columns within argument \code{data} to use as control variables for
    partial correlations.}
}
\value{
  When argument \code{group.by} is not specified, returns an
  \code{\link[OREbase:ore.frame-class]{ore.frame}} object.

  When argument \code{group.by} is specified, returns a list of
  \code{\link[OREbase:ore.frame-class]{ore.frame}} objects.
}
\references{
  \href{https://docs.oracle.com/cd/E57012_01/index.html}{Oracle R Enterprise}
}
\author{
  Oracle \email{oracle-r-enterprise@oracle.com}
}
\seealso{
  \code{\link[stats]{cor}}
}
\examples{
\dontshow{
if (!interactive())
    ore.connect(user     = Sys.getenv("ORE_USERNAME", "rquser"),
                sid      = Sys.getenv("ORACLE_SID"),
                host     = Sys.getenv("HOST"),
                password = Sys.getenv("ORE_PASSWORD", "rquser"),
                port  = if (.Platform$OS.type == "windows")
                           Sys.getenv("ORACLE_PORT")
                        else
                           Sys.getenv("TCPPORT"),
                all = TRUE)
}
  # Copy iris data set to the database
  IRIS <- ore.push(iris)

  # Pearson's correlation
  x <- cor(iris[,1:3])
  y <- ore.corr(IRIS, var = "Sepal.Length, Sepal.Width, Petal.Length")

  # Kendall's tau
  x <- cor(iris[,1:3], method = "kendall")
  y <-  ore.corr(IRIS, var = "Sepal.Length, Sepal.Width, Petal.Length",
                 stats = "kendall")

  # Partial correlation
  y <- ore.corr(IRIS, var = "Sepal.Length, Sepal.Width, Petal.Length",
                partial = "Petal.Width")

  # Group by partial correlation
  y <- ore.corr(IRIS, var = "Sepal.Length, Sepal.Width, Petal.Length",
                partial = "Petal.Width", group.by = "Species")
}
\keyword{multivariate}

OHA YOOOO