@Arthur Tabachneck, My original data set has more than 2000 observations. After I saw your message, I checked your codes and Nadeem's codes for my data set. But I couldn't see wrong values 1st record of the 2nd through Nth by groups.
... View more
Hi everyone. I have a data set and I attached it to my message. You can see it below. I want to calculate bolt_volume. It looks simple but I couldn't get correct results. The formula has already written in excel sheet. bolt_volume[row2] = ( bolt_area[row1] + bolt_area[row2] ) / 2 * bolt_len[row2] bolt_volume[row3] = ( bolt_area[row2] + bolt_area[row3] ) / 2 * bolt_len[row3] ........... tree_no bolt_no bolt_len bolt_area bolt_volume 1 1.235344635 1 1 2 0.89358336 2.128927995 1 2 2 0.821784859 1.715368219 2 0.346877809 2 1 2 0.276875719 0.623753528 2 2 2 0.226900035 0.503775754 3 0.294638715 3 1 2 0.193085235 0.48772395 3 2 2 0.185057629 0.378142864 Thank you for your help.
... View more
I found a mistake on my first post. I am sorry for that and thanks for your understanding. How can I get to the totvol_dob variable from cumvol_dob as shown below? tree_no bolt_no cumvol_dob totvol_dob 1 5.849161048 1 1 2.128927995 5.849161048 1 2 3.844296214 5.849161048 1 3 5.849161048 5.849161048 2 1.127529281 2 1 0.623753528 1.127529281 2 2 1.127529281 1.127529281 3 1.316750698 3 1 0.48772395 1.316750698 3 2 0.865866814 1.316750698 3 3 1.316750698 1.316750698
... View more
I have a table with tree_no, cumvol_dob variables. I would like to know how to get the totvol_dob variable from cumvol_dob by tree_no in data step. Any feedback would be greatly appreciated. Thank you for your help.
... View more