These are some newcomers to statistical programming for R for whom I could not find an answer on the Internet. My data code is marked as "eitc" in the code below.
1) As soon as I loaded into the data frame, I would like to see summary statistics. I used the functions:
eitc <- read.dta(file="/Users/Documents/eitc.dta") summary(eitc) sapply(eitc,mean,na.rm=TRUE)
How to find summary statistics on my framework when certain qualifications are performed. For example, I would like to see summary statistics for all variables when the variable "children" is greater than or equal to 1. Equivalent Stata code:
summarize if children >= 1
2) . How can I find certain parameters when performing certain qualifications? For example, I want to find the average value of the variable "work" when the variable "post93" is zero and the variable "anykids" is 1. Equivalent Stata code:
mean work if post93==0 & anykids==1
3) Ideally, when I run the summary statistics above, I would like to know how many observations were included in the calculation / compliance with the criteria.
4) When I read the data in my frame, it would be nice to see how many cases are included in the data set (and maybe how many rows have missing values ββor βNAβ in them).
5) In addition, I create dummy variables using the following code. Is this the right way to do this or is there a more efficient route?
post93.dummy <- as.numeric(eitc$year>1993) eitc=cbind(eitc,post93.dummy)
source share