I had a dataset which didn't contain month or year columns (I imported monthly spss file with no date column) and created a date column like this:
*created year and month values when I imported (in a loop) like this
gen year= 2020
gen month=`i'
*Created a monthdate column
gen monthdate = ym(year, month)
format monthdate %tm
I then wanted to drop the month of January but I keep getting an error (r(198)). Does this have to do with my data type?
*drop jan 2020
drop if monthdate == 2020m1
I also tried putting 2020m1 in quotations ("2020m1") but I got error r(109).
What am I missing?
Related Posts with How to drop date row from dataset
Transposing data from 2nd column onward + mergingHello everyone, I am fairly new to stata, so I have some issues with converting my data file into s…
Setting panel data observations to same baselineHello, I have panel data for arrivals in 116 municipalities from 1960-2018. I want to generate the…
'Reshape Command'Dear all I am using the South African National Income Dynamics Survey (NIDs) and have successively …
Accounting and FinanceHi, I am working with two groups; high intangible and low intangible firms. My objective is to find …
Creating 'household income per capita' variableDear all I am using the South African National Income Dynamics Survey (NIDs) and have successively …
Subscribe to:
Post Comments (Atom)
0 Response to How to drop date row from dataset
Post a Comment