Describe a fictional example and generate a small data set in which data are heteroscedastic and you need to apply a GLS.
given that
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
> set.seed(123)
> income<-seq(1000,10000,100)
> food_expense <- rnorm(n=91, mean=0.2*income, sd=0.4* income)
> plot(income,food_expense)
and here is the plot.
Get Answers For Free
Most questions answered within 1 hours.