Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

groupedData

Table-like collection of data and metadata

Description

The groupedData object is a table-like object that supports all the methods and properties of table and has two additional properties to identify the independent variable and an optional grouping variable.

It also has additional methods that let you create doses from data set containing dosing data and convert a groupedData object to a table.

Creation

Syntax

grpData = groupedData
grpData = groupedData(tbl)
grpData = groupedData(tbl,groupVarName)
grpData = groupedData(tbl,groupVarName,independentVarName)

Description

example

grpData = groupedData creates an empty groupedData object.

example

grpData = groupedData(tbl) creates a groupedData object by copying a table or dataset object tbl. The GroupVariableName and IndependentVariableName properties of the grpData object are implicitly determined by looking for the first case-insensitive match to a list of variable names of tbl (tbl.Properties.VariableNames). For the grouping variable, the list of names is ID, Group, I, and Run. For the independent variable, the list of names is Time, T, and IDV. If there are no matches, GroupVariableName and IndependentVariableName are set to empty character vectors.

example

grpData = groupedData(tbl,groupVarName) sets the GroupVariableName property of the grpData object to groupVarName. The IndependentVariableName property is implicitly set as in the previous syntax.

example

grpData = groupedData(tbl,groupVarName,independentVarName) additionally sets the IndependentVariableName property of the grpData object to independentVarName.

Input Arguments

expand all

Data, specified as a table or dataset.

Grouping variable name, specified as a character vector. An empty character vector '' indicates that there is no group variable.

Independent variable name, specified as a character vector. An empty character vector '' indicates that there is no independent variable.

Output Arguments

expand all

Grouped data, returned as a groupedData object.

Properties

expand all

The groupedData object supports all properties of table and provides the following additional properties.

Name of the grouping variable that indicates the groups in the data, specified as a character vector. To indicate that there are no groups (or just one group), set the property to the empty character vector ''.

Example: 'ID'

Name of the independent variable in the data such as time, specified as a character vector.

Example: 'TIME'

Object Functions

The groupedData object supports all methods of table and provides the following additional methods.

createDosesCreate dose objects from groupedData object
groupedData2tableConvert groupedData object to table

Examples

expand all

Load the sample data set.

load pheno.mat ds

Create a groupedData object from the data set ds.

grpData = groupedData(ds);

Display the object properties.

grpData.Properties
ans = 

  struct with fields:

                Description: ''
                   UserData: []
             DimensionNames: {'Observations'  'Variables'}
              VariableNames: {'ID'  'TIME'  'DOSE'  'WEIGHT'  'APGAR'  'CONC'}
       VariableDescriptions: {}
              VariableUnits: {}
         VariableContinuity: []
                   RowNames: {}
          GroupVariableName: 'ID'
    IndependentVariableName: 'TIME'

GroupVariableName and IndpendentVariableName have been automatically assigned to 'ID' and 'Time', respectively.

Introduced in R2014a

Was this topic helpful?