I have a database with information from 358 observations from 10 different schools. There are 4 variables: student ID, school ID, student performance and student study hours.

I generated a scatterplot between student performance and student study hours, using the command:
twoway scatter performance hours

However, I would like to plot a scatterplot between the variables performance and hours of study, but with a trend line for each of the schools and different colors for each point cloud for each school. Like this:

Help me, please?
I generated a scatterplot between student performance and student study hours, using the command:
twoway scatter performance hours
However, I would like to plot a scatterplot between the variables performance and hours of study, but with a trend line for each of the schools and different colors for each point cloud for each school. Like this:
Help me, please?
Comment