Dear All,
Good day. Hope you all are well. For my research purpose I am doing Linear mixed model. However, my data's are in wide format. I need to convert them into long format. My data are in the following format. The story is some tree species diameter was measure in different time period for some permanent plot. One species has one or more observation.
Plot ID Spp Code 1977 1982 1987 1997 2014 Succesional group
1 NKR 15.7 16.7 18 21.7 32 late
1 NKR 26.1 27.9 28.8 30.9 41.1 late
1 CMH 10.4 10.5 11.3 11.7 12.5 late
1 CMH 10.5 10.8 10.9 11.4 11.8 late
1 CNN 11.2 11.4 11.5 11.6 late
1 CNN 11.7 12 12 late
1 CNN 20.2 20.3 late
1 CNN 20.5 21 21.2 21.4 late
1 CNN 11.1 12.5 14.2 16.9 late
1 CNN 21.3 24.2 26.1 30 34.2 late
I am also attaching you my dataset. Plot ID means simply plot ID (I have 2 plot), Species code (Spp code), measurement of tree diameter in different time period and successional group for each species. I want year as a variable and also diameter as variable. So after restructure the data will look like this:
Plot ID Spp Code Year DBH Succesional group
1 NKR 1977 18.7 late
1 NKR 1977 32.7 pioneer
1 CMH 1987 21.3 mature
2 CMH 2014 10.6 late
2 CNN 1982 18 early
2 CNN 1997 33.1 mature
Can you please help me how to do this. I will be really greatful to you if you can suggest me something. Thanks and will be waiting for your kind response.
Note to the excel file: The valued from J:N is just an example what should It look like after restructure data from A:H
Kind Regards
Sohel
Bookmarks