Quantcast
Viewing all articles
Browse latest Browse all 206316

Can I use R to only analyze data past a certain date?

I have an excel sheet that I imported into RStudio which contains data for every subject of a certain population. Each subject has their own set of data with corresponding dates, but I only want to look at the data and perform statistical analyses on the dates past a unique date for each subject.

I'm assuming I can use the split function to create smaller dataframes, with each corresponding to that of each subject, and then use some function to analyze the data in a loop to run on all of the smaller dataframes I created from the split.

Some of these subjects with have over 1000 data points. My two main questions are:

1) Is there a function I can use to analyze the data for each subject past a specific unique date to each subject?

2) Is the strategy I proposed above a viable one?

I unfortunately have very little experience in data analyses or extensive any background in computer science. Thanks for any help.

Edit: So there was a request about the type of data I was talking about. I was wondering if I had data similar to this, could I still use the above strategy. Where P1 and P2 have their own data sets that I want to analyze after the TxDate.

>data
1           Date     BMI    Glucose    Cholesterol    TxDate    
2 P1                                                  3/3/15
3           12/1/14  24     145        99  
4           3/18/15  26     123        101          
5           4/21/15  28     111        85      
6           6/2/15   25     133        90         
7          
8
9 P2                                                  4/6/16
10          1/3/16   33     145        200
11          3/30/16  31     162        178
12          5/13/16  34     190        134
13          6/12/16  34     183        168
14          7/9/16   35     200        189
15          9/10/16  31     175        190
16          11/23/17 27     121        120
17
18


Viewing all articles
Browse latest Browse all 206316

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>