I want to perform regressions. For one of the regressions, the independent variable is…
- User
I want to perform regressions.
For one of the regressions, the independent variable is binary (0,1) with excessive zeros. For another regression, the independent variable is the absolute value of something (so all my values will be positive).
The independent and control variables are binary and continuous.
I was wondering whether you are familiar with doing such regressions (maybe zero inflated models, or logistic, poisson, tobit, ... you might know what is more fitting).
So basically each company has a financial goal and a social goal. To set the financial goal for the year t, we have two things we look at : the history of our financial performance (this is the historical aspiration of the financial goal) and how other companies in the same industry are performing (this is the social aspiration of the financial goal).
D.V. Accounting Fraud: “Following Liu (2016), we construct an accounting fraud dummy that is equal to one if the firm has experienced one of the following events in a given year, and zero otherwise. First, the firm is subject to class action lawsuits in a given year. We identify 216 lawsuit events in our sample using data from the Securities Class Action Clearinghouse (SCAC) Website. SCAC is widely used in corporate misconduct literature to capture firm-level fraud (e.g., Dyck et al., 2010; and Wang et al., 2010). Second, earnings are misstated in that firm year. We use the SEC’s Accounting and Auditing Enforcement Releases 10b-5 (AAER) to identify misstatement. AAER consists of firm misstatement events.” And I added to them an event which is Accounting Controversies: Is the company under the spotlight of the media because of a controversy linked to aggressive or non-transparent accounting issues? I got this from REFINITIV database. So basically, if the company has experienced at least one of the three events above then, I put 1 in the sample, if not, then 0. So if in AAER, SCAC, and/or REFINITIV databases they say that there is fraud, then the value is 1 if neither says that there is fraud then it's 0
So basically each company has a financial goal and a social goal. To set the financial goal for the year t, we have two things we look at : the history of our financial performance (this is the historical aspiration of the financial goal) and how other companies in the same industry are performing (this is the social aspiration of the financial goal). To set the social goal for the year t, we have two things we look at : the history of our performance on the social goal (this is the historical aspiration of the social goal) and how other companies in the same industry are performing (this is the social aspiration of the social goal). So the financial goal has a historical aspiration and social aspiration and the social goal has a historical aspiration and a social aspiration We will need to run 5 regressions (4 of them are the same but you just change the I.V. and the 5th one I have to talk to you about) For the first 4, I will do Accounting Fraud vs Whether we attained the aspiration i.e.
- Assistant
- User
example of my excel file "Year CUSIP NAME ROA-T-SAMPLE FIN-Diff-HA-T-Dummy FIN-SA-Diffl-T-Dummy EXTRACTIVE PROCESSING EQPT-MANUFACTURING ELECTRICAL-AND-ELECTRONICS TEXTILES-AND-APPAREL CONSUMABLES OTHER-MANUFACTURING TRADE Debt-to-Equity Ticker Year_2016 Year_2017 Year_2018 Year_2019 Year_2020 Year_2021 Duality CEO-Age Tenure CEO-Gender-Dummy Size-AssetsLog Size-Employees(Log) Audit-Committee-Independence-Score Independent-Board-Members Social-Score Dummy-SA-Social-Score SCAC-AAER-REFINITIV Systematic-Risk-Final Non-Systematic-Risk Label-Social-HA-Dummy 2017 001055102 AFLAC INC 0,033552694 1 1 0 0 0 0 0 0 0 1 4,578380356 AFL 0 1 0 0 0 0 1 65 28,01643836 0 5,13740792 1,05376969 56,88231246 80 71,1440391 1 0 0,000840527 0,00084161 1 2018 001055102 AFLAC INC 0,020796832 0 1 0 0 0 0 0 0 0 1 4,984400307 AFL 0 0 1 0 0 0 1 66 29,01643836 0 5,147385667 1,056523724 56,23962828 85,71428571 60,68646816 1 1 0,000714854 0,001161144 0 2019 001055102 AFLAC INC 0,021627566 0 1 0 0 0 0 0 0 0 1 4,27532028 AFL 0 0 0 1 0 0 1 67 30,01643836 0 5,184032393 1,069260986 55,57309757 91,66666667 60,26116425 1 0 0,000262991 0,001062244 0 2020 001055102 AFLAC INC 0,028942491 1 1 0 0 0 0 0 0 0 1 3,919276498 AFL 0 0 0 0 1 0 1 68 31,01917808 0 5,217710245 1,079289806 55,37650602 91,66666667 54,37132557 1 0 0,002218354 0,002430616 0 2021 001055102 AFLAC INC 0,027452997 1 1 0 0 0 0 0 0 0 1 3,737677804 AFL 0 0 0 0 0 1 1 69 32,01917808 0 5,197396355 1,09506469 55,24585477 90,90909091 55,97239779 1 0 0,002474949 0,00266897 0 2017 00130H105 AES CORP (THE) -0,035062817 0 0 0 1 0 0 0 0 0 0 5,661506708 AES 0 1 0 0 0 0 0 59 6,257534247 0 4,519985413 1,021189299 56,88231246 90,90909091 66,80234626 1 0 0,001305581 0,002622397 1 2018 00130H105 AES CORP (THE) 0,036991482 1 1 0 1 0 0 0 0 0 0 4,646324054 AES 0 0 1 0 0 0 0 60 7,257534247 0 4,512163891 0,954242509 56,23962828 90,90909091 69,85093526 1 0 0,001055541 0,003098117 1 2019 00130H105 AES CORP (THE) 0,009004993 1 1 0 1 0 0 0 0 0 0 5,265060241 AES 0 0 0 1 0 0 0 61 8,257534247 0 4,526959255 0,903089987 55,57309757 90,90909091 72,96485993 1 0 0,000839483 0,002599602 1 2020 00130H105 AES CORP (THE) 0,001329365 0 0 0 1 0 0 0 0 0 0 6,146398305 AES 0 0 0 0 1 0 0 62 9,260273973 0 4,539113753 0,913813852 55,37650602 90,90909091 77,2178615 1 0 0,001552493 0,003593327 1
- Assistant
- User
give me the script in pythpon
- Assistant
- User
- Assistant
- User
can you add analysis correllation and give all the code
- Assistant
- User
did you include all the column "Year CUSIP NAME ROA-T-SAMPLE FIN-Diff-HA-T-Dummy FIN-SA-Diffl-T-Dummy EXTRACTIVE PROCESSING EQPT-MANUFACTURING ELECTRICAL-AND-ELECTRONICS TEXTILES-AND-APPAREL CONSUMABLES OTHER-MANUFACTURING TRADE Debt-to-Equity Ticker Year_2016 Year_2017 Year_2018 Year_2019 Year_2020 Year_2021 Duality CEO-Age Tenure CEO-Gender-Dummy Size-AssetsLog Size-Employees(Log) Audit-Committee-Independence-Score Independent-Board-Members Social-Score Dummy-SA-Social-Score SCAC-AAER-REFINITIV Systematic-Risk-Final Non-Systematic-Risk Label-Social-HA-Dummy " and if ther is way to add feature or to remove feature tha can help
- Assistant
- User
can you add it to the script
- Assistant
- User
Index(['Year', 'CUSIP', 'NAME', 'ROA-AVG-SAMPLE', 'FIN-Diff-HA-AVG-dummy', 'FIN-SA-Diff-AVG-Dummy', 'EXTRACTIVE', 'PROCESSING', 'EQPT-MANUFACTURING', 'ELECTRICAL-AND-ELECTRONICS', 'TEXTILES-AND-APPAREL', 'CONSUMABLES', 'OTHER-MANUFACTURING', 'TRADE', 'Debt-to-Equity', 'Ticker', 'Year_2016', 'Year_2017', 'Year_2018', 'Year_2019', 'Year_2020', 'Year_2021', 'Duality', 'CEO-Age', 'Tenure', 'CEO-Gender-Dummy', 'Size-AssetsLog', 'Size-Employees(Log)', 'Audit-Committee-Independence-Score', 'Independent-Board-Members', 'Social-Score', 'Dummy-SA-Social-Score', 'SCAC-AAER-REFINITIV', 'Systematic-Risk-Final', 'Non-Systematic-Risk', 'Label-Social-HA-Dummy'], dtype='object')
- Assistant
- User
KeyError Traceback (most recent call last) Cell In[33], line 21 13 # Uncomment and adjust the following line if your numeric columns contain commas 14 # df['ROA-AVG-SAMPLE'] = df['ROA-AVG-SAMPLE'].str.replace(',', '.').astype(float) 15 16 # Convert categorical variables to 'category' data type for regression 17 industry_vars = [ 18 'EXTRACTIVE', 'PROCESSING', 'EQPT_MANUFACTURING', 'ELECTRICAL_AND_ELECTRONICS', 19 'TEXTILES_AND_APPAREL', 'CONSUMABLES', 'OTHER_MANUFACTURING', 'TRADE' 20 ] ---> 21 df[industry_vars] = df[industry_vars].astype('category') 22 df['Duality'] = df['Duality'].astype('category') 23 df['CEO-Gender-Dummy'] = df['CEO-Gender-Dummy'].astype('category')
File c:\Users\ayelg\anaconda3\Lib\site-packages\pandas\core\frame.py:3767, in DataFrame.getitem(self, key) 3765 if is_iterator(key): 3766 key = list(key) -> 3767 indexer = self.columns._get_indexer_strict(key, "columns")[1] 3769 # take() does not accept boolean indexers 3770 if getattr(indexer, "dtype", None) == bool:
- Assistant
- User
can you clean the data befor
- Assistant
- User
can you change the name of df to meaningful names
- Assistant
Certainly! Choosing meaningful variable names is a good programming practice as it makes your code easier to read and understand. When selecting names for your DataFrame, you want to consider what the data represents. Here's how you might rename
dfto a more descriptive name within the script:Let's assume your dataset contains financial information about companies. A meaningful name could be .