Hello,
I need assistance with a linear regression code I am working. Essentially, I am trying to predict how many positive cases will occur the next week based on number of labs performed in previous weeks. Example:
Week_Start Laboratory. Labs_Performed Number_of_Positive_Cases
11/04/2018. Lab1. 230 31
11/04/2018. Lab2. 300. 40
11/11/2018. Lab1. 260 45
11/11/2018. Lab2. 325. 46
I have a lot more variables than this. How would I go about doing a linear regression for just lab1 values and another linear regression with just lab2 values for the next week (week start 11/18/2018)?
Thank you for any help you can give!
@pauliet987 wrote:
I am trying to predict the number of positive cases from all the previous weeks labs performed. This would go back about 6 months.
This seems like a time series model, rather than a linear regression. To perform a linear regression, the number of previous weeks used in the prediction would have to be the same for every record, and that is not the case, based on your statement above.
@pauliet987 wrote:
Hello,
I need assistance with a linear regression code I am working. Essentially, I am trying to predict how many positive cases will occur the next week based on number of labs performed in previous weeks. Example:
Week_Start Laboratory. Labs_Performed Number_of_Positive_Cases
11/04/2018. Lab1. 230 31
11/04/2018. Lab2. 300. 40
11/11/2018. Lab1. 260 45
11/11/2018. Lab2. 325. 46
I have a lot more variables than this. How would I go about doing a linear regression for just lab1 values and another linear regression with just lab2 values for the next week (week start 11/18/2018)?
Thank you for any help you can give!
I think some clarification would be helpful.
Are you trying to predict the number of positive cases for 11/18/2018 using just labs performed in the week of 11/11/2018? Or does the prediction depend on both 11/04/2018 and 11/11/2018? How far back in time do we use the number of labs performed to get a prediction?
Why linear regression and not some sort of time series?
I am trying to predict the number of positive cases from all the previous weeks labs performed. This would go back about 6 months.
@pauliet987 wrote:
I am trying to predict the number of positive cases from all the previous weeks labs performed. This would go back about 6 months.
This seems like a time series model, rather than a linear regression. To perform a linear regression, the number of previous weeks used in the prediction would have to be the same for every record, and that is not the case, based on your statement above.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.