01-27-2017 07:16 PM
Hi I have a dataset (refer attached image). I have imported this data in SAS and want a procedure to determine a slope value (T vs Cn) for 3 samples. As shown in the imagefile. Can you please help me in achieving this.
Thank you in advance.
01-27-2017 08:21 PM
1. Create a grouping variable that allows you to group observations.
Use SUBSTR() function to extract a portion of a string variable, I think Sample in this case.
2. Sort the data explicitly by the variable in part 1. PROC SORT.
3. Run a PROC REG to determine the slope variables. Use OUTEST on PROC REG statement to store the estimated slopes per group into a data set that can then be merged into your previous data set.
PS. If you want help with code, provide sample data as text, not as an image. To generate code for you, that actually worked, would require typing out your data. On principle I generally don't do that anymore and many others don't either.
If you require further assistance post the code you've developed and the log indicating where you're having issues.
You can find how to instructional videos on various topics here: