How can you model data with a linear function?

find a line that fits the observed data closely. Read up on least-squares fitting.