1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tool_pdata.frame.R
\name{is.pbalanced}
\alias{is.pbalanced}
\alias{is.pbalanced.default}
\alias{is.pbalanced.data.frame}
\alias{is.pbalanced.pdata.frame}
\alias{is.pbalanced.pseries}
\alias{is.pbalanced.pggls}
\alias{is.pbalanced.pcce}
\alias{is.pbalanced.pmg}
\alias{is.pbalanced.pgmm}
\alias{is.pbalanced.panelmodel}
\title{Check if data are balanced}
\usage{
is.pbalanced(x, ...)
\method{is.pbalanced}{default}(x, y, ...)
\method{is.pbalanced}{data.frame}(x, index = NULL, ...)
\method{is.pbalanced}{pdata.frame}(x, ...)
\method{is.pbalanced}{pseries}(x, ...)
\method{is.pbalanced}{pggls}(x, ...)
\method{is.pbalanced}{pcce}(x, ...)
\method{is.pbalanced}{pmg}(x, ...)
\method{is.pbalanced}{pgmm}(x, ...)
\method{is.pbalanced}{panelmodel}(x, ...)
}
\arguments{
\item{x}{an object of class \code{pdata.frame}, \code{data.frame},
\code{pseries}, \code{panelmodel}, or \code{pgmm},}
\item{\dots}{further arguments.}
\item{y}{(only in default method) the time index variable (2nd index
variable),}
\item{index}{only relevant for \code{data.frame} interface; if
\code{NULL}, the first two columns of the data.frame are
assumed to be the index variables; if not \code{NULL}, both
dimensions ('individual', 'time') need to be specified by
\code{index} as character of length 2 for data frames, for
further details see \code{\link[=pdata.frame]{pdata.frame()}},}
}
\value{
A logical indicating whether the data associated with
object \code{x} are balanced (\code{TRUE}) or not
(\code{FALSE}).
}
\description{
This function checks if the data are balanced, i.e., if each individual has
the same time periods
}
\details{
Balanced data are data for which each individual has the same time periods.
The returned values of the \code{is.pbalanced(object)} methods are identical
to \code{pdim(object)$balanced}. \code{is.pbalanced} is provided as a short
cut and is faster than \code{pdim(object)$balanced} because it avoids those
computations performed by \code{pdim} which are unnecessary to determine the
balancedness of the data.
}
\examples{
# take balanced data and make it unbalanced
# by deletion of 2nd row (2nd time period for first individual)
data("Grunfeld", package = "plm")
Grunfeld_missing_period <- Grunfeld[-2, ]
is.pbalanced(Grunfeld_missing_period) # check if balanced: FALSE
pdim(Grunfeld_missing_period)$balanced # same
# pdata.frame interface
pGrunfeld_missing_period <- pdata.frame(Grunfeld_missing_period)
is.pbalanced(Grunfeld_missing_period)
# pseries interface
is.pbalanced(pGrunfeld_missing_period$inv)
}
\seealso{
\code{\link[=punbalancedness]{punbalancedness()}} for two measures of
unbalancedness, \code{\link[=make.pbalanced]{make.pbalanced()}} to make data
balanced; \code{\link[=is.pconsecutive]{is.pconsecutive()}} to check if data are
consecutive; \code{\link[=make.pconsecutive]{make.pconsecutive()}} to make data
consecutive (and, optionally, also balanced).\cr
\code{\link[=pdim]{pdim()}} to check the dimensions of a 'pdata.frame'
(and other objects), \code{\link[=pvar]{pvar()}} to check for individual
and time variation of a 'pdata.frame' (and other objects),
\code{\link[=pseries]{pseries()}}, \code{\link[=data.frame]{data.frame()}},
\code{\link[=pdata.frame]{pdata.frame()}}.
}
\keyword{attribute}
|