I am trying to find the standard deviation for my dataset groupwise (from AE to AE) which looks somewhat like this:
ID Pay_ee Pay_em Post
1 100 102 AE
1 105 112 RE
1 103 112 RE
1 106 123 RE
1 101 121 RE
1 109 143 AE
1 110 113 ME
1 115 132 RE
1 123 120 AE
1 100 120 AE
1 100 120 RE
I used ggplot for plotting pay_ee and pay_em. Now I am having difficulty in representing the standard deviation in my ggplot from one AE to other AE. which means I have to first calculate the standard deviation from one AE to next AE. and then plot it in my ggplot.
I tried to refer this link answer but the problem it's been done for the whole dataset.
Do you have any idea how can I do it?