<p>You can set them as panel data but you need to either aggregate data for the same firm over same year, or set up id which is not created for just bank, but for every bank-nace combination (be warned that this will also lead to change in interpretation of fixed effects and the model in general).</p>
<p>You can also treat it as a pooled cross-section, that is always allowed but then you do not get all the benefits that come with panel models.</p>

CC BY-SA 4.0
2022-11-24T12:22:55.343Z
Thank you I will try to take this into consideration and cluster all the bank-nace combination into one identifier. But after giving it a thought would a differences-in-difference (using a year dummy) solve the identification problem.
Bella
CC BY-SA 4.0
2022-11-24T12:02:24.310Z
2022-11-24T12:02:24.310Z
1muflon1
<p>Given a 1 year (2019-2020) panel data set with around 3650 observations I have faced some issues when setting up the data in Stata. My intention is to see if the pandemic resulted in any effects on the bank-lending levels to greener vs browner sectors.</p>
<p>The data looks like this in Excel for one bank, in one country, during one year:</p>
<p><a href="https://i.sstatic.net/ZLcIn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZLcIn.png" alt="" /></a></p>
<p>Variables: gca is the volume of loans, nace is the classified industry, em are the carbon intensities per industry.</p>
<p>After creating bankid's sorting the data as <code>sort bankid year</code> in Stata I wanted to declare the data set as a panel with the command <code>xtset bankid year</code>. When doing so I get the error code r(451), namely</p>
<blockquote>
<p>&quot;repeated time values within panel&quot;</p>
</blockquote>
<p>After doing some research about this error code I realize that I have maybe done the set up all wrong. This is because for all the examples I have been given there are at least three years or more per idvariable, however in this situation I have repeated time values per bank.</p>
<p>This leads me to my <strong>initial question</strong> if I should set this kind of data set up as a panel or if it should be viewed as cross-sectional data set as it is only year availability in terms of data.</p>
<p>Would really appreciate your help on this and if any clarifications should be done please let me know.</p>

<econometrics><paneldata><stata>
Setting up a panel data set - 2019-2020 sample
Bella
# Setting up a panel data set - 2019-2020 sample

(Asked by: username_0 on 2022-11-24)

Given a 1 year (2019-2020) panel data set with around 3650 observations I have faced some issues when setting up the data in Stata. My intention is to see if the pandemic resulted in any effects on the bank-lending levels to greener vs browner sectors.

The data looks like this in Excel for one bank, in one country, during one year:

[![](https://i.sstatic.net/ZLcIn.png)](https://i.sstatic.net/ZLcIn.png)

Variables: gca is the volume of loans, nace is the classified industry, em are the carbon intensities per industry.

After creating bankid's sorting the data as `sort bankid year` in Stata I wanted to declare the data set as a panel with the command `xtset bankid year`. When doing so I get the error code r(451), namely

> "repeated time values within panel"

After doing some research about this error code I realize that I have maybe done the set up all wrong. This is because for all the examples I have been given there are at least three years or more per idvariable, however in this situation I have repeated time values per bank.

This leads me to my **initial question** if I should set this kind of data set up as a panel or if it should be viewed as cross-sectional data set as it is only year availability in terms of data.

Would really appreciate your help on this and if any clarifications should be done please let me know.

**Tags:** econometrics, paneldata, stata

---

## 1 answers

### Answer by username_1 on 2022-11-24. Score: 0

You can set them as panel data but you need to either aggregate data for the same firm over same year, or set up id which is not created for just bank, but for every bank-nace combination (be warned that this will also lead to change in interpretation of fixed effects and the model in general).

You can also treat it as a pooled cross-section, that is always allowed but then you do not get all the benefits that come with panel models.

> **Comments:**
> **username_0**: Thank you I will try to take this into consideration and cluster all the bank-nace combination into one identifier. But after giving it a thought would a differences-in-difference (using a year dummy) solve the identification problem.  

---

