{"id":343956,"date":"2023-01-15T21:01:48","date_gmt":"2023-01-15T21:01:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=343956"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=343956","title":{"rendered":"<span>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Python, \u0447\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><strong>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Python, \u0447\u0430\u0441\u0442\u044c 1: \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0439 \u041c\u041d\u041a, \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438, \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438.<\/strong><\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u201c\u043e\u0431\u044b\u0447\u043d\u044b\u0445\u201d \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Python: \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u041c\u041d\u041a (pooled OLS), \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 (one-way individual FE), \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 (two-way FE), \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 (one-way RE). \u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u043e\u0446\u0435\u043d\u043a\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u201c\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0435\u0439\u201d (diff-in-diff) \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c &#171;\u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c&#187;. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0435\u043b\u0435\u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/p>\n<p><u>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442:<\/u> \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u043e\u0442\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u043f\u043e \u043c\u043e\u0442\u0438\u0432\u0430\u043c \u0441\u0442\u0430\u0442\u044c\u0438 \u201cOnline platform price parity clauses: Evidence from the EU Booking.com case\u201d (Mantovani, Piga, Reggiani, 2021) [1]. \u0422\u0435\u043a\u0441\u0442 \u0441\u0442\u0430\u0442\u044c\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"https:\/\/cloud.mail.ru\/public\/eqBq\/eVTQrWW9W\" rel=\"noopener noreferrer nofollow\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>.<\/p>\n<p>\u0412 \u0418\u0442\u0430\u043b\u0438\u0438 \u0438 \u0424\u0440\u0430\u043d\u0446\u0438\u0438 \u0441\u0430\u0439\u0442 Booking.com \u043c\u043e\u0433 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043b\u043e\u043a \u0446\u0435\u043d \u043d\u0430 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0436\u0438\u043b\u044c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u043e\u0441\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. 6 \u0430\u0432\u0433\u0443\u0441\u0442\u0430 2015 \u0433\u043e\u0434\u0430 \u0432\u043e \u0424\u0440\u0430\u043d\u0446\u0438\u0438 \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u044f\u0442 \u0437\u0430\u043a\u043e\u043d \u041c\u0430\u043a\u0440\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043b \u0438\u0437 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043e\u0442\u0435\u043b\u044f\u043c\u0438 \u0438 Booking.com \u043f\u0443\u043d\u043a\u0442\u044b, \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0432\u0448\u0438\u0435 \u043e\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u043e \u0446\u0435\u043d\u0430\u043c \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0443 Booking.com. \u0426\u0435\u043b\u044c\u044e \u0437\u0430\u043a\u043e\u043d\u0430 \u041c\u0430\u043a\u0440\u043e\u043d\u0430 &#8212; \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u043e\u043d\u043e\u043f\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f Booking.com. \u0424\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u0438\u0435 \u043e\u0442\u0435\u043b\u044c\u0435\u0440\u044b \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u043b\u0438 \u0441\u0435\u0431\u044f \u0441 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043a\u043e\u043d\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u043b\u0438, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043e\u0442\u0435\u043b\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0446\u0435\u043d\u044b, \u043a\u0430\u043a \u043d\u0430 Booking.com, \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043d\u0438\u0436\u0435, \u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u0442 \u0437\u0430\u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u0443 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043e\u0442\u0435\u043b\u044f. \u0412 \u0418\u0442\u0430\u043b\u0438\u0438 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043a\u043e\u043d \u043f\u0440\u0438\u043d\u044f\u0442 \u043d\u0435 \u0431\u044b\u043b.<\/p>\n<p><u>\u0417\u0430\u0434\u0430\u0447\u0430:<\/u> \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u0446\u0435\u043d\u044b \u043d\u0430 \u043d\u043e\u043c\u0435\u0440\u0430 \u0432 \u043e\u0442\u0435\u043b\u044f\u0445 \u043f\u043e\u0441\u043b\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043e\u043d\u0430.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<pre><code>import pandas as pd df = pd.DataFrame(pd.read_stata('data_mac_sr.dta')) df.head(5)<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 &#8212; \u0432\u044b\u0447\u043b\u0435\u043d\u044f\u0435\u043c \u0440\u0435\u0433\u0438\u043e\u043d.<\/p>\n<pre><code>df['region']=df.region.apply(lambda x: x.split(' ')[0])<\/code><\/pre>\n<p>\u041d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0442\u0435\u043b\u044f\u0445 \u0434\u0432\u0443\u0445 \u043e\u0441\u0442\u0440\u043e\u0432\u043e\u0432 &#8212; \u0421\u0430\u0440\u0434\u0438\u043d\u0438\u0438 (\u0418\u0442\u0430\u043b\u0438\u044f, \u0437\u0430\u043a\u043e\u043d \u043d\u0435 \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u044f\u0442), \u041a\u043e\u0440\u0441\u0438\u043a\u0438 (\u0424\u0440\u0430\u043d\u0446\u0438\u044f, \u0437\u0430\u043a\u043e\u043d \u043e \u0437\u0430\u043f\u0440\u0435\u0442\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 Booking.com \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u044f\u0442). \u041f\u043e \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0443 \u0440\u0435\u0433\u0438\u043e\u043d\u044b \u043f\u043e\u0445\u043e\u0436\u0438 (\u0441\u043c. \u0420\u0438\u0441\u0443\u043d\u043e\u043a 1).\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ebf\/9fd\/8d1\/ebf9fd8d11070e29b414a47e3975ab06.png\" alt=\"\" title=\"\" width=\"1170\" height=\"828\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ebf\/9fd\/8d1\/ebf9fd8d11070e29b414a47e3975ab06.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u0442\u0430\u0441\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430 4 \u043c\u0435\u0441\u044f\u0446\u0430 2015 \u0433\u043e\u0434\u0430: \u0441 \u0438\u044e\u043d\u044f \u043f\u043e \u043e\u043a\u0442\u044f\u0431\u0440\u044c 2015 \u0433\u043e\u0434\u0430. \u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0435: \u043e\u0434\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u201c\u043f\u043e\u0445\u043e\u0436\u0435\u0441\u0442\u044c\u201d \u043e\u0441\u0442\u0440\u043e\u0432\u043e\u0432 \u0438 \u043f\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c \u043e\u0442\u0435\u043b\u0435\u0439, \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0431\u0430\u043b\u0430\u043d\u0441 \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0442 \u043d\u0430 \u0441\u0430\u043c\u0443\u044e \u0440\u0430\u043d\u043d\u044e\u044e \u0434\u0430\u0442\u0443 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0435\u043b\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0435\u043b\u0435\u0439 \u0434\u043e \u0430\u043d\u043e\u043d\u0441\u0430 \u0437\u0430\u043a\u043e\u043d\u0430 \u041c\u0430\u043a\u0440\u043e\u043d\u0430. \u041f\u043e\u0441\u043b\u0435 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043e\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u043e\u0441\u0442\u0440\u043e\u0432\u0430\u0445 \u043c\u043e\u0433\u043b\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f. \u041d\u043e \u043d\u0430\u043c \u044d\u0442\u043e \u043d\u0435\u0432\u0430\u0436\u043d\u043e.<\/p>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u201c\u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u043d\u043d\u0438\u0435\u201d \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043e\u0442\u0435\u043b\u0435\u0439.<\/p>\n<pre><code>df_table=df.merge(df.groupby('urlnum', as_index=False).agg({'date_src':'min'}))<\/code><\/pre>\n<p>\u0412\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>df_table=df_table[['region', 'capacity',\u00a0 'stars', 'rating', \u00a0                      'dchain', 'Nreviewers',\u00a0 'date_start_booking']].dropna()<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043d\u0435\u0439 \u043e\u0442 00-00-0000, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>df_table['for_std_counting']=df_table['date_start_booking'].dt.day                                + df_table['date_start_booking'].dt.month * 30                                + df_table['date_start_booking'].dt.year * 365<\/code><\/pre>\n<p>\u0421\u0442\u0440\u043e\u0438\u043c \u0431\u0430\u043b\u0430\u043d\u0441 \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0442.<\/p>\n<pre><code>import numpy as np  def balance_covariate (df):  \u00a0\u00a0\u00a0\u00a0t2=pd.concat([df[df['region']=='Corsica'].describe(                 datetime_is_numeric=True).round(2)[['capacity',\u00a0                 'stars', 'rating',\u00a0'dchain', 'Nreviewers',\u00a0                 'date_start_booking']].loc[['count',\u00a0'mean',                  'std']].T.rename(columns={'mean': 'mean_Corsica',\u00a0                 'std': 'std_Corsica', 'count': 'obs_Corsica'}).T,                  df[df['region']=='Sardinia'].describe(                 datetime_is_numeric=True).round(2)[['capacity',\u00a0                 'stars', 'rating',\u00a0'dchain', 'Nreviewers',\u00a0                 'date_start_booking']].loc[['count',\u00a0'mean',                  'std']].T.rename(columns={'mean': 'mean_Sardinia',\u00a0                 'std': 'std_Sardinia', 'count': 'obs_Sardinina'}).T])  \u00a0\u00a0\u00a0\u00a0t2['date_start_booking']=t2['date_start_booking'].apply(                 lambda x: x.strftime('%Y-%m-%d')                  if type(x) == pd._libs.tslibs.timestamps.Timestamp else x)  \u00a0\u00a0\u00a0\u00a0t2=t2.rename(columns={'capacity': 'Number of rooms',\u00a0'stars' : 'Star rating',                 'dchain':'Chain affiliation', 'rating' : 'Users' rating',                 'Nreviewers' : 'Number of reviewers',\u00a0'date_start_booking' : 'On Booking.com since'}).T     t2['std_Corsica'][-1]=round(np.std(df_table[df_table['region']=='Corsica'].for_std_counting),2)     t2['std_Sardinia'][-1]=round(np.std(df_table[df_table['region']=='Sardinia'].for_std_counting),2)  \u00a0\u00a0\u00a0\u00a0t_stat=[]     for i in range(0, len(t2)):         try:                   numerator=int(t2['mean_Sardinia'][i])-int(t2['mean_Corsica'][i])         except ValueError:                   date1=(int(t2['mean_Sardinia'][i].split('-')[0]) * 365 +\u00a0                   int(t2['mean_Sardinia'][i].split('-')[1].split('-')[0]) * 30                    + int(t2['mean_Sardinia'][i].split('-')[1].split('-')[-1]))\u00a0                   date2= (int(t2['mean_Corsica'][i].split('-')[0]) * 365 +\u00a0                   int(t2['mean_Corsica'][i].split('-')[1].split('-')[0]) * 30                    + int(t2['mean_Corsica'][i].split('-')[1].split('-')[-1]))                   numerator = part1-part2         denominator=((t2['std_Corsica'][i]2\/t2['obs_Corsica'][i]) + (t2['std_Sardinia'][i]2\/t2['obs_Sardinina'][i]))(1\/2)         t_stat.append(numerator\/denominator)  \u00a0\u00a0\u00a0\u00a0t2['t_\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430']=t_stat     p_value=[]     for i in range(0, len(t2)):         if abs(t2['t_\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430'][i]) &lt;= 1.645 :             p_value.append('')         elif abs(t2['t_\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430'][i]) &lt;= 1.96:             p_value.append('')         elif abs(t2['t_\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430'][i]) &lt;= 2.58:             p_value.append('')         else:             p_value.append(' ')     t2['\u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c']=p_value     t2=t2.round(2)     return (t2)  balance_covariate(df_table)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/21b\/de9\/140\/21bde914002187efe2969d10c9f8cd98.png\" width=\"1600\" height=\"374\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/21b\/de9\/140\/21bde914002187efe2969d10c9f8cd98.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u0441\u0442 \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u043d\u0430 1%-\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u0443 \u043e\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u043e\u0441\u0442\u0440\u043e\u0432\u0430\u0445 \u041a\u043e\u0440\u0441\u0438\u043a\u0438 \u0438 \u0421\u0430\u0440\u0434\u0438\u043d\u0438\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438: \u0440\u0435\u0439\u0442\u0438\u043d\u0433, \u0434\u043e\u043b\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043e\u0442\u0435\u043b\u0435\u0439, \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 Booking.com. \u0427\u0442\u043e \u0436\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a, \u0442\u043e \u0442\u0435\u0441\u0442 \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430 \u043e\u0442\u0432\u0435\u0440\u0433 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443 \u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0435 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0434\u0430\u0436\u0435 \u043d\u0430 10%-\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0435, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0438 \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e &#8212; \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0446\u0438\u0444\u0440 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c \u0436\u0435.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u044e \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<pre><code>df=df.rename(columns={'capacity': 'Number of rooms', 'stars' : 'Star rating',                        'dchain':'Chain affiliation', 'rating' : 'Users' rating',                        'Nreviewers' : 'Number of reviewers'})  df=df[['date_src', 'Number of rooms', 'Star rating', 'Chain affiliation',                        'Users' rating', 'Number of reviewers', 'breakfast',                        'freecanc', 'eurP', 'lprice100', 'panelid1415',\u00a0                        'region', 'bdays', 'sample_mac_sr', 'hot_size',                        'google_src', 'town_avail', 'treat', 'Post']].dropna()  df['Postlaw_Treated']=df['Post']df['treat']<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u041c\u041d\u041a (pooled OLS) &#8212; \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u041c\u041d\u041a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<p>Y<sub>int<\/sub> =\u03b2<sub>0<\/sub> +\u03b2\u2217X<sub>int<\/sub> +\u03b5<sub>int<\/sub>, \u0433\u0434\u0435 Y<sub>int<\/sub> &#8212; \u0446\u0435\u043d\u0430 i-\u0442\u043e\u0433\u043e \u043e\u0442\u0435\u043b\u044f n-\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430, X<sub>int<\/sub> &#8212; \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 i-\u0442\u043e\u0433\u043e \u043e\u0442\u0435\u043b\u044f n-\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430.<\/p>\n<pre><code>import statsmodels.api as sm import statsmodels.formula.api as smf from statsmodels.iolib.summary2 import summary_col import statsmodels.stats.outliers_influence as oi  reg= sm.OLS(df[['lprice100']], df[['Number of rooms',\u00a0 'Star rating',              'Chain affiliation', 'Users' rating', 'Number of reviewers',              'breakfast', 'freecanc', 'bdays']]).fit(cov_type=\"HC3\") result_table= summary_col(results = reg, stars = True) print(result_table)<\/code><\/pre>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/123\/3dd\/8e7\/1233dd8e7eac8c36599af9aefaae925a.png\" width=\"616\" height=\"925\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/123\/3dd\/8e7\/1233dd8e7eac8c36599af9aefaae925a.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438. \u041c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u0431\u044b\u0432\u0430\u044e\u0442 \u0434\u0432\u0443\u0445 \u0432\u0438\u0434\u043e\u0432: \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0438 \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435. \u041e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0432 \u0441\u0435\u0431\u044f, \u043f\u043e\u043c\u0438\u043c\u043e \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0442, \u043d\u0435\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0439 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a (\u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0443\/\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c) \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 \u0432 \u043e\u0442\u0435\u043b\u0435)\u00a0 \u0438\u043b\u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432-\u043e\u0442\u0435\u043b\u0435\u0439 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 t (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445). \u0424\u043e\u0440\u043c\u0443\u043b\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u0430\u043a: <\/p>\n<p>Y<sub>int<\/sub> =\u03b2<sub>0<\/sub> + \u03b2\u2217X<sub>int<\/sub> + <strong>\u03b1<sub>in<\/sub> <\/strong>+ \u03b5<sub>int<\/sub>, \u0433\u0434\u0435 \u03b1<sub>in<\/sub> &#8212; \u043d\u0435\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0439 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043d\u043e\u043c\u0435\u0440\u0430 \u0432 \u043e\u0442\u0435\u043b\u0435.<\/p>\n<p>Y<sub>int<\/sub> =\u03b2<sub>0<\/sub> + \u03b2\u2217X<sub>int<\/sub> + <strong>\u03bb<sub>t<\/sub> <\/strong>+ \u03b5<sub>int<\/sub>, \u03bb<sub>t<\/sub> &#8212; \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 t.<\/p>\n<p>\u0414\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>Y<sub>int<\/sub> =\u03b2<sub>0<\/sub> +\u03b2\u2217X<sub>int<\/sub> +<strong>\u03b1<sub>in<\/sub> <\/strong>+ <strong>\u03bbt<\/strong> +\u03b5<sub>int<\/sub><\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f, &#8212; \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b) \u043d\u0435\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0435 &#8212; \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0438\u0445 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432, \u043f\u0440\u0438\u0431\u0435\u0433\u043d\u0435\u043c \u043a \u0432\u043d\u0443\u0442\u0440\u0438\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u043c\u0443 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044e (\u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c):<\/p>\n<p>1 \u0448\u0430\u0433: \u041c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0430 t: Y<sub>int<\/sub> =\u03b2<sub>0<\/sub> +\u03b2\u2217X<sub>int<\/sub> +\u03b1<sub>i<\/sub> +\u03b5<sub>it<\/sub><\/p>\n<p>2 \u0448\u0430\u0433: \u041c\u043e\u0434\u0435\u043b\u044c \u0432 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438: Y<sub>\u0441\u0440<\/sub> =\u03b2<sub>0<\/sub> + \u03b2 \u2217 X<sub>\u0441\u0440<\/sub> + \u03b1 + \u03b5<sub>\u0441\u0440<\/sub><\/p>\n<p>3 \u0448\u0430\u0433: \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0441\u043b\u0435 \u0432\u043d\u0443\u0442\u0440\u0438\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f: (Y<sub>\u0441\u0440<\/sub> \u2212Y)=\u03b2\u2217(X<sub>\u0441\u0440<\/sub> \u2212X)+(\u03b5<sub>\u0441\u0440<\/sub> \u2212\u03b5)<\/p>\n<p>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u041c\u041d\u041a. \u0412\u043d\u0443\u0442\u0440\u0438\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 (3 \u0448\u0430\u0433) \u201c\u0441\u044a\u0435\u0434\u0430\u0435\u0442\u201d \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043f\u0440\u0438 \u043d\u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.\u00a0<\/p>\n<pre><code>from linearmodels.panel import PanelOLS oneway_fe=df.set_index([\"panelid1415\", \"Postlaw_Treated\"]) reg_fe1 = PanelOLS(dependent=oneway_fe['lprice100'],                      exog=oneway_fe[['Number of rooms', 'Star rating',                      'Chain affiliation', 'Users' rating', 'Number of reviewers',                     'breakfast', 'freecanc', 'bdays']],\u00a0                      entity_effects=True, time_effects=False, drop_absorbed=True) reg_fe1=reg_fe1.fit(cov_type='clustered', cluster_entity=True) reg_fe1<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/72d\/9d4\/31c\/72d9d431c38b185ed04c2dc61effce0a.png\" width=\"1033\" height=\"1319\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/72d\/9d4\/31c\/72d9d431c38b185ed04c2dc61effce0a.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 \u0432\u043d\u0443\u0442\u0440\u0438\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u043c\u0443 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u041c\u041d\u041a \u0441 \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u043b\u0438 \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 \u043e\u0442\u0435\u043b\u0435\u0439 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 <em>{\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u0435\u043b\u0435\u0439 * \u043a\u043e\u043b-\u0432\u043e \u0442\u0438\u043f\u043e\u0432 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 &#8212; 1}<\/em> \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 (\u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0441\u0435\u0433\u0434\u0430 n-1, \u0433\u0434\u0435 n &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u0438), \u0447\u0442\u043e \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043f\u0435\u0440\u0438\u043e\u0434\u0430\u043c\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u0432 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0443\u043a\u0440\u0443\u043f\u043d\u0435\u043d\u043d\u043e &#8212; post \u0440\u0430\u0432\u0435\u043d 0, \u0435\u0441\u043b\u0438 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a \u043e\u0442\u0435\u043b\u0435\u0439 \u0440\u0430\u043d\u0435\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043e\u043d\u0430 \u041c\u0430\u043a\u0440\u043e\u043d\u0430, \u0438 1, \u0435\u0441\u043b\u0438 \u0438\u043d\u0430\u0447\u0435. \u0421\u0442\u0440\u043e\u0438\u043c \u041c\u041d\u041a-\u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<pre><code>reg= sm.OLS(df[['lprice100']],\u00a0 df[['Post', 'Number of rooms',\u00a0 'Star rating',\u00a0              'Chain affiliation', 'Users' rating', 'Number of reviewers',              'breakfast', 'freecanc', 'bdays']]).fit(cov_type=\"HC3\") result_table= summary_col(results = reg, stars = True) print(result_table)<\/code><\/pre>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4e4\/2db\/631\/4e42db631c3bab91b71c42cf7820ed39.png\" width=\"651\" height=\"1002\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4e4\/2db\/631\/4e42db631c3bab91b71c42cf7820ed39.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<pre><code>twoway_fe=df.set_index([\"panelid1415\", \"Postlaw_Treated\"]) reg_fe2 = PanelOLS(dependent=twoway_fe['lprice100'],                      exog=twoway_fe[['Number of rooms',\u00a0'Star rating',\u00a0                     'Chain affiliation', 'Users' rating', 'Number of reviewers',                     'breakfast',\u00a0 'freecanc', 'bdays']],\u00a0 entity_effects=True,\u00a0                      time_effects=True, drop_absorbed=True) reg_fe2=reg_fe2.fit(cov_type='clustered', cluster_entity=True) reg_fe2<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/754\/410\/e19\/754410e1914b26601e06c95c00a03166.png\" width=\"1062\" height=\"1321\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/754\/410\/e19\/754410e1914b26601e06c95c00a03166.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438, \u0432 \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438:\u00a0<\/p>\n<p>Y<sub>int<\/sub> = \u03b2<sub>0<\/sub> + \u03b2 \u2217 X<sub>int<\/sub> + V<sub>int<\/sub> \u2013 \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438<\/p>\n<p>V<sub>int<\/sub>\u00a0 = \u03bc<sub>in<\/sub> + \u03b5<sub>int<\/sub>, \u0433\u0434\u0435 \u00a0\u03bc<sub>in<\/sub> &#8212; \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442. \u041d\u0430\u0437\u044b\u0432\u0430\u044f \u03bc<sub>in<\/sub> \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438, \u0432 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442 \u0438\u0445 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0441 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u043e\u0440\u0430\u043c\u0438. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, v<sub>int<\/sub> &#8212; \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u0430\u044f \u0433\u0435\u0442\u0435\u0440\u043e\u0441\u043a\u0435\u0434\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u043e\u0440\u044b \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0437\u043d\u0430\u0447\u0438\u0442 \u043e\u043d\u0438 \u044d\u043a\u0437\u043e\u0433\u0435\u043d\u043d\u044b, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0446\u0435\u043d\u0435\u043d\u044b \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u041c\u041d\u041a. \u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u041c\u041d\u041a-\u043e\u0446\u0435\u043d\u043a\u0438 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438, \u043d\u043e \u043d\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u041c\u041d\u041a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b (\u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u00a79.6 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0430 \u041a\u0430\u0440\u0442\u0430\u0435\u0432\u0430 [2]).<\/p>\n<pre><code>from linearmodels import RandomEffects re_df=df.set_index([\"panelid1415\", \"Postlaw_Treated\"]) re=RandomEffects(dependent=re_df['lprice100'],                    exog=re_df[['Number of rooms',\u00a0 'Star rating',                    'Chain affiliation', 'Users' rating', 'Number of reviewers',                    'breakfast', 'freecanc', 'bdays']]) re=re.fit(cov_type='clustered', cluster_entity=True) re<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fc8\/e8f\/b5d\/fc8e8fb5d2f9971e2b3989be4a5b089d.png\" width=\"1196\" height=\"597\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fc8\/e8f\/b5d\/fc8e8fb5d2f9971e2b3989be4a5b089d.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 1.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td colspan=\"6\" data-colwidth=\"0,117,117,0,117,0\" width=\"0\">\n<p align=\"left\">\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8212; lprice100<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">Pooled OLS<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">one-way time FE OLS<\/p>\n<\/td>\n<td>\n<p align=\"left\">one-way FE OLS<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">two-way FE OLS<\/p>\n<\/td>\n<td>\n<p align=\"left\">one-way RE OLS<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Number of rooms<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">0.3796**\u00a0\u00a0<\/p>\n<p align=\"left\">(0.0061)<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">0.3754***\u00a0 (0.0061)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">0.3620***<\/p>\n<p align=\"left\">(0.0152)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Star rating<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">13.6565***\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 (0.1118)<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">13.6460*** \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 (0.1117)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">17.996***(0.3050)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Chain affiliation<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">2.0396***\u00a0\u00a0(0.6428)<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">2.2568 (0.6471)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">2.3768\u00a0(1.5219)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Users&#8217; rating<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">51.1513\u00a0(0.0514)<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">50.0038***(0.0812)<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.1463***(0.6773)<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">2.4920***(0.6760)<\/p>\n<\/td>\n<td>\n<p align=\"left\">48.548***(0.1513)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Number of reviewers<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">-0.0430***\u00a0<\/p>\n<p align=\"left\">(0.0006)<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">-0.0429***<\/p>\n<p align=\"left\">(0.0006)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">-0.0306***<\/p>\n<p align=\"left\">(0.0014)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">breakfast<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">-20.1175*** \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 (0.3055)<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">-19.8334***\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 (0.3060)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">-12.481*** (0.8004)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">freecanc<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">2.4034***\u00a0\u00a0(0.2921)<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">1.9710 (0.2923)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">15.115\u00a0(0.8107)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">bdays<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">0.1873***\u00a0\u00a0(0.0064)<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">0.3229***\u00a0(0.0098)<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.0020 (0.0030)<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">-0.0145 (0.0039)<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.0062\u00a0(0.0033)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">treat<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">7.9004***(0.4297)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">R-squared<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">0.9889<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">0.9928<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Observations<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">121245<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">121245<\/p>\n<\/td>\n<td>\n<p align=\"left\">121245<\/p>\n<\/td>\n<td data-colwidth=\"117\" width=\"117\">\n<p align=\"left\">121245<\/p>\n<\/td>\n<td>\n<p align=\"left\">121245<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><em>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 1 \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/em><\/p>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u0441\u0442\u044b, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c. \u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 2.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"176\" width=\"176\">\n<p align=\"left\">\u0422\u0435\u0441\u0442<\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"left\">VS<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0415\u0441\u043b\u0438 P-value &lt; \u03b1? (\u0433\u0434\u0435 \u03b1 &#8212; \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438 0.01, 0.05, 0.1)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"176\" width=\"176\">\n<p align=\"left\">\u0422\u0435\u0441\u0442 \u0427\u043e\u0443<\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"left\">Pooled OLS vs one-way time FE OLS<\/p>\n<\/td>\n<td>\n<p align=\"left\">FE OLS<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"176\" width=\"176\">\n<p align=\"left\">\u0422\u0435\u0441\u0442 \u0425\u0430\u0443\u0441\u043c\u0430\u043d\u0430<\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"left\">FE OLS vs RE OLS<\/p>\n<\/td>\n<td>\n<p align=\"left\">FE OLS<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"176\" width=\"176\">\n<p align=\"left\">\u0422\u0435\u0441\u0442 \u0411\u0440\u0435\u0443\u0448\u0430 \u041f\u0430\u0433\u0430\u043d\u0430<\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"left\">Pooled OLS vs RE OLS<\/p>\n<\/td>\n<td>\n<p align=\"left\">RE OLS<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><em>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 2: \u0422\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/em><\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u0435\u0441\u0442\u0430 \u0427\u043e\u0443. \u0421\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0434\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 &#8212; \u0447\u0430\u0441\u0442\u044c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u043b\u0438 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0438 \u0447\u0430\u0441\u0442\u044c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<pre><code>df_for_chow=df.drop(columns=['panelid1415', 'region', 'date_src']) df_for_chow=df_for_chow.sort_values(by='treat', ascending=True).reset_index().drop(columns=['index'])  for i in range (0, len(df_for_chow)):     if df_for_chow['treat'][i]==1.0:         break_point = i         break  def linear_residuals(X, y): \u00a0\u00a0\u00a0\u00a0import pandas as pd \u00a0\u00a0\u00a0\u00a0import numpy as np     from sklearn.linear_model import LinearRegression as lr      #\u0441\u0442\u0440\u043e\u0438\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c     model = lr().fit(X, y)  \u00a0\u00a0\u00a0\u00a0# \u0441\u0442\u0440\u043e\u0438\u043c \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u0441 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438\u00a0     summary_result = pd.DataFrame(columns = ['y_hat'])     yhat_list = [float(i[0]) for i in np.ndarray.tolist(model.predict(X))]     summary_result['y_hat'] = yhat_list\u00a0\u00a0  \u00a0\u00a0\u00a0\u00a0# \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0443 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438     summary_result['y_actual'] = y.values  \u00a0\u00a0\u00a0\u00a0# \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043e\u0441\u0442\u0430\u0442\u043a\u0438     summary_result['residuals'] = summary_result.y_actual - summary_result.y_hat  \u00a0\u00a0\u00a0\u00a0# \u0432\u043e\u0437\u0432\u043e\u0434\u0438\u043c \u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442     summary_result['residuals_sq'] = summary_result.residuals ** 2     return(summary_result)  # \u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u0443\u043c\u043c\u0443 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432\u00a0 def calculate_RSS(X, y):     resid_data = linear_residuals(X, y)     rss = resid_data.residuals_sq.sum()     return(rss)  def ChowTest(X, y, last_index_in_model_1, first_index_in_model_2):     rss_pooled = calculate_RSS(X, y)     # \u0434\u0435\u043b\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u0430 \u0434\u0432\u0435 \u043f\u043e\u0434\u0432\u044b\u0431\u043e\u0440\u043a\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0435\u0441\u0442\u044c \u201c\u0441\u043b\u043e\u043c\u201d, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0438 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u043e\u043c\u0430 \u043d\u0435\u0442  \u00a0\u00a0\u00a0\u00a0X1 = X.loc[:last_index_in_model_1]     y1 = y.loc[:last_index_in_model_1]     rss1 = calculate_RSS(X1, y1)  \u00a0\u00a0\u00a0\u00a0X2 = X.loc[first_index_in_model_2:]     y2 = y.loc[first_index_in_model_2:]     rss2 = calculate_RSS(X2, y2)  \u00a0\u00a0\u00a0\u00a0# \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043b-\u0432\u043e \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u043e\u0440\u043e\u0432 + 1 \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b     k = X.shape[1] + 1  \u00a0\u00a0\u00a0\u00a0# \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043b-\u0432\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0434\u043e \u0441\u043b\u043e\u043c\u0430     N1 = X1.shape[0]  \u00a0\u00a0\u00a0\u00a0# \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043b-\u0432\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u043f\u043e\u0441\u043b\u0435 \u0441\u043b\u043e\u043c\u0430     N2 = X2.shape[0]  \u00a0\u00a0\u00a0\u00a0# \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0427\u043e\u0443     numerator = (rss_pooled - (rss1 + rss2)) \/ k  \u00a0\u00a0\u00a0\u00a0# \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0427\u043e\u0443     denominator = (rss1 + rss2) \/ (N1 + N2 - 2 * k)  \u00a0\u00a0\u00a0\u00a0# \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0427\u043e\u0443     Chow_Stat = numerator \/ denominator          # \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0427\u043e\u0443 \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0424\u0438\u0448\u0435\u0440\u0430 \u0441 k \u0438 N1 + N2 - 2k \u0441\u0442\u0435\u043f\u0435\u043d\u044f\u043c\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u044b     from scipy.stats import f          # \u0441\u0447\u0438\u0442\u0430\u044e p-value     p_value = 1 - f.cdf(Chow_Stat, dfn = 5, dfd = (N1 + N2 - 2 * k))     result = (Chow_Stat, p_value)     return(result)  ChowTest(y=df_for_chow[['lprice100']], X=df_for_chow[['Number of rooms',\u00a0          'Star rating', 'Chain affiliation',\u00a0 'Users' rating',\u00a0          'Number of reviewers',\u00a0'breakfast',\u00a0 'freecanc', 'bdays','treat']],\u00a0          last_index_in_model_1=break_point-1,\u00a0          first_index_in_model_2=break_point)[1]<\/code><\/pre>\n<p>P-value \u0442\u0435\u0441\u0442\u0430 \u0427\u043e\u0443 \u0440\u0430\u0432\u043d\u043e 0,01^(-16). \u041c\u0435\u0436\u0434\u0443 pooled OLS \u0438 one-way time FE \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c one-way time FE.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u0442\u0435\u0441\u0442 \u0425\u0430\u0443\u0441\u043c\u0430\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u0438 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<pre><code>import numpy.linalg as la from scipy import stats  def hausman(fe, re, changed_covariates):\u00a0  \u00a0\u00a0\u00a0\u00a0#\u0432\u044b\u0447\u043b\u0435\u043d\u044f\u0435\u043c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445     b = fe.params     B = re.params.loc[changed_covariates]\u00a0  \u00a0\u00a0\u00a0\u00a0#\u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443     v_b = fe.cov     v_B = re.cov[changed_covariates].loc[changed_covariates]  \u00a0\u00a0\u00a0\u00a0#\u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043b-\u0432\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u044b     df = b.size  \u00a0\u00a0\u00a0\u00a0#\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443     chi2 = np.dot((b - B).T, la.inv(v_b - v_B).dot(b - B))  \u00a0\u00a0\u00a0\u00a0#\u043d\u0430\u0445\u043e\u0434\u0438\u043c p-value     pval = stats.chi2.sf(chi2, df)     return round(chi2, 2), pval<\/code><\/pre>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438 p-value \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430 \u0425\u0430\u0443\u0441\u043c\u0430\u043d\u0430 \u043c\u0435\u0436\u0434\u0443 \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u0438 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438.\u00a0<\/p>\n<pre><code>hausman(reg_fe1, re, ['Users' rating', 'bdays']) (-10586.98, 1.0)<\/code><\/pre>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0431\u043e\u0440 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<pre><code>hausman(reg_fe2, re, ['Users' rating', 'bdays']) (4862.71, 0.0)<\/code><\/pre>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0431\u043e\u0440 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0442\u0435\u0441\u0442 &#8212; \u0442\u0435\u0441\u0442 \u0411\u0440\u0435\u0443\u0448\u0430 \u041f\u0430\u0433\u0430\u043d\u0430.<\/p>\n<pre><code>from statsmodels.compat import lzip import statsmodels.stats.api as sms names = ['p-value'] test_result = sms.het_breuschpagan(reg.resid, reg.model.exog) print('p-value \u0442\u0435\u0441\u0442\u0430 \u0411\u0440\u0435\u0443\u0448\u0430-\u041f\u0430\u0433\u0430\u043d\u0430: ' + str(test_result[1])) p-value \u0442\u0435\u0441\u0442\u0430 \u0411\u0440\u0435\u0443\u0448\u0430-\u041f\u0430\u0433\u0430\u043d\u0430: 0.0<\/code><\/pre>\n<p>\u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0442\u0435\u0441\u0442\u0430 \u0411\u0440\u0435\u0443\u0448\u0430-\u041f\u0430\u0433\u0430\u043d\u0430, \u0434\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0431\u043e\u0440 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0418\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f:<\/p>\n<p>pooled OLS > one-way time FE<\/p>\n<p>one-way FE > RE > two-way FE<\/p>\n<p>pooled OLS > RE<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u0438 \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0438\u043e\u0434\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043e\u043d\u0430 \u041c\u0430\u043a\u0440\u043e\u043d\u0430 \u0446\u0435\u043d\u0430 \u043e\u0442\u0435\u043b\u0435\u0439 \u0438 \u0432 \u0421\u0430\u0440\u0434\u0438\u043d\u0438\u0438, \u0438 \u043d\u0430 \u041a\u043e\u0440\u0441\u0438\u043a\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u043d\u0435 \u0434\u0430\u044e\u0442 \u043d\u0430\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u0446\u0435\u043d\u044b \u043f\u043e\u0441\u043b\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043e\u043d\u0430 \u041c\u0430\u043a\u0440\u043e\u043d\u0430.\u00a0<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u201c\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0435\u0439\u201d. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/710716\/\" rel=\"noopener noreferrer nofollow\">\u0432 \u0447\u0430\u0441\u0442\u0438 2<\/a>.<\/p>\n<p>\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/oluscha\/model_on_panel_data\/blob\/main\/models_on_panel_data.ipynb\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0421\u043f\u0438\u0441\u043e\u043a \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b:<\/p>\n<p>[1] Andrea Mantovani, Claudio A. Piga, Carlo Reggiani, Online platform price parity clauses: Evidence from the EU <a href=\"http:\/\/Booking.com\" rel=\"noopener noreferrer nofollow\">Booking.com<\/a> case, European Economic Review, Volume 131, 2021, 103625, ISSN 0014-2921, <a href=\"https:\/\/doi.org\/10.1016\/j.euroecorev.2020.103625\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/doi.org\/10.1016\/j.euroecorev.2020.103625<\/u><\/a>.<\/p>\n<p>[2] \u0424\u0438\u043b\u0438\u043f\u043f \u041a\u0430\u0440\u0442\u0430\u0435\u0432 \u201c\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u044d\u043a\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u043a\u0443\u201d: \u0443\u0447\u0435\u0431\u043d\u0438\u043a. \u2013 \u041c.: \u042d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0430\u043a\u0443\u043b\u044c\u0442\u0435\u0442 \u041c\u0413\u0423 \u0438\u043c\u0435\u043d\u0438 \u041c.\u0412. \u041b\u043e\u043c\u043e\u043d\u043e\u0441\u043e\u0432\u0430, 2019. \u2013 472 \u0441. ISBN 978-5-906932-22-8<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/710714\/\"> https:\/\/habr.com\/ru\/post\/710714\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><strong>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Python, \u0447\u0430\u0441\u0442\u044c 1: \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0439 \u041c\u041d\u041a, \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438, \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438.<\/strong><\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u201c\u043e\u0431\u044b\u0447\u043d\u044b\u0445\u201d \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Python: \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u041c\u041d\u041a (pooled OLS), \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 (one-way individual FE), \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 (two-way FE), \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 (one-way RE). \u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u043e\u0446\u0435\u043d\u043a\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u201c\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0435\u0439\u201d (diff-in-diff) \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c &#171;\u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c&#187;. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0435\u043b\u0435\u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/p>\n<p><u>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442:<\/u> \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u043e\u0442\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u043f\u043e \u043c\u043e\u0442\u0438\u0432\u0430\u043c \u0441\u0442\u0430\u0442\u044c\u0438 \u201cOnline platform price parity clauses: Evidence from the EU Booking.com case\u201d (Mantovani, Piga, Reggiani, 2021) [1]. \u0422\u0435\u043a\u0441\u0442 \u0441\u0442\u0430\u0442\u044c\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"https:\/\/cloud.mail.ru\/public\/eqBq\/eVTQrWW9W\" rel=\"noopener noreferrer nofollow\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>.<\/p>\n<p>\u0412 \u0418\u0442\u0430\u043b\u0438\u0438 \u0438 \u0424\u0440\u0430\u043d\u0446\u0438\u0438 \u0441\u0430\u0439\u0442 Booking.com \u043c\u043e\u0433 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043b\u043e\u043a \u0446\u0435\u043d \u043d\u0430 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0436\u0438\u043b\u044c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u043e\u0441\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. 6 \u0430\u0432\u0433\u0443\u0441\u0442\u0430 2015 \u0433\u043e\u0434\u0430 \u0432\u043e \u0424\u0440\u0430\u043d\u0446\u0438\u0438 \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u044f\u0442 \u0437\u0430\u043a\u043e\u043d \u041c\u0430\u043a\u0440\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043b \u0438\u0437 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043e\u0442\u0435\u043b\u044f\u043c\u0438 \u0438 Booking.com \u043f\u0443\u043d\u043a\u0442\u044b, \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0432\u0448\u0438\u0435 \u043e\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u043e \u0446\u0435\u043d\u0430\u043c \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0443 Booking.com. \u0426\u0435\u043b\u044c\u044e \u0437\u0430\u043a\u043e\u043d\u0430 \u041c\u0430\u043a\u0440\u043e\u043d\u0430 &#8212; \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u043e\u043d\u043e\u043f\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f Booking.com. \u0424\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u0438\u0435 \u043e\u0442\u0435\u043b\u044c\u0435\u0440\u044b \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u043b\u0438 \u0441\u0435\u0431\u044f \u0441 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043a\u043e\u043d\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u043b\u0438, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043e\u0442\u0435\u043b\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0446\u0435\u043d\u044b, \u043a\u0430\u043a \u043d\u0430 Booking.com, \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043d\u0438\u0436\u0435, \u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u0442 \u0437\u0430\u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u0443 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043e\u0442\u0435\u043b\u044f. \u0412 \u0418\u0442\u0430\u043b\u0438\u0438 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043a\u043e\u043d \u043f\u0440\u0438\u043d\u044f\u0442 \u043d\u0435 \u0431\u044b\u043b.<\/p>\n<p><u>\u0417\u0430\u0434\u0430\u0447\u0430:<\/u> \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u0446\u0435\u043d\u044b \u043d\u0430 \u043d\u043e\u043c\u0435\u0440\u0430 \u0432 \u043e\u0442\u0435\u043b\u044f\u0445 \u043f\u043e\u0441\u043b\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043e\u043d\u0430.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<pre><code>import pandas as pd df = pd.DataFrame(pd.read_stata('data_mac_sr.dta')) df.head(5)<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 &#8212; \u0432\u044b\u0447\u043b\u0435\u043d\u044f\u0435\u043c \u0440\u0435\u0433\u0438\u043e\u043d.<\/p>\n<pre><code>df['region']=df.region.apply(lambda x: x.split(' ')[0])<\/code><\/pre>\n<p>\u041d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0442\u0435\u043b\u044f\u0445 \u0434\u0432\u0443\u0445 \u043e\u0441\u0442\u0440\u043e\u0432\u043e\u0432 &#8212; \u0421\u0430\u0440\u0434\u0438\u043d\u0438\u0438 (\u0418\u0442\u0430\u043b\u0438\u044f, \u0437\u0430\u043a\u043e\u043d \u043d\u0435 \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u044f\u0442), \u041a\u043e\u0440\u0441\u0438\u043a\u0438 (\u0424\u0440\u0430\u043d\u0446\u0438\u044f, \u0437\u0430\u043a\u043e\u043d \u043e \u0437\u0430\u043f\u0440\u0435\u0442\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 Booking.com \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u044f\u0442). \u041f\u043e \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0443 \u0440\u0435\u0433\u0438\u043e\u043d\u044b \u043f\u043e\u0445\u043e\u0436\u0438 (\u0441\u043c. \u0420\u0438\u0441\u0443\u043d\u043e\u043a 1).\u00a0<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u0442\u0430\u0441\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430 4 \u043c\u0435\u0441\u044f\u0446\u0430 2015 \u0433\u043e\u0434\u0430: \u0441 \u0438\u044e\u043d\u044f \u043f\u043e \u043e\u043a\u0442\u044f\u0431\u0440\u044c 2015 \u0433\u043e\u0434\u0430. \u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0435: \u043e\u0434\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u201c\u043f\u043e\u0445\u043e\u0436\u0435\u0441\u0442\u044c\u201d \u043e\u0441\u0442\u0440\u043e\u0432\u043e\u0432 \u0438 \u043f\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c \u043e\u0442\u0435\u043b\u0435\u0439, \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0431\u0430\u043b\u0430\u043d\u0441 \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0442 \u043d\u0430 \u0441\u0430\u043c\u0443\u044e \u0440\u0430\u043d\u043d\u044e\u044e \u0434\u0430\u0442\u0443 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0435\u043b\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0435\u043b\u0435\u0439 \u0434\u043e \u0430\u043d\u043e\u043d\u0441\u0430 \u0437\u0430\u043a\u043e\u043d\u0430 \u041c\u0430\u043a\u0440\u043e\u043d\u0430. \u041f\u043e\u0441\u043b\u0435 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043e\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u043e\u0441\u0442\u0440\u043e\u0432\u0430\u0445 \u043c\u043e\u0433\u043b\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f. \u041d\u043e \u043d\u0430\u043c \u044d\u0442\u043e \u043d\u0435\u0432\u0430\u0436\u043d\u043e.<\/p>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u201c\u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u043d\u043d\u0438\u0435\u201d \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043e\u0442\u0435\u043b\u0435\u0439.<\/p>\n<pre><code>df_table=df.merge(df.groupby('urlnum', as_index=False).agg({'date_src':'min'}))<\/code><\/pre>\n<p>\u0412\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>df_table=df_table[['region', 'capacity',\u00a0 'stars', 'rating', \u00a0                      'dchain', 'Nreviewers',\u00a0 'date_start_booking']].dropna()<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043d\u0435\u0439 \u043e\u0442 00-00-0000, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>df_table['for_std_counting']=df_table['date_start_booking'].dt.day                                + df_table['date_start_booking'].dt.month * 30                                + df_table['date_start_booking'].dt.year * 365<\/code><\/pre>\n<p>\u0421\u0442\u0440\u043e\u0438\u043c \u0431\u0430\u043b\u0430\u043d\u0441 \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0442.<\/p>\n<pre><code>import numpy as np  def balance_covariate (df):  \u00a0\u00a0\u00a0\u00a0t2=pd.concat([df[df['region']=='Corsica'].describe(                 datetime_is_numeric=True).round(2)[['capacity',\u00a0                 'stars', 'rating',\u00a0'dchain', 'Nreviewers',\u00a0                 'date_start_booking']].loc[['count',\u00a0'mean',                  'std']].T.rename(columns={'mean': 'mean_Corsica',\u00a0                 'std': 'std_Corsica', 'count': 'obs_Corsica'}).T,                  df[df['region']=='Sardinia'].describe(                 datetime_is_numeric=True).round(2)[['capacity',\u00a0                 'stars', 'rating',\u00a0'dchain', 'Nreviewers',\u00a0                 'date_start_booking']].loc[['count',\u00a0'mean',                  'std']].T.rename(columns={'mean': 'mean_Sardinia',\u00a0                 'std': 'std_Sardinia', 'count': 'obs_Sardinina'}).T])  \u00a0\u00a0\u00a0\u00a0t2['date_start_booking']=t2['date_start_booking'].apply(                 lambda x: x.strftime('%Y-%m-%d')                  if type(x) == pd._libs.tslibs.timestamps.Timestamp else x)  \u00a0\u00a0\u00a0\u00a0t2=t2.rename(columns={'capacity': 'Number of rooms',\u00a0'stars' : 'Star rating',                 'dchain':'Chain affiliation', 'rating' : 'Users' rating',                 'Nreviewers' : 'Number of reviewers',\u00a0'date_start_booking' : 'On Booking.com since'}).T     t2['std_Corsica'][-1]=round(np.std(df_table[df_table['region']=='Corsica'].for_std_counting),2)     t2['std_Sardinia'][-1]=round(np.std(df_table[df_table['region']=='Sardinia'].for_std_counting),2)  \u00a0\u00a0\u00a0\u00a0t_stat=[]     for i in range(0, len(t2)):         try:                   numerator=int(t2['mean_Sardinia'][i])-int(t2['mean_Corsica'][i])         except ValueError:                   date1=(int(t2['mean_Sardinia'][i].split('-')[0]) * 365 +\u00a0                   int(t2['mean_Sardinia'][i].split('-')[1].split('-')[0]) * 30                    + int(t2['mean_Sardinia'][i].split('-')[1].split('-')[-1]))\u00a0                   date2= (int(t2['mean_Corsica'][i].split('-')[0]) * 365 +\u00a0                   int(t2['mean_Corsica'][i].split('-')[1].split('-')[0]) * 30                    + int(t2['mean_Corsica'][i].split('-')[1].split('-')[-1]))                   numerator = part1-part2         denominator=((t2['std_Corsica'][i]2\/t2['obs_Corsica'][i]) + (t2['std_Sardinia'][i]2\/t2['obs_Sardinina'][i]))(1\/2)         t_stat.append(numerator\/denominator)  \u00a0\u00a0\u00a0\u00a0t2['t_\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430']=t_stat     p_value=[]     for i in range(0, len(t2)):         if abs(t2['t_\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430'][i]) &lt;= 1.645 :             p_value.append('')         elif abs(t2['t_\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430'][i]) &lt;= 1.96:             p_value.append('')         elif abs(t2['t_\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430'][i]) &lt;= 2.58:             p_value.append('')         else:             p_value.append(' ')     t2['\u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c']=p_value     t2=t2.round(2)     return (t2)  balance_covariate(df_table)<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u0441\u0442 \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u043d\u0430 1%-\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u0443 \u043e\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u043e\u0441\u0442\u0440\u043e\u0432\u0430\u0445 \u041a\u043e\u0440\u0441\u0438\u043a\u0438 \u0438 \u0421\u0430\u0440\u0434\u0438\u043d\u0438\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438: \u0440\u0435\u0439\u0442\u0438\u043d\u0433, \u0434\u043e\u043b\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043e\u0442\u0435\u043b\u0435\u0439, \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 Booking.com. \u0427\u0442\u043e \u0436\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a, \u0442\u043e \u0442\u0435\u0441\u0442 \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430 \u043e\u0442\u0432\u0435\u0440\u0433 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443 \u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0435 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0434\u0430\u0436\u0435 \u043d\u0430 10%-\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0435, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0438 \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e &#8212; \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0446\u0438\u0444\u0440 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c \u0436\u0435.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u044e \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<pre><code>df=df.rename(columns={'capacity': 'Number of rooms', 'stars' : 'Star rating',                        'dchain':'Chain affiliation', 'rating' : 'Users' rating',                        'Nreviewers' : 'Number of reviewers'})  df=df[['date_src', 'Number of rooms', 'Star rating', 'Chain affiliation',                        'Users' rating', 'Number of reviewers', 'breakfast',                        'freecanc', 'eurP', 'lprice100', 'panelid1415',\u00a0                        'region', 'bdays', 'sample_mac_sr', 'hot_size',                        'google_src', 'town_avail', 'treat', 'Post']].dropna()  df['Postlaw_Treated']=df['Post']df['treat']<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u041c\u041d\u041a (pooled OLS) &#8212; \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u041c\u041d\u041a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0430\u043d\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<p>Y<sub>int<\/sub> =\u03b2<sub>0<\/sub> +\u03b2\u2217X<sub>int<\/sub> +\u03b5<sub>int<\/sub>, \u0433\u0434\u0435 Y<sub>int<\/sub> &#8212; \u0446\u0435\u043d\u0430 i-\u0442\u043e\u0433\u043e \u043e\u0442\u0435\u043b\u044f n-\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430, X<sub>int<\/sub> &#8212; \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 i-\u0442\u043e\u0433\u043e \u043e\u0442\u0435\u043b\u044f n-\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430.<\/p>\n<pre><code>import statsmodels.api as sm import statsmodels.formula.api as smf from statsmodels.iolib.summary2 import summary_col import statsmodels.stats.outliers_influence as oi  reg= sm.OLS(df[['lprice100']], df[['Number of rooms',\u00a0 'Star rating',              'Chain affiliation', 'Users' rating', 'Number of reviewers',              'breakfast', 'freecanc', 'bdays']]).fit(cov_type=\"HC3\") result_table= summary_col(results = reg, stars = True) print(result_table)<\/code><\/pre>\n<figure class=\"float full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438. \u041c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u0431\u044b\u0432\u0430\u044e\u0442 \u0434\u0432\u0443\u0445 \u0432\u0438\u0434\u043e\u0432: \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0438 \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435. \u041e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0432 \u0441\u0435\u0431\u044f, \u043f\u043e\u043c\u0438\u043c\u043e \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0442, \u043d\u0435\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0439 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a (\u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0443\/\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c) \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 \u0432 \u043e\u0442\u0435\u043b\u0435)\u00a0 \u0438\u043b\u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432-\u043e\u0442\u0435\u043b\u0435\u0439 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 t (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445). \u0424\u043e\u0440\u043c\u0443\u043b\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u0430\u043a: <\/p>\n<p>Y<sub>int<\/sub> =\u03b2<sub>0<\/sub> + \u03b2\u2217X<sub>int<\/sub> + <strong>\u03b1<sub>in<\/sub> <\/strong>+ \u03b5<sub>int<\/sub>, \u0433\u0434\u0435 \u03b1<sub>in<\/sub> &#8212; \u043d\u0435\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0439 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043d\u043e\u043c\u0435\u0440\u0430 \u0432 \u043e\u0442\u0435\u043b\u0435.<\/p>\n<p>Y<sub>int<\/sub> =\u03b2<sub>0<\/sub> + \u03b2\u2217X<sub>int<\/sub> + <strong>\u03bb<sub>t<\/sub> <\/strong>+ \u03b5<sub>int<\/sub>, \u03bb<sub>t<\/sub> &#8212; \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 t.<\/p>\n<p>\u0414\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>Y<sub>int<\/sub> =\u03b2<sub>0<\/sub> +\u03b2\u2217X<sub>int<\/sub> +<strong>\u03b1<sub>in<\/sub> <\/strong>+ <strong>\u03bbt<\/strong> +\u03b5<sub>int<\/sub><\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f, &#8212; \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b) \u043d\u0435\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0435 &#8212; \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0438\u0445 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432, \u043f\u0440\u0438\u0431\u0435\u0433\u043d\u0435\u043c \u043a \u0432\u043d\u0443\u0442\u0440\u0438\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u043c\u0443 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044e (\u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c):<\/p>\n<p>1 \u0448\u0430\u0433: \u041c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0430 t: Y<sub>int<\/sub> =\u03b2<sub>0<\/sub> +\u03b2\u2217X<sub>int<\/sub> +\u03b1<sub>i<\/sub> +\u03b5<sub>it<\/sub><\/p>\n<p>2 \u0448\u0430\u0433: \u041c\u043e\u0434\u0435\u043b\u044c \u0432 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438: Y<sub>\u0441\u0440<\/sub> =\u03b2<sub>0<\/sub> + \u03b2 \u2217 X<sub>\u0441\u0440<\/sub> + \u03b1 + \u03b5<sub>\u0441\u0440<\/sub><\/p>\n<p>3 \u0448\u0430\u0433: \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0441\u043b\u0435 \u0432\u043d\u0443\u0442\u0440\u0438\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f: (Y<sub>\u0441\u0440<\/sub> \u2212Y)=\u03b2\u2217(X<sub>\u0441\u0440<\/sub> \u2212X)+(\u03b5<sub>\u0441\u0440<\/sub> \u2212\u03b5)<\/p>\n<p>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u041c\u041d\u041a. \u0412\u043d\u0443\u0442\u0440\u0438\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 (3 \u0448\u0430\u0433) \u201c\u0441\u044a\u0435\u0434\u0430\u0435\u0442\u201d \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043f\u0440\u0438 \u043d\u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.\u00a0<\/p>\n<pre><code>from linearmodels.panel import PanelOLS oneway_fe=df.set_index([\"panelid1415\", \"Postlaw_Treated\"]) reg_fe1 = PanelOLS(dependent=oneway_fe['lprice100'],                      exog=oneway_fe[['Number of rooms', 'Star rating',                      'Chain affiliation', 'Users' rating', 'Number of reviewers',                     'breakfast', 'freecanc', 'bdays']],\u00a0                      entity_effects=True, time_effects=False, drop_absorbed=True) reg_fe1=reg_fe1.fit(cov_type='clustered',<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-343956","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=343956"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343956\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=343956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=343956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=343956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}