ProfessorAmanda / econsimulations

This repository provides the code underlying simulations for teaching statistics and econometrics. The project site, which includes teaching materials as well as the link to the simulations, is located here: https://amandagreggeconomics.com/statistics-simulations-project/
Other
1 stars 0 forks source link

start fixed effects #220

Closed ethansaxenian closed 3 years ago

ethansaxenian commented 3 years ago

Let me know what else we want to add!

ProfessorAmanda commented 3 years ago

Hot damn! That is working!

Some ideas:

tbyker commented 3 years ago

I will try to look at stuff this evening. What branch is this on? Updates?


Tanya Byker

Associate Professor, Economics

Middlebury College @.**@.>



From: Amanda Gregg @.> Sent: Monday, August 23, 2021 5:50 PM To: ProfessorAmanda/econsimulations @.> Cc: Byker, Tanya S. @.>; Review requested @.> Subject: Re: [ProfessorAmanda/econsimulations] start fixed effects (#220)

Hot damn! That is working!

Some ideas:

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FProfessorAmanda%2Feconsimulations%2Fpull%2F220%23issuecomment-904157486&data=04%7C01%7Ctbyker%40middlebury.edu%7C8334d1fdb9434be8d32f08d9667ff6f6%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637653522062326174%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wwuJJOlpWbl%2FSRZoGLuBXABLjSfC2rfBMi6gzBRaU7I%3D&reserved=0, or unsubscribehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAP65VZ575NCTJNJGEIVLGVDT6K7AXANCNFSM5CVPI27A&data=04%7C01%7Ctbyker%40middlebury.edu%7C8334d1fdb9434be8d32f08d9667ff6f6%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637653522062336169%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=TcDVvmQrOkAR1tZirOQh02lZuHiiEnCzIhIuEqQpO2o%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Ctbyker%40middlebury.edu%7C8334d1fdb9434be8d32f08d9667ff6f6%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637653522062336169%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=yPxGxr8vS1VeZp1u9dBTEytmtrr%2FNchkoSH%2BIqWFehE%3D&reserved=0 or Androidhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26utm_campaign%3Dnotification-email&data=04%7C01%7Ctbyker%40middlebury.edu%7C8334d1fdb9434be8d32f08d9667ff6f6%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637653522062346168%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=19PCQlLQqz6khFOusMEb1pTvlApZa%2BbWGKImXtkO6%2FQ%3D&reserved=0.

ethansaxenian commented 3 years ago

I will try to look at stuff this evening. What branch is this on? Updates?

Screen Shot 2021-08-23 at 6 42 14 PM

ethansaxenian commented 3 years ago

Just added the best fit line to the plot. Unfortunately the line has a weird animation that I can't seem to turn off.

tbyker commented 3 years ago

i am still on the fixed effects branch and I am not seeing the ols line. Did git pull and npm install etc

ethansaxenian commented 3 years ago

Now the old points are still visible when the effects are applied. It does get a bit busy with all the marker labels, however.

Also added a table which displays the various means.

i am still on the fixed effects branch and I am not seeing the ols line. Did git pull and npm install etc

What happened when you did git pull?

tbyker commented 3 years ago

I agree that it might get busy, but that is why I like being able to apply things very granularly (one by one) and being able to turn them off and on. Maybe if you make the scale a bit smaller there will be more "air" between the points.


Tanya Byker

Associate Professor, Economics

Middlebury College @.**@.>



From: Ethan Saxenian @.> Sent: Tuesday, August 24, 2021 10:59 AM To: ProfessorAmanda/econsimulations @.> Cc: Byker, Tanya S. @.>; Review requested @.> Subject: Re: [ProfessorAmanda/econsimulations] start fixed effects (#220)

Now the old points are still visible when the effects are applied. It does get a bit busy with all the marker labels, however.

Also added a table which displays the various means.

i am still on the fixed effects branch and I am not seeing the ols line. Did git pull and npm install etc

What happened when you did git pull?

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FProfessorAmanda%2Feconsimulations%2Fpull%2F220%23issuecomment-904718944&data=04%7C01%7Ctbyker%40middlebury.edu%7Cd45981384d0240581f6408d9670fc3a7%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637654139670376583%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=PQyts0ueycqTlR3tlN9rXrCFpgyvEn0rYdlLrawqYNE%3D&reserved=0, or unsubscribehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAP65VZYVW2B3KGUVCTDL2LLT6OXUZANCNFSM5CVPI27A&data=04%7C01%7Ctbyker%40middlebury.edu%7Cd45981384d0240581f6408d9670fc3a7%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637654139670376583%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=C5hfbBE%2FXdYoFFb5w0PKQmuxUoGmv0IQt8Mp7L20P38%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Ctbyker%40middlebury.edu%7Cd45981384d0240581f6408d9670fc3a7%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637654139670386579%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2FP2EYuh8yJ4bBKcQ%2FgV3tn7YsfkYVKL0Wkv85AfCtak%3D&reserved=0 or Androidhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26utm_campaign%3Dnotification-email&data=04%7C01%7Ctbyker%40middlebury.edu%7Cd45981384d0240581f6408d9670fc3a7%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637654139670386579%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pG3G9gnISqpu6wqLt9Te1ipr13raIYHc8MdkXiD5KxU%3D&reserved=0.

tbyker commented 3 years ago

IMG_7238

this is the output from running git pull

tbyker commented 3 years ago

I see the fixed effects module. but it doesn't seem to have any updates beyond what I was looking at last night

ethansaxenian commented 3 years ago

IMG_7238

Looking at the message, you can see that the pull was aborted because of changes on the branch and you need to either commit them or stash them. You will want to stash them here, so run git stash. Then you can pull again.

tbyker commented 3 years ago

ok. got it working, thanks!

I don't mind the "animation" in the ols line. I kind of like seeing it "move". It looks to me like entity (unit) fe are not having much impact (which may some times be the case), but for the sake of example, can we rig this to make more of a difference.

tbyker commented 3 years ago

Actually, it looks like implementing unit fixed effects has no impact on the fitted line. Is this working correctly?

tbyker commented 3 years ago

One way to do this (make the unit fe matter more), would be to shift the X and Y means for each entity further apart. So maybe, for example shift entity 2 (the blue dots) up (can start by just adding 5 to every X value for entity 2 and see what happens).

tbyker commented 3 years ago

Could also play with adding 5 (or maybe 3 if 5 is too extreme -- we are going to need to fiddle a little with this to find the best example values to make the point we are trying to teach) and then also subtracting 2 from the Y value for entity 2. Play around a little

ethansaxenian commented 3 years ago

This is turning out to be a lot more complicated than I expected!

I've reworked the interactive bits according to Tanya's outline (currently the ols lines are disabled).

I haven't yet experimented with tweaking the values, so I will do that now.

ethansaxenian commented 3 years ago

Just added the OLS lines. Do we also want an option to show the OLS line with both fixed effects?

ProfessorAmanda commented 3 years ago

There's a lot going on here, so it might benefit from some additional creativity with respect to the design, but I kinda love it!

ethansaxenian commented 3 years ago

so I've adjusted the values of the points and I think they work a lot better now.

I've also been trying to show the animation in two parts, and unfortunately I don't think this will be possible given the way the module is set up currently, short of rewriting much of it.

ProfessorAmanda commented 3 years ago

Excellent, very big differences now!

ProfessorAmanda commented 3 years ago

Too bad about the animation thing being hard, but we understand. I think it's pretty clear already.

ethansaxenian commented 3 years ago

I've experimented with adding arrows to represent the paths in lieu of a 2-part animation, but I'm not sure I really like them.

ProfessorAmanda commented 3 years ago

Oh, I rather like this! Do you think it would be possible to make both arrowheads visible? Currently I only see the one further from the final point location, i.e.:

Screen Shot 2021-08-25 at 3 53 52 PM

ethansaxenian commented 3 years ago

Yeah, they are visible, but they are the same color as the markers so you can't see them. I could make them all the same color perhaps?

ProfessorAmanda commented 3 years ago

That does help somewhat. I can see the arrowheads beneath the red dots, but I still can't quite see them beneath the blue dots. There's no way to make the rays a bit shorter?

tbyker commented 3 years ago

Amanda, that could be a good idea. I am guessing the arrows are based on the coordinates. Maybe just subtract a little from there you want the arrow to end up rather than landing right at the point? I am out of commission much of today, but I will try to check in before I get back on the road back to VT.


Tanya Byker

Associate Professor, Economics

Middlebury College @.**@.>



From: Amanda Gregg @.> Sent: Thursday, August 26, 2021 8:05 AM To: ProfessorAmanda/econsimulations @.> Cc: Byker, Tanya S. @.>; Review requested @.> Subject: Re: [ProfessorAmanda/econsimulations] start fixed effects (#220)

That does help somewhat. I can see the arrowheads beneath the red dots, but I still can't quite see them beneath the blue dots. There's no way to make the rays a bit shorter?

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FProfessorAmanda%2Feconsimulations%2Fpull%2F220%23issuecomment-906348399&data=04%7C01%7Ctbyker%40middlebury.edu%7Ca9e507843c15451ba19808d96889c9c8%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637655763265917246%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=GSX4RCVB3Hh9rauTNYuj8Pe6Mb64bdSXmg5IwWIXWyc%3D&reserved=0, or unsubscribehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAP65VZZ2CDTHGMGHRWNK3PLT6YUYJANCNFSM5CVPI27A&data=04%7C01%7Ctbyker%40middlebury.edu%7Ca9e507843c15451ba19808d96889c9c8%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637655763265917246%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=B7ZVDPFJUoyGCi4TjdkLldAOt0kLkuvCa%2BBUl9c0hrY%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Ctbyker%40middlebury.edu%7Ca9e507843c15451ba19808d96889c9c8%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637655763265927237%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=JJCf9kh60GaxSkpk5MgPcic7Tr5GZsU40mo1%2FOqfqvY%3D&reserved=0 or Androidhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26utm_campaign%3Dnotification-email&data=04%7C01%7Ctbyker%40middlebury.edu%7Ca9e507843c15451ba19808d96889c9c8%7Ca1bb0a191576421dbe93b3a7d4b6dcaa%7C1%7C0%7C637655763265927237%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3Myryj7MYYGlxlG3eaeUtD8Aydsck%2BqDC6vyXbxQ4oE%3D&reserved=0.

ethansaxenian commented 3 years ago

That does help somewhat. I can see the arrowheads beneath the red dots, but I still can't quite see them beneath the blue dots. There's no way to make the rays a bit shorter?

Ok that took me an embarrassingly long time to figure out!

ProfessorAmanda commented 3 years ago

Looks fantastic! Thanks for figuring that out. It's much clearer now what is going on. I say, merge it.