singular matrix problem in R and Eview.

946 views
Skip to first unread message

Ravindra Nath Shukla

unread,
Jul 23, 2022, 8:02:50 PM7/23/22
to dataanalys...@googlegroups.com
@Neeraj sir and Mikhlesh sir 

Good evening sir, 
Sir,  I am working on leverage adjustment using the system GMM estimation model. 
My model contains firms' specific variables as well as macroeconomic variables.
Sir, I'm facing a singular matrix problem while performing the system GMM in R and Eviews. 
Macroeconomic variables in my study change over time but not across entities (such as GDP growth, inflation, and interest rate). 
Please look at the attached CSV file and R code, and suggest how to arrange my data to overcome the singular matrix problem. 

I'm running the following code on R : # System GMM > 
system_gmm =pgmm(DR~lag(DR)+Age+Size+AST+GR+NDTS+LQ+ROA+CCF+GDP+INF+INT+SMD+CFIN+UEMP|lag(DR, 2:99), mydata, index= c("Company.Name","FY"), model="twostep", effect ="twoways",collapse = TRUE, transformation = "ld" )
 and it returns the following error : 
Error in solve.default(crossprod(WX, t.CP.WX.A1)) : system is computationally singular: reciprocal condition number = 2.21118e-69 
In addition: Warning message: In pgmm(DR ~ lag(DR) + Age + Size + AST + GR + NDTS + LQ + ROA + : the first-step matrix is singular, a general inverse is used. 

Thanks & Regards
Ravindra Nath Shukla

PhD./Research Scholar 

ABV IIITM Gwalior.

GMM_A1_Auto.R
A1_Auto.csv

Ravindra Nath Shukla

unread,
Jul 24, 2022, 2:10:02 AM7/24/22
to dataanalys...@googlegroups.com
Please guide me how to do my dataset management. 

My dataset contains firm-specific variables of corporate firms (such as leverage, ast, gr, ndts etc)  from one economy with macroeconomic variables (such as GDP, Inf, SMD, rint, FDIG etc.) . 

Since all firms belong to the same economy, their macroeconomic variables tend to be the same for all cross-sectional subjects or firms.

Please have a look at my attached files and suggest to me
1. How to manage all data in the same data file
2. IF we need to use two different datasets containing firm-specific variables and one only macroeconomic variable yearly, then how can we use them in R/eviews/stata to have GMM estimation. 
A1_Auto.csv

Miklesh Yadav

unread,
Jul 24, 2022, 11:18:51 AM7/24/22
to dataanalysistraining
Dear Ravindra Nath Jee,

Singular matrix problems occurs because of any of following reasons:

1) If your data have missing values .
2) If there is linear dependency.
3) Because of duplicacy   of the cross sectional unit or time period

Regards

--
Protocols of this Group:
 
1. Plz search previous post in group before posing the question.
2. Don't write query in someone's post. Always use the option of New topic for the new question. You can do this by writing to dataanalys...@googlegroups.com
3. Its better to give a proper subject to your post/query. It'll help others while searching.
4. Never write Open ended queries. This group intend to help research scholars NOT FOR WORK THEM.
5. Never write words like URGENT in ur posts. People will help them when they are free.
6. Never upload any info about National Seminars/Conferences. Send such info on personal emails. And feel free to share any RESEARCH related info.
7. No Happy New Year, Happy Diwali, Happy Holi, Happy B'day, Happy Anniversary etc. allowed on this group.
8. Few months back there was a facility for asking & sharing the Research Papers. Now there is no provision of asking for the research paper here.
 
Let’s make a better research environment.
---
You received this message because you are subscribed to the Google Groups "DataAnalysis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataanalysistrai...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataanalysistraining/CAKpQ6wv7QvtJ8Ft0h%2Bf2b2jyJV3QDn-_TVLn65kNSYpBsj-8pg%40mail.gmail.com.

Ravindra Nath Shukla

unread,
Jul 24, 2022, 11:04:49 PM7/24/22
to dataanalys...@googlegroups.com
@Miklesh sir

Thank you for your response, sir, 

Sir, you rightly pointed out (point-3 : Because of duplicacy   of the cross sectional unit or time period) 


My dataset contains macroeconomic variables such as GDP, for example, along with firm-specific variables of firms. 

These macroeconomic variables changes with time but do not change with cross-sections. Like GDP for firms A, B, C, and D for year 1 are identical for year 2 is same and so on. 

Please guide me in such a scenario; what is the possible way to use such variables in my study,  as macroeconomics significantly influences corporate financial decisions. 

Thank you

Regards 
Ravindra


Reply all
Reply to author
Forward
0 new messages