The package contains 2 functions to obtain weights to use in wls for popular versions of feasible weighted least squares. In addition it performs Goldfeld - Quandt heteroskedasticity test. It includes 5 public functions. Test: gqtest(), GUI_gqtest(), gqtest_print(). Wls-helpers: clustweights(), expweights() The main reason for this package is pedagogical. There are plethora of books "Using Soft (e.g., Stata, Eviews, Excel) with Hill Griffiths Lim". And there exists a possibility of someone making an opinion of a piece of software by comparing how simple is to solve computer exercises in it. The package contains two functions to compute clustered and exponential weights for further use with wls. Additionally, the package allows testing group-wise heteroskedasticity as in HGL, 4-th, 8.2.3. As Prof. Riccardo Lucchetti wrote: "Nobody uses this test anymore in serious empirical research, and it's rapidly disappearing from textbooks as well." But the package author thinks it can be useful for the courses relying upon HGL. FUNCTIONS DESCRIPTION function matrix gqtest (series y "the dependent var", list xl "independent vars, include 'const', if required", series sby[null] "variable to sort by", scalar c[0:1:NA]) "fraction of middle obs. to omit") Outputs a 1 by 4 matrix: F-statistics, 2 degrees of freedom, and 2-sided p-value. Always prints the results. This function doesn't support panel data. Parameters: c - must be in (0,1), for the only exception see below, fraction of the sample to omit; default is 1/3 sby - variable to sort observations by if 'sby' is dummy, 'c' is ignored, the sample split rule is 0/1 if 'sby' is integer variable with 3 distinct values, and c=1 sby is used for idiosyncratic splitting of the sample with observations, corresponding to the middle value omitted. if 'sby' = 'const', observations are not sorted, as in time series setting. if sby is missed, it is set as 'const' Usage: nulldata 24 series y = normal(0,1) x1 = normal(0,1) x2 = normal(0,1) series qwerty = normal(0,1) list xl = 0 x1 x2 d = (obs>14) dd = (obs<6)+2*(obs>16) gqtest(y,xl) # data sorted by y; middle 1/3 omitted gqtest(y,xl,qwerty) # data sorted by qwerty; middle 1/3 omitted gqtest(y,xl,const) # data unsorted ; middle 1/3 omitted gqtest(y,xl,d) # 'c' ignored gqtest(y,xl,dd,1) # obs. with middle values of dd omitted function bundle GUI_gqtest (series sby[null] "variable to sort by", scalar c[NA] "fraction of middle obs. to omit") GUI path: model window (ols)-> tests The GUI version omits 2 first arguments in comparison with script version, since the dependent variable and regressors are the same as in the estimated model. function void gqtest_print (bundle *b) A helper to GUI version: the script version outputs a matrix and prints the results by default. This function doesn't support panel data. function series clustweights (series y "the dependent variable", list xlist "independent variables", series clustvar "cluster variable") Computes weights series to use in wls estimation for grouped data, as described in POE-4, s. 8.4.2. Example (datafile from POE-4): open cps2.gdt list xlist = 0 educ exper metro w = clustweights (wage, xlist, metro) wls w wage xlist function series expweights (series y "the dependent variable", list xlist "independent variables", list zlist[null] "sd vars, null: logs xlist, zlist=xlist==hsk") Computes weights series to use in wls estimation according to the following model for variance: log(sigma_i^2) = const + z'_i*alpha See, e.g POE-4, s. 8.5. zlist = null means zlist = log(xlist), if possible Example (datafile from POE-4): variables in the variance model are the logarithms of the original regression variables open food.gdt list xlist = 0 income series wtb = expweights(food_exp, xlist) wls wtb food_exp 0 income List of abbreviations POE - gretl data set to Principles of Econometrics. HGL, POE-4 - Hill, Griffiths, Lim - Principles of Econometrics - Fourth Edition. NEWS in 0.3 Printing pvalues for one-sided alternatives added to qgtest 2 new functions added: clustweights(), expweights(). NEWS in 0.38 Type of sby in qtest() changed to series. Some changes in help file.