Hello,
I have a string variable (str10) which I want to convert into date so i can add and subtract days.
Array
This string variable is formatted in the ddmmyyyy format but some of the values are recoded as "NA" or "na" if the date is missing. When I use
gen new_date_variable = date(date_variable, dmy)
Stata just returns missing values for all.
Could anyone suggest what is the problem and how should i rectify ? Many Thanks
Related Posts with converting string to date returns missing values
Suest for gmm?Dear all, I would like to test the coefficient estimates obtained from the same GMM model run on two…
Help using cond and collpase in a panel gravity modelDear all, I am a bit confused and I would be happy to get some suggestions. Here is the problem. I …
Calculating proportion by cluster instead of individual observationsThe survey collected data on income (low 0/average 5 /higher 12) and access to electricity (yes 1/no…
Generating new variables based on a variable naming conventionDear Statalist, I hope this finds you well - my first post so please be gentle. I regularly use dat…
Counting distinct values cumulatively by groupDear Statalist, I have a question about constructing count variable. Please refer to my sample data…
Subscribe to:
Post Comments (Atom)
0 Response to converting string to date returns missing values
Post a Comment