public class PanelData<S,T extends Comparable<? super T>> extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
PanelData.Row
This is one row of the data in a panel.
|
static interface |
PanelData.Transformation
Transforms the data, e.g., taking log.
|
| Modifier | Constructor and Description |
|---|---|
protected |
PanelData(String subjectHeader,
String timeHeader,
String[] headers)
Constructs a panel of two-dimensional data.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRow(PanelData.Row row)
Inserts a row of data into the panel.
|
void |
addRow(S subject,
T time,
double... values)
Inserts a row of data into the panel.
|
List<S> |
getAllSubjects()
Gets the name of all subjects.
|
String[] |
getExtHeaders()
Gets the extended headers, including the subject and time headers.
|
String |
getExtHeadersString()
Gets the extended headers, including the subject and time headers.
|
double[][] |
getPanelValuesByHeaders(List<PanelData.Row> rows)
Gets the values from a panel data.
|
double[][] |
getPanelValuesByHeaders(List<PanelData.Row> rows,
String[] headers)
Gets the values from a panel data.
|
double[][] |
getPanelValuesByHeaders(List<PanelData.Row> rows,
String[] headers,
PanelData.Transformation[] transformations)
Gets the (transformed) values from a panel data.
|
double[][] |
getPanelValuesByTime(List<PanelData.Row> rows)
Gets the (transformed) values from a panel data.
|
double[][] |
getPanelValuesByTime(List<PanelData.Row> rows,
String[] headers,
PanelData.Transformation[] transformations)
Gets the (transformed) values from a panel data.
|
PanelData.Row |
getRow(S subject,
T time)
Gets one particular row indexed by a pair of subject and time.
|
List<PanelData.Row> |
getRows()
Gets all of the panel data.
|
List<PanelData.Row> |
getRowsForSubject(S subject)
Get all the rows pertaining to a particular subject.
|
String[] |
getValueHeaders()
Gets the headers, excluding the subject and time headers.
|
String |
getValueHeadersString()
Gets the headers, excluding the subject and time headers.
|
static <S> PanelData<S,Instant> |
instantPanelData(String subjectHeader,
String timeHeader,
String[] headers) |
boolean |
isBalanced()
Checks if the panel is balanced, i.e., all subjects have the same number
of observations (times).
|
static <S> PanelData<S,LocalDate> |
localDatePanelData(String subjectHeader,
String timeHeader,
String[] headers) |
static <S> PanelData<S,LocalDateTime> |
localDateTimePanelData(String subjectHeader,
String timeHeader,
String[] headers) |
int |
size()
Get the number of rows in the panel.
|
String |
toString() |
static <S> PanelData<S,YearMonth> |
yearMonthPanelData(String subjectHeader,
String timeHeader,
String[] headers) |
static <S> PanelData<S,Year> |
yearPanelData(String subjectHeader,
String timeHeader,
String[] headers) |
public static <S> PanelData<S,Year> yearPanelData(String subjectHeader, String timeHeader, String[] headers)
public static <S> PanelData<S,YearMonth> yearMonthPanelData(String subjectHeader, String timeHeader, String[] headers)
public static <S> PanelData<S,LocalDate> localDatePanelData(String subjectHeader, String timeHeader, String[] headers)
public static <S> PanelData<S,LocalDateTime> localDateTimePanelData(String subjectHeader, String timeHeader, String[] headers)
public static <S> PanelData<S,Instant> instantPanelData(String subjectHeader, String timeHeader, String[] headers)
public void addRow(S subject, T time, double... values)
subject - the subjecttime - the timevalues - the row datapublic void addRow(PanelData.Row row)
row - a rowpublic int size()
public boolean isBalanced()
true if the panel is balancedpublic String[] getExtHeaders()
public String getExtHeadersString()
public String[] getValueHeaders()
public String getValueHeadersString()
public List<PanelData.Row> getRows()
public List<PanelData.Row> getRowsForSubject(S subject)
subject - the subjectpublic PanelData.Row getRow(S subject, T time)
subject - the subjecttime - the timepublic List<S> getAllSubjects()
public double[][] getPanelValuesByHeaders(List<PanelData.Row> rows, String[] headers, PanelData.Transformation[] transformations)
rows - the panel dataheaders - the columns to be extractedtransformations - the transformation to be applied to the column
valuespublic double[][] getPanelValuesByHeaders(List<PanelData.Row> rows, String[] headers)
rows - the panel dataheaders - the columns to be extractedpublic double[][] getPanelValuesByHeaders(List<PanelData.Row> rows)
rows - the panel datapublic double[][] getPanelValuesByTime(List<PanelData.Row> rows)
rows - the panel datapublic double[][] getPanelValuesByTime(List<PanelData.Row> rows, String[] headers, PanelData.Transformation[] transformations)
rows - the panel dataheaders - the columns to be extractedtransformations - the transformation to be applied to the column
valuesCopyright © 2010-2026 NM Group. All Rights Reserved.