What if I need to calculate the variance for the fuel data? Are there a 'R' way to do that? I have derived variance = (Y-x*theta)^T * (Y - x*theta) / (n-p)