FPCA Procedure
Example 11.2 Berkeley Growth Study Data
This example applies the FPCA procedure to real-world data. The data come from the Berkeley Growth Study, which took the height measurements of 93 children as part of a longitudinal study of children’s physical development that was conducted in California. Each observation in the growth_curves data set corresponds to a time point (in years), and each column from y1 to y93 represents an individual child’s growth trajectory over 31 time points, as stored in the variable _TIMEPOINTS_. The data set is publicly available as part of the fda R package for functional data analysis and can also be accessed through the scikit-fda Python package. The data that this example uses are derived from Tuddenham and Snyder (1954).[3]
This following DATA step creates a data table named growth_curves that contains the Berkeley Growth Study functional data, where each row represents a time point and each column (y1 to y93) represents a subject’s measurement at that time point. The _TIMEPOINTS_ variable stores the time value for each row, and the data are entered directly by using the DATALINES statement.
data growth_curves;
input _TIMEPOINTS_ y1-y93;
datalines;
1.0 81.3 76.2 76.8 74.1 74.2 76.8 72.4 73.8 75.4
78.8 76.9 81.6 78.0 76.4 76.4 76.2 75.0 79.7 70.0
... more lines ...
You can load the growth_curves data table into your SAS library and by using your libref in the first statement of the following DATA step.
data mylib.growth;
set growth_curves;
run;
You use the following PROC FPCA statements to extract the dominant modes of variation in the growth curves by using 10 smoothing bins:
proc fpca data=mylib.growth nBins=10;
input y1-y93;
output out=mylib.score_fpca npc=4;
savestate rstore=mylib.state_fpca;
run;
The OUTPUT statement generates the scores of each child’s growth curve on the first four functional principal components. The SAVESTATE statement creates an analytic store that you can use later with the FPCASCORE procedure to score new observations by using the same FPCA model.
A downstream analysis task, such as visualizing the first two principal components by gender, is demonstrated in the documentation of PROC FPCASCORE. For more information, see Chapter 12, FPCASCORE Procedure.
[3] Disclaimer: SAS may reference other websites or content or resources for use at Customer’s sole discretion. SAS has no control over any websites or resources that are provided by companies or persons other than SAS. Customer acknowledges and agrees that SAS is not responsible for the availability or use of any such external sites or resources, and does not endorse any advertising, products, or other materials on or available from such websites or resources. Customer acknowledges and agrees that SAS is not liable for any loss or damage that may be incurred by Customer or its end users as a result of the availability or use of those external sites or resources, or as a result of any reliance placed by Customer or its end users on the completeness, accuracy, or existence of any advertising, products, or other materials on, or available from, such websites or resources.