Questions tagged [dta]
37 questions
1
vote
2 answers
Opening Stata 16 .dta in R or Python?
I lost access to my Stata license and need to edit some .dta files for a school project. I've already tried the solutions in this post and this post, but I keep getting error messages saying that they're not Stata 5-12 files (in R) and that they're…

TheLOLMinecrafter
- 11
- 4
1
vote
0 answers
How to check or predict size of new index before creating (based on table content, index column types, ...) in SQL Server?
As in topic, Does any tool like DTA ot hypothetical indexes provide such an info?

Janek Podwysocki
- 543
- 1
- 6
- 18
1
vote
2 answers
Encoding Error of Reading .dta Files with Chinese Characters
I am trying to read .dta files with pandas:
import pandas as pd
my_data = pd.read_stata('filename', encoding='utf-8')
the error message is:
ValueError: Unknown encoding. Only latin-1 and ascii supported.
other encoding formality also didn't work,…

Jiahui Zhang
- 538
- 1
- 5
- 12
1
vote
0 answers
Merging large amount of columns, filewriting error in R
I am currently trying to extract rainfall data from Mexico from the CHIRPS database. The goal is to get a comprehensive database of monthly rainfall over a period of 15 years. This involves merging a lot of columns after extracting the data from…

Verena W.
- 11
- 2
1
vote
2 answers
Database Engine Tuning Advisor "Failed to parse XML file"
When loading a .sql file in Database Engine Tuning Advisor you get "Failed to parse XML file"

Leo Gurdian
- 2,109
- 17
- 20
1
vote
1 answer
ASSEMBLY DTA file attributes, size, name etc
I'm working with assembly for a school project and my assigments in few words requires to find files that match the given extension (*.txt, *.exe etc) and print out that file's size, date, file name etc. So far I've managed to successfully find…

Aivaras
- 23
- 4
1
vote
0 answers
Convert Stata 13 .dta file to CSV without using stata
Edit: I know that this question is marked duplicate but I don't think it is and I still do not have a response that I find adequate so I reframed the question to try and make it clear exactly what I want and that I do not have any version of…

user103828
- 156
- 8
0
votes
1 answer
How to “use” files with names that include certain text?
I'm importing files through a loop:
forvalues y=2010/2022 {
use "file`y'V1.dta"
[making changes]
save “file`y'.dta”
}
Problem is that some of the filenames have "V2" or "V3" instead of "V1".
How can I "ignore" this part? In some…

Victor Nielsen
- 443
- 2
- 14
0
votes
1 answer
Stata error 1001 Dataset contains more than 2 gigaobs (billion observations)
For an assignment I am required to download a dta file and answer some questions on a do file. However, when I type the command "use" on Stata and select the dta file, I get the response:
too many observations
{p 4 4 2}
Dataset contains more than
2…
0
votes
0 answers
R: Read specific columns of .dta file and converting variable names to lower case without reading whole file
I have a folder with multiple .dta files and I'm using the read_dta() function of the haven library to bind them. The problem is that some of the files have thier column names in lower case and others have them in upper case.
I was wondering if…

georgehj
- 13
- 3
0
votes
0 answers
Error message that my dataset does not exist when I try to load a dta file into R
I am trying to load DTA file into R. How do I get a file to exist that R tells me doesn't exist when I am trying to load it? I have also tried loading an SAV file through SPSS in the import dataset function in R but I get the same error message that…

Irene
- 11
- 2
0
votes
0 answers
Unable to read big stata (.dta) file in chunks in python (pyreadstat)
I am trying to read a 34Gb stata file but getting an error. So just to make sure I tried the same code on an 11Mb file.
The code is:
import pyreadstat
dtafile = 'E:/Work/test file.dta'
reader = pyreadstat.read_file_in_chunks(pyreadstat.read_dta,…

Gaju_masare
- 25
- 6
0
votes
1 answer
Converting an Excel file into a dta. (stata) file
I want to merge one using file (which is an Excel file) onto the masterfile in Stata. Might be easy but I don't know how to save the Excel
file into a dta file so that I am, in turn, able to merge the two data sets in Stata.
I have read about the…

Bella
- 11
- 1
- 5
0
votes
1 answer
file "(...).csv" not Stata file error in using merge command
I use Stata 12.
I want to add some country code identifiers from file df_all_cities.csv onto my working data.
However, this line of code:
merge 1:1 city country using "df_all_cities.csv", nogen keep(1 3)
Gives me the error:
. run…

Victor Nielsen
- 443
- 2
- 14
0
votes
1 answer
Stata Loop for a series of actions on three separate dta files
I'm trying to create a loop within Stata to apply a series of actions (including a merge, replacing missing values, replacing a date variable, sorting, and saving) to 3 different dta files (menin.dta, Bmenin.dta, and nonBmenin.dta). Below I have…

bkGeog
- 39
- 6