Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 204922

How do I run a linear regression between certain observations in a data set?

$
0
0

my problem is that I am unable to run a linear regression between say the 450th and 500th observations of NBA salaries (the salaries only in the year 18/19 in my continuous data set).

So far I have this code:

 lm(log(Salary) ~ Twitter + Insta + Age + PPG + APG + RPG + SPG + 
       BPG + MPPG + FG + THREEPG + FT, 
       data = subset(Econ_III_Data_Set1, Year = 18/19))

But it is giving the same results as it would if I ran a linear regression on all salaries, not just the ones in the year 18/19 (or the 450th to 500th observations of salaries).


Viewing all articles
Browse latest Browse all 204922

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>