Hi, do you know how to test for convergence within two variables?
@jt809958 жыл бұрын
Hi Alan, I'm trying to predict a rating from 1 through 10 for each observation in my sample. I'm looping a regression model to calculate for each observation. I'm struggling to find the correct postestimation command to use in order for the result of each observation to be categorised between 1 and 10. Would you know the best way to do this?
@drrahatjafri3 жыл бұрын
Here @5:06 what is the role of "if e(sample)", how is it different from "summ prestg80" command? Thanks!
@smilex33 жыл бұрын
Hi Rahat, When you use an estimation command in Stata, something like regress or logit, Stata keeps track of the observations used in the model that do not have any missing values by creating a temporary indicator variable coded 0 if the observation was not in the model and 1 if it was. This variable is called e(sample). It only exists white Stata is running and it will be replaced with new values whenever a model is estimated. In other words, it is ephemeral. If you want to save it or examine the values you could generate inmodel=e(sample) to add this to your dataset. Typically, it is used to conduct other analyses but only on observations in a particular model. See help help f_e for more information.
@michellecazar24409 жыл бұрын
Thank you!
@smilex39 жыл бұрын
Michelle Cazar I'm glad you found the video helpful!
@suqh63713 жыл бұрын
Hey Alan. Thank you for your explanation. I am still confused about the interpretation of line 8: test i.degree 2.degree 3.degree 4.degree. Why we do this test? How to interpret the result of the test? Thanks.
@smilex33 жыл бұрын
In a situation where you have may independent control variables but your main interest is on the varuabke degree, you may want to do an F-test comparing the reduced model, the model without degree but containing the other variables, to the full model with all the variables. If the variable degree is statistically significant than there should be a detectable reduction in the error sum of squares (and an equal increase in the regression sum of squares). The commands in lines 8 & 9 provide that test. To be clear, this command/test is technically not required for this model as the F-test located in the ANOVA table provides the identical test. But, this is only because there are no other independent variables.
@magnomendes73737 жыл бұрын
Hello Alan. Excellent videos. Was wondering if you had the do-files available for download? It's kinda hard to search through a video to find out a specific need you might have. Anyways thank you for the videos.
@magnomendes73737 жыл бұрын
PS: Can we download that song that plays at the beggining? Loved it. :)
@emiliaborko70164 жыл бұрын
Dear Alan, firstly I would like to thank you for the video! I have a question: is t test appropriate to check if the estimator is consistent? And how to interpret it?
@smilex34 жыл бұрын
An estimator of a particular parameter is said to be consistent if it converges in probability to the true value of the parameter as the sample size increases and tends to infinity. The sample mean is a consistent estimator for the population mean. The more data you collect, a consistent estimator will be close to the real population parameter you're trying to measure. The sample mean and sample variance are two well-known consistent estimators. But, I am not certain what you are looking to test?
@emiliaborko70164 жыл бұрын
@@smilex3 I mean how to check in stata if the estimator is consistent. I told stata to do a regression and now I wanna check if the estimator is consistent
@andressa30818 жыл бұрын
Dear Alan, I am trying to test for linearity using the svy command with logistic regression. It seems to be limited to most of the tools I know such as the lrtest. Please advise. All the best Andressa
@smilex38 жыл бұрын
Hi Andressa. Can you clarify what you mean by linearity in this context? In a logistic regression, as your IV increases, the DV changes, but at different rates. if you express the change in probabilities. Here is an example: sysuse auto logistic foreign mpg margins, at(mpg=(12(1)41)) marginsplot, recast(line) noci
@iram46579 жыл бұрын
Dear Alan I have a question. in my model there are three dummy variables like CEO, CFO and others. I want to know how to run F-tests for the joint significance of each variable. Can you pleass tell me how to do it Best Iram Lancaster University
@smilex39 жыл бұрын
Iram Bhatti There are a couple of ways to do this. In the example below I load the auto dataset, drop observations where rep78==1 or rep78==2, then regress mpg on rep78. I use the test and tesparm post-estimation commands to test the joint significance of the two dummy variables. All of the tests below are the same. Best, Alan sysuse auto, clear drop if rep78
@ranganaimuneri85426 жыл бұрын
Dear Allan. I am having difficulties with performing the Hausman test after mlogit results
@choroyerebakia92756 жыл бұрын
please I will be grateful if a see a video on the wald test, LM and LR test
@smilex36 жыл бұрын
Choro, here is some Stata code showing the LR test and Wald test. Hopefully, this is enough to get you going. Best, Alan /* Read data */ webuse nhanes2f, clear /* Estimate the reduced model */ logit diabetes height weight estimates store reduced /* Estimate the full model */ logit diabetes height weight age estimates store full /* Liklihood ratio test */ lrtest full reduced /* Note LLR's for full & reduced models & calculate by hand */ di 2*(-1788.1119 - -1933.9288 ) /* Estimate a model */ logit diabetes height weight age c.age#c.age /* Wald test for the interaction term */ test c.age#c.age /* Square root of chi2 is equal to z in output */ di 3.58^.5
@marcosantonioeuzebiodeoliv85152 жыл бұрын
I wanna the song of the into, please!
@smilex32 жыл бұрын
Stan Rogers - White Collar Holler (kzbin.info/www/bejne/qKSnnKCMpJeZnZY)