In: Statistics and Probability
Describe a fictional example and generate a small data set in which data are heteroscedastic and you need to apply a GLS.
One example is when the independent variable is the monthly income of a person in $ and the dependent variable is the expenses on food. We think that in general as the income of a person increases he tends to use more money on food expenses with significant variability. The following is illustrated via the plot shown below.
The R code
And here is the plot