stata Questions
2
Solved
Google R style guide suggests line length of maximum 80 characters. I was wondering how do I set the line length in R. In stata this is done as:
set linesize 80
3
We're working on panel data, and there is a command in Stata, xtsum, that gives you within and between variance for the variables in the data set.
Is there a similar command for R, that produces cl...
Ona asked 14/3, 2018 at 15:43
4
Solved
. sysuse auto, clear
(1978 Automobile Data)
. di "I am getting some summary statistics for PRICE"
I am getting some summary statistics for PRICE
. su price
Variable | Obs Mean Std. Dev. Min Max...
Crochet asked 26/3, 2013 at 16:58
1
Objective
I am converting a vector of strings of the following format "MM/DD/YYYY HH:MM:SS" to a Stata recognizable datetime using the clock() function.
The problem
The resulting converte...
Musaceous asked 17/10, 2021 at 17:16
2
I'm trying to conduct a multivariate multiple regression analysis. Fortunately, I've found an excellent page demonstrating how to do so in Stata:
http://www.ats.ucla.edu/stat/stata/dae/mvreg.htm
...
Millicentmillie asked 3/12, 2016 at 21:27
1
Solved
Until now the pandas function df.to_stata() worked just fine with my datasets.
I am trying to export a dataframe that includes 29,778 rows and 37 to a Stata file using the following code:
df.to_sta...
2
Suppose I am using some twoway graph command in Stata. Without any action on my part Stata will choose some reasonable values for the ranges of both y and x axes, based both upon the minimum and ma...
Tupelo asked 3/2, 2022 at 19:38
2
Solved
I have two variables in Stata, both numeric variables that have somehow been recorded as string variables. I need them converted to numeric variables so that I can generate a new variable with them...
4
Solved
codebook is a great command in Stata. It describes data contents but also simply identifies unique values
sysuse auto, clear
codebook mpg, compact
Number of unique values of mpg is 21. Looking a...
2
Solved
I am trying to open a Stata .dta file which is compressed into winrar in R. Here are my codes:
library(foreign)
setwd("C:/Users/ASUS/Desktop/Data on oil/Oil discovery")
data <- read.dta("oil_di...
4
I have the following data structure. Within each group, some observations have missing value. I do know that each group has only one non-missing value (10 for group 1 and 11 for group 2 in this cas...
Alexina asked 2/12, 2015 at 20:53
3
Solved
I've been using Python for regression analysis. After getting the regression results, I need to summarize all the results into one single table and convert them to LaTex (for publication). Is there...
Eximious asked 10/5, 2014 at 1:49
2
Solved
I am getting an error while converting R file into Stata format. I am able to convert the numbers into
Stata file but when I include strings I get the following error:
library(foreign)
write.dta(...
6
Solved
I have data in long format and am trying to reshape to wide, but there doesn't seem to be a straightforward way to do this using melt/stack/unstack:
Salesman Height product price
Knut 6 bat 5
Kn...
3
Solved
I have a 10 GB .dta Stata file and I am trying to read it into 64-bit R 3.3.1. I am working on a virtual machine with about 130 GB of RAM (4 TB HD) and the .dta file is about 3 million rows and som...
Freckle asked 8/8, 2016 at 2:40
3
I am using Stata for data analysis but had to convert the dataset I am using from SPSS, which includes variable labels, by saving it as a .csv file. However, the variable labels were not exported t...
Disseisin asked 24/4, 2017 at 5:15
12
Is there a way to convert a dta file to a csv?
I do not have a version of Stata installed on my computer, so I cannot do something like:
File --> "Save as csv"
Maxima asked 29/3, 2010 at 6:3
6
In R, some packages (e.g. haven) insert a label attributes to variables (e.g. haven), which explains the substantive name of the variable. For example, gdppc may have the label GDP per capita.
Thi...
4
Solved
I have tried a thousand different times to read a Stata14 file on R, and for some reason I keep getting weird things happening (like variables dropped and such.)
The original file is saved in Sta...
5
Solved
Other than through redirection, which captures an entire session, is there a way to start and stop logging during an R session? To clarify, I am looking for something similar to the log using comma...
3
Solved
I am writing a Stata do file and I would like to provide default values if the user does not supply some parameters. To do so, I woud like to check if a macro is undefined.
I have come up with a ...
Suburb asked 7/3, 2011 at 6:3
2
Solved
In a survey dataset I have a string variable (type: str244) with qualitative responses. I want to count the number of characters in each response/string and generate a new variable containing this ...
Potiche asked 5/8, 2015 at 17:48
2
Solved
Consider the following dataset:
df = data.frame(id = c(1,1,1,2,2,2,3,3,3),
time = c(1,2,3,1,2,3,1,2,3),
x = c(8,8,9,7,7,7,7,7,8),
id_x = c(1,1,2,3,3,3,4,4,5))
I want to compute id_x which id...
3
Solved
Hadley Wickham's haven package, applied to a Stata file, returns a tibble with many columns of type "labeled". You can see these with str(), e.g.:
$ MSACMSZ :Class 'labelled' atomic [1:8491861] NA...
Herc asked 24/9, 2016 at 1:25
6
'order' in R seems like 'sort' in Stata. Here's a dataset for example (only variable names listed):
v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18
and here's the output I expect:
...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.