% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/freqdist1.R
\name{freqdist1}
\alias{freqdist1}
\title{Frequency distribution of univariate numeric data with case weight}
\usage{
freqdist1(
  x,
  weights = 1,
  npoints = 7,
  min = NULL,
  max = NULL,
  prob = 0,
  midpoints = NULL,
  wid = 6,
  dig = 1,
  maxf = NULL,
  title = NULL,
  digits = 3,
  print = 0,
  plot = 0
)
}
\arguments{
\item{x}{numeric vector or column vector}

\item{weights}{case weight
Can be a scalar, vector of size length(x) or matrix of length(x) x nf.\cr
If nf > 1, frequency for each column of weights will be calculated.}

\item{npoints}{# of mid-points}

\item{min}{minimum value of mid-points}

\item{max}{maximum value of mid-points}

\item{prob}{= 1 to return relative frequency in stead of frequency}

\item{midpoints}{vector of predefied mid-point values}

\item{wid}{Format of mid-point value (wid.dig)}

\item{dig}{Format of mid-point value (wid.dig)}

\item{maxf}{max value of frequency for plot}

\item{title}{tile to be used in plot}

\item{digits}{Format for mid-points}

\item{print}{= 1 to print result}

\item{plot}{= 1 to plot historgam}
}
\value{
A list consisting of\cr
  midpoints =  midpoints \cr
  freq =       column vector of frequency at midpoints \cr
  breaks =     breaks associated with the midpoints \cr
  class =      classification of each obs into the midpoints \cr
  nobs =       sum of case weights \cr
  error =      error flag
}
\description{
Frequency distribution of univariate numeric data with case weight
}
\details{
(npoints, min, max)  defines the mid-points. \cr
   If min or max is NULL, min(x) and max(x) will be used. \cr
   midpoints has priority over (npoints, min, max).\cr
The out of range observations,  that is, those x satisfying \cr
 x < midpoints[1]     or   midpoints[npoints] < x \cr
 will be be included in midpoints[1] and midpoints[npoints], resp. \cr
\cr
Try this to see how the obs on the border are classified. \cr
   xx=c(1,2,3,4,5,6,7) \cr
   brks=c(0,2,4,6,8) \cr
   cc=cut(xx,brks) \cr
}
\examples{
set.seed(1701)
n <- 10000
npoints <- 21
x <- rnorm(n)
res <- freqdist1( x, npoints=npoints,min=-3,max=3, print=1, plot=1 )
res1 <- freqdist1( x, midpoints=res$midpoints, print=1 )
weight=c(0,1,3,4,2,2,1)
freqdist1(seq(-3,3,1),weight, min=-3,max=3,npoints=7, print=1,plot=1)
rm(x)

}
