Alan Neustadtl
Alan Neustadtl
  • Видео 117
  • Просмотров 1 023 259
SOCY201 Google Sheets Histogram Example
A quick tip about how to create a frequency histogram from original data and how to select different interval widths to change the look of the histogram.
Просмотров: 2 824

Видео

SOCY201-Using Google Sheets to Solve a Simple, Oneway ANOVA Problem
Просмотров 8384 года назад
ANOVA problems can be solved using a spreadsheet and this video shows how to use Google sheets to do this. Beside showing how to set up and solve for the F-statistic, some tips like using named ranges, absolute addresses, and some interesting spreadsheet functions are explained.
SOCY401-Introduction to Dummy Variables & Stata
Просмотров 1,4 тыс.4 года назад
Dummy variables, also called indicator or factor variables are used in estimations models like regression to allow adding discrete or qualitative variables to models.
The Details of the General Linear F-test
Просмотров 8334 года назад
This video provides two examples using the auto dataset with Stata to show how the general linear F-test is constructed and calculated by hand. At the end of the examples, the testparm command is used to show how to do these tests in Stata. ERRATUM At the 6:39 minute mark, there is an error in the flyout formula that uses an incorrect sum of squares. The first part of the formula should be (2,4...
SOCY401- Introduction to margins & marginsplot in Stata
Просмотров 6 тыс.4 года назад
This short video shows you how to 1) estimate a bivariate regression model, 2) produce predicted values, & 3) visualize the model. This short video shows you how to 1) estimate a bivariate regression model, 2) produce predicted values, & 3) visualize the model. Stata Code /* Stata help using the -margins- command Uses the GSS data */ /* Create a subset of the GSS data */ keep year realrinc educ...
Using SDA to estimate a difference of 2-means t-test
Просмотров 604 года назад
SDA is a great statistical application but it is not straightforward to use to calculate a difference of 2-means t-test for hypothesis testing. This video will show you what options to select to estimate a t-statistic.
Using A Google Sheets Add-on for ANOVA
Просмотров 8 тыс.4 года назад
This video shows how to install the XLMiner Analysis ToolPak add-on that includes a module to solve a single factor ANOVA problem.
Using ANOVA in SDA to estimate the difference of two means t-test
Просмотров 915 лет назад
In this video, I demonstrate how to calculate a difference of means t-test using SDA. The trick is that we will calculate an F-test using ANOVA and convert F to t. But, the F-distribution and the t-distribution are related to each other. Specifically, sqrt(F) is equal to t. Watch the video for the details
Why players should go to the net
Просмотров 1195 лет назад
Watch how the middle drive player, Tom Wilson, goes to the net taking two defenders with him. This creates space and opens up a passing lane.
Understanding Contingency Tables and Crosstabulation, Pt. 5
Просмотров 79810 лет назад
Part 5 of an introduction to contingency or crosstabulation tables and statistics. This video provides two different ways of of conceptualizing expected values.
Using local macros in a foreach loop
Просмотров 25 тыс.10 лет назад
One of the great features of Stata is the local macro construct that allows macro substitution or expansion. This video walks through an example of using local macros in the context of foreach loops in a regression model. My thanks to Arvind Sharma for pointing out an error at around 5:50 in the video. I have added an annotation at that point with the correction.
Numerical Precision in Stata
Просмотров 2,2 тыс.10 лет назад
Numerical precision can lead to interesting issues in Stata. This video will show you why numbers like 7.3 might not equal 7.3. The reason is the numerical precision of how the numbers are stored. Some strategies for dealing with precision issues are discussed.
How Stata Treats Missing Values
Просмотров 43 тыс.10 лет назад
Stata can sometimes confuse new users with how missing values are treated. This video will remove some of the mystery and help you understand some of the issues with missing values.
Univariate Frequency Distributions for Continuous Variables
Просмотров 2,1 тыс.10 лет назад
This video discusses how to create and interpret univariate frequency distributions for continuous measures.
Visualizing Univariate Frequency Distributions
Просмотров 1,4 тыс.10 лет назад
This video discusses how to create visualizations of univariate frequency distributions. Specifically, how to create bar graphs (for discrete variables), frequency histograms (for continuous measures), and average bar charts. There is also a brief discussion of frequency polygons.
Univariate Frequency Distributions for Discrete Variables
Просмотров 4,5 тыс.10 лет назад
Univariate Frequency Distributions for Discrete Variables
Positivism in Social Inquiry
Просмотров 4,4 тыс.10 лет назад
Positivism in Social Inquiry
Bethesda Snowstorm
Просмотров 15210 лет назад
Bethesda Snowstorm
Copy of SOCY201 05 z scores 2A TEMP
Просмотров 2710 лет назад
Copy of SOCY201 05 z scores 2A TEMP
SOCY201 05 z scores 2A TEMP
Просмотров 3510 лет назад
SOCY201 05 z scores 2A TEMP
Using local macros in Stata
Просмотров 38 тыс.10 лет назад
Using local macros in Stata
SOCY201 Final Exam Review F13
Просмотров 25710 лет назад
SOCY201 Final Exam Review F13
Calculating Bivariate Regression Coefficients by Hand
Просмотров 3,2 тыс.10 лет назад
Calculating Bivariate Regression Coefficients by Hand
Bivariate Regression Analysis, Pt. 2
Просмотров 1,9 тыс.10 лет назад
Bivariate Regression Analysis, Pt. 2
Bivariate Regression Analysis, Pt. 1
Просмотров 13 тыс.10 лет назад
Bivariate Regression Analysis, Pt. 1
Regression Postestimation Commands in Stata: margins, pt. 2
Просмотров 25 тыс.10 лет назад
Regression Postestimation Commands in Stata: margins, pt. 2
Regression Postestimation Commands in Stata: margins, pt. 1
Просмотров 36 тыс.10 лет назад
Regression Postestimation Commands in Stata: margins, pt. 1
Stata Postestimation Commands. Using -contrast-
Просмотров 4,3 тыс.10 лет назад
Stata Postestimation Commands. Using -contrast-
Stata Postestimation Commands. Using -test-
Просмотров 18 тыс.10 лет назад
Stata Postestimation Commands. Using -test-
Stata Postestimation Commands. Using -predict-
Просмотров 52 тыс.10 лет назад
Stata Postestimation Commands. Using -predict-

Комментарии

  • @suchiswain8968
    @suchiswain8968 7 месяцев назад

    Predict residual command is not working...what to do

  • @connorbrennan5697
    @connorbrennan5697 10 месяцев назад

    Isn't this Fischer's exact test?

  • @mafer4953
    @mafer4953 11 месяцев назад

    tysm

  • @joy6404
    @joy6404 Год назад

    Hi Alan, your video is great! Thank you! I am having trouble producing interaction plots after using FIML method treating missing values. I would greatly appreciate your advice on it.

  • @Sofia-oz7zh
    @Sofia-oz7zh Год назад

    life saviorrrr

  • @phorndy1879
    @phorndy1879 Год назад

    can we link the data from Google Form/Sheet with Stata?

    • @smilex3
      @smilex3 Год назад

      Not directly, but you can export your data as a csv file and then import the delimited text file.

  • @ekeomageorge8979
    @ekeomageorge8979 Год назад

    This is great Thanks alot

  • @ekeomageorge8979
    @ekeomageorge8979 Год назад

    Thank you so much for this video. Although my question is 9 years late how about interacting two dummies

    • @smilex3
      @smilex3 Год назад

      Ekeoma, if you interact two dummy variables you produce four outcome groups. You can use Stata's factor notation to do this in different types of models. See help fvvarlist for detail. Here is a quick (and analytically meaningless) example that creates a dummy variable and then uses it in a regression model interacted with another dummy variable. I have included a covariate as well. The plotted results show the relationship between displacement and fuel efficiency across the four groups defined by the interaction term. Hopefully, this gives you some ideas on how to set up your model. sysuse auto, clear * Create dummy variable for this example sum weight, meanonly gen weightdum=weight>=r(mean) * This is the interaction to be estimated tab weightdum foreign, nolabel * Use regress with factor notation (see help fvvarlist) regress mpg displacement i.weightdum##i.foreign margins weightdum#foreign, at(displacement=(75(25)200)) marginsplot, noci scheme(s2color)

  • @beatriceruocco3715
    @beatriceruocco3715 Год назад

    hi! there is a way to make a bar graph on stata without making the mean(or median)? I only want to plot my data, hist doesn't work because I have the mean and the median of two variables to plot over a string variable. With graph bar stata plots the mean of the mean and the mean of the median. How I can solve it? Thanks

    • @smilex3
      @smilex3 Год назад

      Hi Beatrice, I am uncertain exactly what you want to accomplish but I have suggestions for two situations that may help you. The first situation has a typical dataset of recorded values for each observation for several variables. In this situation, you might want to graph the results of some simple descriptive statistics (e.g. means, medians, standard deviations, etc.) In the second situation, you could have a dataset of descriptive statistics (e.g. means, etc.) for variables calculated across some other (string) variable. People are sometimes confused by "graph bar" in Stata expecting something like a histogram. But the help file clearly states, "In a vertical bar chart, the y axis is numerical, and the x axis is categorical." My example uses the auto.dta dataset to demonstrate graphing the means and medians of three variables calculated for two groups. Here is example 1: sysuse auto, clear summarize mpg trunk turn graph bar (mean) mpg turn trunk /// (median) mpg turn trunk, /// over(foreign) blabel(bar, format(%4.0f)) /// name(bar1, replace) I believe this accomplishes graphing means and medians for variables across or over a categorical variable. But, if your dataset contains summary statistics, you can create the same graph shown in example 2: clear input str10 foreign byte (mpgmean mpgmed turnmean turnmed trunkmean trunkmed) "Domestic" 20 19 41 42 15 16 "Foreign" 25 25 35 36 11 11 end graph bar mpgmean turnmean trunkmean mpgmed turnmed trunkmed, /// over(foreign) blabel(bar) name(bar2, replace) Note here that I have simply created a new dataset of summary statistics, an unnecessary step if I have access to the original raw data (e.g. example 1). Hopefully, this helps you a bit. If I have misunderstood your question, feel free to post again. It would be helpful if you could use a built-in s=dataset like the auto dataset to show me an analogous problem that we can work on together.

  • @emilyfeet135
    @emilyfeet135 Год назад

    wishing u much happiness. this helped me so much

  • @koyaconsults
    @koyaconsults Год назад

    Hi, how do I import fix format files using infix command? Thank you!

    • @smilex3
      @smilex3 Год назад

      Hi Koya. Unfortunately, importing data to any statistical applicaiton can be complicated due to the numerous formats that data are stored in. I suggest that you type "help import" in the command window and read the contents to see if there is an east way t import your data. If you know that you need to use infix, you can type "help infix" for detailed information.

  • @bugzdesilva8216
    @bugzdesilva8216 Год назад

    thank you so much, can you please show how to rename a set of variables using loop and also to generate dummy variables using loop command

    • @smilex3
      @smilex3 Год назад

      Hi Bugz, Stata has a command that allows you to rename a group of variables. I would rename variables using this command and not use any looping constructs. Here is an example: sysuse auto, clear rename (make price mpg rep78 headroom trunk /// weight length turn displacement gear_ratio foreign) /// (v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12) You can read about the command by entering help rename group in the command window. You don't say much about how you want to construct your dummy variables but I can give you two examples. The first uses numeric variables as inputs and divides them at their means, assigning 0 if a value is less than or equal to the mean and a 1 if it is greater than the mean and not missing. I put the variable generation in a loop. Here is the example: sysuse auto, clear foreach var of varlist price mpg weight { summarize `var', meanonly generate `var'dum = `var' >= r(mean) & `var' <. } list p* mp* w* But, if I had a discrete variable like rep78 I would use the tabulate command. Something like this: sysuse auto, clear tab rep78, generate(rep78dum_) tab foreign, generate(foreigndum_)

    • @bugzdesilva8216
      @bugzdesilva8216 Год назад

      🤩thank you so much for the very clear and extensive answer. I have several categories in the dummy. So as your suggestion it is the tabulate command I used. gen v114=waters_dummyd tabulate waters_dummyd, gen(water_srca) gen imp_water_dd=1 if water_srca1==1 replace imp_water_dd=1 if water_srca2==0 For this, if there are categories from 1 - 20 I need to retype it 20 times and change the 1 or 0. I was wondering if I should do this way manually or if is there a macro to make this in a few lines.

    • @smilex3
      @smilex3 Год назад

      ​@@bugzdesilva8216 I am confused by your code. I belive that your first two lines of code can be replaced by a single command like this: tabulate v114, gen(water_srca) You do not have to create a new variable to tabulate. Here is how this works with the auto.dta dataset: sysuse auto, clear tab rep78, generate(rep78dum_) Because the variable rep78 has 5 categories, a total of 5 dummy variables are created. The variables form a linear combination so something like a regression model you would need to decide on a category to exclude. Nota bene: if using indicator variables in some model, you really should use Stata's factor notation (see help fvvarlist). Your next two commands are confusing to me because I do not know how the original variable, v114, was coded. It looks like you are trying to take two conditions and code them equal to 1 and all other equal to zero. Here is an example, again, using rep78: sort rep78 generate rep78dum = cond(1, rep78==1 | rep78==5, 0) if rep78 <. list rep78 rep78dum Here, the new variable called rep78dum is assigned the value of 1 when rep78 is equal to either 1 or 5. All other values are set to 0 except for the cases where rep78 has missing values. There are other ways of doing this, but this is one way to accomplish this with one line of code. It would be easier for me to help you if you created examples using the auto.dta dataset so I can replicate them. It is difficult to answer questions when I do not know how the data are represented.

    • @bugzdesilva8216
      @bugzdesilva8216 Год назад

      @@smilex3 Thank you so much !!! The last example you provided was really helpful to me. It solved the problem I faced. I was generating a binary variable assigning 1 or 0 per category to the main variable (ie: rep78). Your command made my dofile clear and smooth. Glad I'm following your channel !!

    • @bugzdesilva8216
      @bugzdesilva8216 Год назад

      @smilex3 And one more clarification please. if we want to generate a categorical variable by using the rep78 variable, giving 1 if rep78==1 and 2 if rep78==2 and 3 if rep78==3 and 0 for both rep78==4 and rep78==5 how could we generate the above categories using the same command. Is it possible.. *sort rep78 generate rep78dum = cond(1, rep78==1 | rep78==5, 0) if rep78 <.

  • @itaihoffman
    @itaihoffman Год назад

    Thank you very much for the video

  • @manzooranoori2536
    @manzooranoori2536 Год назад

    Thank you so much. It was so clear and helpful.

  • @manzooranoori2536
    @manzooranoori2536 Год назад

    thank you

  • @jamiemorrison2672
    @jamiemorrison2672 Год назад

    Hi, do you know how to test for convergence within two variables?

  • @garretttaylor6088
    @garretttaylor6088 Год назад

    THIS GUY ROCKS!!!!

  • @AmitKumar-hf4ek
    @AmitKumar-hf4ek Год назад

    thanks man, I got stuck with it just an hour before my exam. your help is appreciated ✌✌

  • @daniela1551
    @daniela1551 Год назад

    Thank you very much!

  • @gideonejim4857
    @gideonejim4857 2 года назад

    Thanks, this is very knowledgeable… I’m actually facing some crisis analyzing datasets with STATA, would really appreciate if any help could be granted

  • @titirb6624
    @titirb6624 2 года назад

    very helpful!

  • @SudheerShuklaArjun
    @SudheerShuklaArjun 2 года назад

    Thank you for these important macros.

  • @Bodiwho
    @Bodiwho 2 года назад

    Is the coefficient of determination at 7:17 right? Wouldn't it be ESS/TSS ? Thanks

    • @smilex3
      @smilex3 2 года назад

      I thnk that I said this correctly. Unfortiunately, itis easy to get lost ina lot of similar terms. For example, in the context of ANOVA, the coefficient of determination is equal to the between group sum of squares divided by the total sum of squares. Inthe context of regression, the between group sum of squares is called the regression or model sum of squares. So, the ratio of the between group, model, or regression sums of squares to the total sum of squares is the coefficient of determination. In ANOVA you might also see this called eta-squared where it is used to decompose the explained variance due to different independent variables and it is used as an effect size measure.

  • @keithschlabach410
    @keithschlabach410 2 года назад

    Thanks Alan

  • @SkiBumK27
    @SkiBumK27 2 года назад

    Hello, thanks for the useful video. 2 questions: 1) How did you get the bars to be different colors in the last graph? 2) How can I change the color of a single bar? TIA

    • @smilex3
      @smilex3 2 года назад

      There are two options that can help control the look of the bars. Which one you use depends on what you want your graph to look like and how your variables were created. The options are: ascategory which treat yvars as first over() group and asyvars which treat the first over() group as yvars In the example for the last graph in the video, I have one variable to be graphed over two categories. The default option is ascategory. Copy and run this code snippet: sysuse auto, clear set scheme s2color graph bar mpg if rep78>=3, over(foreign) over(rep78) ascategory name(bar1, replace) graph bar mpg if rep78>=3, over(foreign) over(rep78) asyvars name(bar2, replace) But, what if I had a different set of variables for mpg? One of the variables contains the mpg values for domestic cars and is missing for the foreign ones. The other variable contains mpg values for the foreign cars and is missing for the domestic ones. We can create that variable and graph them like this: separate mpg, by(foreign) generate(mpgfor) graph bar mpgfor0 mpgfor1 if rep78>=3, over(rep78) name(bar3, replace) See how the graphs bar2 and bar3 are identical. But, using the asyvars option I did not need to create and manage any new variables. Regarding your second question, changing the color of a single bar is easy if you only have one over grouping variable. The following code shows the easy solution in the first block of code. The second block shows how there might be an issue with more than one over grouping variable: graph bar mpg if rep78>=3, asyvars bargap(80) over(rep78) /// bar(1, bcolor(navy)) /// bar(2, bcolor(navy)) /// bar(3, bcolor(lime)) /// name(bar4, replace) graph bar mpg if rep78>=3, asyvars bargap(80) over(rep78) over(foreign) /// bar(1, bcolor(navy)) /// bar(2, bcolor(navy)) /// bar(3, bcolor(lime)) /// name(bar5, replace) Here is one more possible solution if you have more than one over group. It involves taking the two over variables and combining them into a single over variable, using the asyvars option, and controlling the colors of the bars individually. Here is an example: egen forrep78=group(foreign rep78), label graph bar mpg if rep78>=3, asyvar over(forrep78) bargap(80) /// bar(1, bcolor(navy)) /// bar(2, bcolor(navy)) /// bar(3, bcolor(lime)) /// bar(4, bcolor(navy)) /// bar(5, bcolor(navy)) /// bar(6, bcolor(navy)) /// name(bar6, replace) If none of the above gets you to where you want to be, you can move to graph twoway bar where you can layer one graph over another. So, youcould create a base graph with the default colors, then add a second graph with just a single bar of a different color.

  • @rak1212
    @rak1212 2 года назад

    How would you interpret the the significance of these predicted values? Is it against the null hypothesis that the predicted value is equal to zero?

    • @smilex3
      @smilex3 2 года назад

      Yes, that is what is being tested. I don't find this particularly interesting since 0 is often outside the range of my data or is a theoretically uninteresting number. But, if you divide each margin by its standard error you get the z-statistic. Here is some Stata code to play with: sysuse auto, clear regress mpg weight margins, at(weight=(1760(20)4840)) marginsplot, recast(line) noci name(linear1, replace) margins, at(weight=(1760(20)4840)) dydx(weight) marginsplot, recast(line) noci name(linear2, replace) regress mpg c.weight##c.weight margins, at(weight=(1760(20)4840)) marginsplot, recast(line) noci name(inter1, replace) margins, at(weight=(1760(20)4840)) dydx(weight) marginsplot, recast(line) noci name(inter2, replace) The first block of code shows a linear relationship and produces the adjusted predicted values as well as the slope derivatives. Notice that in the case of the derivative, both z and p are the same as in the regression model. This does not hold for interaction terms. The second block of code shows quadratic models for both the adjusted predicted values as well as the slope derivatives. Here you can see that the effect size becomes smaller as weight incrases.

  • @hownotto4956
    @hownotto4956 2 года назад

    Hi Alan, for the last one using infile and data dictionary, does using dictionary means the data file itself gets loaded? I was assuming a dictionary file and a data file are two different files.

    • @smilex3
      @smilex3 2 года назад

      This is one of those it depends situations. If you type help infile in the Stata command window and then click on infile2, you will find all of the details. But here is the short version. There are two ways of using infile, one for free-format files and one for fixed--format files. When you use use fixed-format data files you need a data dictionary that maps the location of variables and observations for Stata. This could mean that you have three files. File #1 are the data. File #2 is the data dictionary. File #3 is optional because you could run the infile command from the command window, ut would typically be a Stata do-file with the infile command. In this scenario you wold run or execute the do-file, The infile command would point Stata to your data dictionary, and the data dictionary would either contain the data or would point Stata to the file with the fixed-format data.

  • @beakalzinab830
    @beakalzinab830 2 года назад

    I found the video nice eye opening, however i am working on Longitudinal data and I want to produce predicted data set to run subsequent analysis. Could you please tell me how to go about doing this??

    • @smilex3
      @smilex3 2 года назад

      Hi Beakal, the predict produces results base don the model you estimated . So, if you have included your time variable, e.g. year, the values of this variable will influence the predicted values.

  • @jenniferfrimpong7496
    @jenniferfrimpong7496 2 года назад

    very helpful

  • @Yeppi232
    @Yeppi232 2 года назад

    Hello @Alan Can you show macros to edit tabulate command? In stata when we use tab it shows output in a fixed manner, I want to edit that. For example, I want instead of showing p value under the table, it will show within the output table cells beside 'frequency' column

    • @smilex3
      @smilex3 2 года назад

      I don't think that this can be done without writing your own command to create a contingency table and the associate statistics that you are interested in displaying (e.g. chi2, p-value, etc.). There may be a way to do this using the new table command in Stata V17, but I don't see it after a quick look. While not what you are looking for, the following example use the (new) table command with the tabulate command to produce a table that is maybe a little better looking than the default one in tabulate. Not what you wanted, but maybe you will find it interesting: sysuse nlsw88.dta, clear quietly { table (collgrad) (race) () if race<3, /// nototals /// statistic(percent race, across(collgrad)) /// nformat(%3.1f) collect style header race, title(hide) collect style header collgrad, title(hide) noisily collect preview tab collgrad race if race<3, chi2 local df=(r(r)-1) * (r(c)-1) local chi2=strofreal(r(chi2), "%6.1fc") local pr=strofreal(r(p), "%6.4f") noisily di "Pearson chi2(`df') = `chi2' Pr = `pr' " }

    • @Yeppi232
      @Yeppi232 2 года назад

      @@smilex3 thank you for your prompt response, I have stata 14.2 . I tried to run this code Its saying option nototals not allowed, Then I tried without nototals. Now it is saying option statistic() is not allowed. I want to learn writing own command. If you can suggest me any link or book, that will be helpful.

  • @mebrekzelalem9376
    @mebrekzelalem9376 2 года назад

    how to get link of vedios

  • @adamw2030
    @adamw2030 2 года назад

    Excellent video. I was trying to do the equivalent of bysorting in R and it ended up being a lot quicker to just load it in Stata and clean it with the bysort function, then move back to R for spatial analysis. Thank you!

  • @marcosantonioeuzebiodeoliv8515
    @marcosantonioeuzebiodeoliv8515 2 года назад

    I wanna the song of the into, please!

    • @smilex3
      @smilex3 2 года назад

      Stan Rogers - White Collar Holler (ruclips.net/video/rsDkmVo2fg4/видео.html)

  • @danielkrupah
    @danielkrupah 2 года назад

    Please i need your help for data visualization

  • @pravin8419
    @pravin8419 2 года назад

    Thank you for such a wonderful tutorial.

  • @shafiqullahyousafzai15
    @shafiqullahyousafzai15 2 года назад

    Thanks from Afghanistan

  • @faysalazeem
    @faysalazeem 2 года назад

    Thank you very much for your tutorial. This is so concise yet so comprehensive. I am wondering if you could help me in drawing bivariate kernel density plot? Specifically, I have data of a variable for different countries for two years. I want to take values of variable in year 1 on x-axis and values of variable in year 2 on y-axis. Please! help.

    • @smilex3
      @smilex3 2 года назад

      Hi Faisal, I am not certain I understand exactly what you want to do, but I show you some Stata cod below that may point you in a good direction. One way of reading your question is that you want to produce two kernel density plote to compare distributions across time. I show two solutions below. The first uses the addplot() notion and the second uses graph twoway density with the by() option. But, if you really want to plot the density data from one year against the other, I show a third solution using kdensity to generate new variables with the plotted data values that you can then use with any Stata graphing command. Here, I use graph twoway scatter. Hopefully something below helps you: use www.stata-press.com/data/r17/nlswork.dta kdensity hours if year==87, addplot(kdensity hours if year==68) scheme(s2mono) kdensity hours if year==87, addplot(kdensity hours if year==68) scheme(s2mono) two kdensity hours if year==68 | year==87, by(year) kdensity hours if year==68, generate(x68 d68) kdensity hours if year==87, generate(x87 d87) graph twoway scatter d68 d87

    • @faysalazeem
      @faysalazeem 2 года назад

      ​@@smilex3 Thank you very much for your reply. Unfortunately, I could not make you understand what I wanted to do. My problem is; assume, I have income data of 80 individuals in year 1996 and 2002 and I want to analyze the evolution of distribution between 1996 to 2002. I want to do this to see whether their earning differential has reduced or increased or stayed the same in this period. I wrongly told you earlier that I want to do bivariate kernel density analysis. I have done some readings later and I came to know that i have to perform stochastic Kernal analysis instead of bivariate kernel density estimation. Stochastic Kernal estimation will give me a three dimensional graph with year 1996 on x-axis and year 2002 on y-axis and density in third dimension. Normally, this is accompanied with the contour plot as well. Please guide me how this can be implemented in Stata. I will be grateful to you.

  • @dinhbachtuong1102
    @dinhbachtuong1102 2 года назад

    Thank you so much Sir! But why do I get a more bumpy density when I just use "kdensity" only, yet a smoother when I add the "twoway" (other options the same). Is it the case that "kdensity" is an estimate while adding "twoway" before it changes it to a descriptive? Can anybody help me on this?

    • @smilex3
      @smilex3 2 года назад

      Hmmm...I never noticed that before. I looked through the help file but a deeper dive in the pdf manuals might explain the difference. Also, a call to Stata support would probably get you an answer to your interesting question. At first I thought that the default settings might be different across the two plots, but that does not appear to be the case. I created two kernel density plots with the same settings and while quite similar, there are some differences. Here is the Stata code I used to test this idea: sysuse auto, clear kdensity mpg, bwidth(1.9746) kernel(epanechnikov) n(300) /// title("Default kdensity plot") /// scheme(s2mono) /// name(kdens, replace) /// nodraw tw kdensity mpg, bwidth(1.9746) kernel(epanechnikov) n(300) /// title("Default twoway kdensity plot") /// xtitle("Mileage (mpg)") /// note("kernel = epanechnikov, bandwidth = 1.9746") /// scheme(s2mono) /// name(kdenstw, replace) /// nodraw graph combine kdens kdenstw, nocopies ycommon xcommon scheme(s2mono) Looking at the pdf help files I found this "graph twoway kdensity varname uses the kdensity command to obtain an estimate of the density of varname and uses graph twoway line to plot the result." So, it is possible that how the line is produced is different and leads to this issue. I thought this could be tracked down by generating the density data points but this is not an option in twoway kdensity. So, it might just be about how the plot is produced using tw line versus om other method.

    • @dinhbachtuong1102
      @dinhbachtuong1102 2 года назад

      @@smilex3 Thank you so much for an answer lots of care and attempt! I just like to spot some details that way, which slows me down on STATA sometimes ^^! But I guess "twoway kdensity" is still the best way to have the 1st look at a variable.

  • @camilacarvallo150
    @camilacarvallo150 3 года назад

    Almost 8 years later and this video's still helping people like me do their job. Thank you!

  • @danielkrupah
    @danielkrupah 3 года назад

    Please, I need help with index creation for panel data. Please help me.

  • @dataman6744
    @dataman6744 3 года назад

    Great work, Are you able to share that do file?

  • @111princeps111
    @111princeps111 3 года назад

    Hey Alan, although this video has been around some time, I wondered. Would you mind explaining the interpretation of these effects a little more? We have seen, for instance for the adjacent contrast, that the p-values indicate significance in comparing between the ordered categories. How can we interpret these? Does it mean that the groups are significantly different from each other? What can we say more about it? And how would that look like with interaction effects? E.g. one could incorporate gender as a variable and do the comparison. Perhaps one could see that the significant differences are only true (hypothetical) for males. What more could we say about them?

  • @suqh6371
    @suqh6371 3 года назад

    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.

    • @smilex3
      @smilex3 3 года назад

      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.

  • @user-on1zf9jm5v
    @user-on1zf9jm5v 3 года назад

    Thank you , this video and patr 1 were super instructive and helpful ! Now I understand the powere of marginplot

  • @uclalse
    @uclalse 3 года назад

    E.X.C.E.L.L.E.N.T. Than you sooo much! All of my confusions were cleared up. It is great with these examples where you can actually see the data in columns so you see what is otherwise happening behind the scenes, so to speak.

    • @smilex3
      @smilex3 3 года назад

      I am glad that this helped you!

  • @hassangholipour4152
    @hassangholipour4152 3 года назад

    Thank you so much. Very useful video

  • @raineliao
    @raineliao 3 года назад

    thank you!

  • @louisabarryfood
    @louisabarryfood 3 года назад

    Hi there! Thank you for the great video. I just want to confirm that you can do margins and marginsplot for just a OLS multiple regression. I assume you only use it for logistic regression with log transformed variables. Thank you so much!

  • @roseaniparente3573
    @roseaniparente3573 3 года назад

    What is the best way to make a 5-variable box plot on a 5-year panel?

    • @smilex3
      @smilex3 3 года назад

      Hi Roseani, It is difficult to know exactly what comparisons are important for you to highlight. One method would be to use the "by()" option to graph box. Maybe something like this: sysuse auto, clear graph box length displacement, by(rep78) In this example, length and displacement are two (of your five variables) and rep78 stands in for a variable representing your panels. This produces one graph for each value of rep78 (our for a panel in your case). You can reorganize the graph to put all the graphs in a column or row which might help. This might get you a little further along in solving your problem.

  • @ishitapandey1691
    @ishitapandey1691 3 года назад

    can this be done on a 2x3 table with 3 Ordered categories?

    • @smilex3
      @smilex3 3 года назад

      Yes, if the variables are ordered. You can see an example worked by hand at ruclips.net/video/9UvOR7fGWZM/видео.html.

    • @ishitapandey1691
      @ishitapandey1691 3 года назад

      @@smilex3 Thanks!