Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update figure in Readme #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ This study aimed at characterizing the rest-activity patterns in the general pop

## Findings

* Four distinct rest-activity profiles were identified to describe aspects of overall amplitude, early rising time, prolonged daytime activity and biphasic pattern. [insert the profiles figure here. need access to upload figure]
* Four distinct rest-activity profiles were identified to describe aspects of overall amplitude, early rising time, prolonged daytime activity and biphasic pattern.
![fPCs](image/fPCs.png)
* Rest-activity profiles are highly associated with age, race, education levels and household income levels.
* Rest-activity profiles differ on weekdays and weekends by demographics and socioeconomics.
* Lower overall activity is associated with higher odds of self-reported poor or fair health.
Expand All @@ -25,7 +26,7 @@ This study aimed at characterizing the rest-activity patterns in the general pop
In a nationally representative sample of US adults, we identified four distinct profiles for the 24-h rest-activity cycle. We found considerable variation in these profiles across different subgroups by age, gender, race/ethnicity, SES and work status. We also observed associations between rest-activity profiles and self-rated health status.

## Data
A sample data of 50 randomly selected subjects from NHANES 2011-2014 with accelerometer data can be found [here](NHANES_sample_data.rds).
A sample data of 50 randomly selected subjects from NHANES 2011-2014 with accelerometer data can be found [here](data/NHANES_sample_data.rds).

This dataset includes the following variables:
- SEQN
Expand All @@ -36,13 +37,13 @@ This dataset includes the following variables:

## Codes

The main code to run fpca analysis on the sample data can be found [here](fPCA_analysis.R)
The main code to run fpca analysis on the sample data can be found [here](code/fPCA_analysis.R)

R function to [plot a functional object](plot_fd_new1.R)
R function to [plot a functional object](code/plot_fd_new1.R)
- code adapted from plot.fd{fda}
- changes are made to present labels of xasis as clock time

R function to generate Figure 1 in the published paper of [functional principal components](plot_fpca_new1.R)
R function to generate Figure 1 in the published paper of [functional principal components](code/plot_fpca_new1.R)
- code adapted from plot.pca.fd{fda}
- add argument 'flip' to decide which component(s) to have sign(s) flipped ('+' to '-' or vice versa)
- use different colors to represent component's sign
Expand Down
File renamed without changes.
File renamed without changes.
Loading