3/28/2023 0 Comments To regress to weights![]() ![]() If ‘drop’, any observations with nans are dropped. missing strĪvailable options are ‘none’, ‘drop’, and ‘raise’. If no weights are supplied theĭefault value is 1 and WLS results are the same as OLS. weights array_like, optionalĪ 1d array of weights. exog array_likeĪ nobs x k array where nobs is the number of observations and k Parameters : endog array_likeĪ 1-d endogenous response variable. To be transformed by 1/sqrt(W) you must supply weights = 1/W. The weights are presumed to be (proportional to) the inverse of WLS ( endog, exog, weights = 1.0, missing = 'none', hasconst = None, ** kwargs ) ¶ Note: This FAQ was inspired by several responses to a question on the _model.WLS ¶ class _model. Regardless of the method that we use, we obtain an F-ratio of 10.45 or a t-value We can use the test command after the svy: regress if we would like to get the F-ratio. The sign of the coefficient is different because above, the mean of the females Same coefficient and p-value that we did when we used the lincom command. To do this, simply include the single dichotomous predictor variable. The svy: regress command can also be used to compute the t-test. We can see from the output above that the means are not statisticallyĮquivalent. * stored by Stata after running the estimation command svy: mean. * The precise value of the t statistic can be obtained from the list of values We can see these labels by using the coeflegend option on the svy: mean command. To use the licom command, we need to know the labels that Stata has assigned to the values in the output. Notice that the p-value is the same as above, and that squaring the t-value yields the F-value shown above ( (-3.23)^2 = 10.45). The lincom command gives us the difference between the means (51.65351 – 55.81467 = -4.161156), the standard error of the difference, as well as the t-value and the p-value. This command should be run after the svy: means command shown above. We could also use the lincom command to test the two means. Prob > F = 0.0014 Method 2: Using the lincom command Male | 51.65351 | 55.81467 that we know what the labels are, we can use them in the test command. Number of PSUs = 200 Population size = 10,481 To use the test command, we need to know the labels that Stata has assigned to the values in the output. Number of PSUs = 200 Population size = 10481 The null hypothesis that these two means are equal. In our dataset, the variable female is coded 1 for females and 0 forįirst, we use the svy: mean command with the over option to get Let’s say that we wish to do a t-test for write by Pretending that the variable socst is the sampling weight (pweight) and that the sample is We will illustrate this using the hsb2 dataset We will show each of these three ways of conducting a t-test with survey data It is also easy to do a t-test using the svy: regress command. There is no svy: ttest command in Stata however, svy: mean is an estimationĬommand and allows for the use of both the test and lincom post-estimationĬommands. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |