File: pdim.Rd

package info (click to toggle)
r-cran-plm 2.6-2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,032 kB
  • sloc: sh: 13; makefile: 4
file content (121 lines) | stat: -rw-r--r-- 3,576 bytes parent folder | download
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tool_pdata.frame.R
\name{pdim}
\alias{pdim}
\alias{pdim.default}
\alias{pdim.data.frame}
\alias{pdim.pdata.frame}
\alias{pdim.pseries}
\alias{pdim.pggls}
\alias{pdim.pcce}
\alias{pdim.pmg}
\alias{pdim.pgmm}
\alias{pdim.panelmodel}
\alias{print.pdim}
\title{Check for the Dimensions of the Panel}
\usage{
pdim(x, ...)

\method{pdim}{default}(x, y, ...)

\method{pdim}{data.frame}(x, index = NULL, ...)

\method{pdim}{pdata.frame}(x, ...)

\method{pdim}{pseries}(x, ...)

\method{pdim}{pggls}(x, ...)

\method{pdim}{pcce}(x, ...)

\method{pdim}{pmg}(x, ...)

\method{pdim}{pgmm}(x, ...)

\method{pdim}{panelmodel}(x, ...)

\method{print}{pdim}(x, ...)
}
\arguments{
\item{x}{a \code{data.frame}, a \code{pdata.frame}, a \code{pseries}, a
\code{panelmodel}, or a \code{pgmm} object,}

\item{\dots}{further arguments.}

\item{y}{a vector,}

\item{index}{see \code{\link[=pdata.frame]{pdata.frame()}},}
}
\value{
An object of class \code{pdim} containing the following
elements:

\item{nT}{a list containing \code{n}, the number of individuals, \code{T},
the number of time observations, \code{N} the total number of
observations,}

\item{Tint}{a list containing two vectors (of type integer): \code{Ti}
gives the number of observations for each individual and \code{nt} gives
the number of individuals observed for each period,}

\item{balanced}{a logical value: \code{TRUE} for a balanced panel,
\code{FALSE} for an unbalanced panel,}

\item{panel.names}{a list of character vectors: \code{id.names} contains
the names of each individual and \code{time.names} contains the names of
each period.}
}
\description{
This function checks the number of individuals and time observations in the
panel and whether it is balanced or not.
}
\details{
\code{pdim} is called by the estimation functions and can be also used
stand-alone.
}
\note{
Calling \code{pdim} on an estimated \code{panelmodel} object
and on the corresponding \verb{(p)data.frame} used for this
estimation does not necessarily yield the same result. When
called on an estimated \code{panelmodel}, the number of
observations (individual, time) actually used for model
estimation are taken into account.  When called on a
\verb{(p)data.frame}, the rows in the \verb{(p)data.frame} are
considered, disregarding any \code{NA}values in the dependent or
independent variable(s) which would be dropped during model
estimation.
}
\examples{

# There are 595 individuals
data("Wages", package = "plm")
pdim(Wages, 595)

# Gasoline contains two variables which are individual and time
# indexes and are the first two variables
data("Gasoline", package="plm")
pdim(Gasoline)

# Hedonic is an unbalanced panel, townid is the individual index
data("Hedonic", package = "plm")
pdim(Hedonic, "townid")

# An example of the panelmodel method
data("Produc", package = "plm")
z <- plm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp,data=Produc,
         model="random", subset = gsp > 5000)
pdim(z)

}
\seealso{
\code{\link[=is.pbalanced]{is.pbalanced()}} to just determine balancedness
of data (slightly faster than \code{pdim}),\cr
\code{\link[=punbalancedness]{punbalancedness()}} for measures of
unbalancedness,\cr \code{\link[=nobs]{nobs()}},
\code{\link[=pdata.frame]{pdata.frame()}},\cr \code{\link[=pvar]{pvar()}} to check for
each variable if it varies cross-sectionally and over time.
}
\author{
Yves Croissant
}
\keyword{attribute}