Generalizing factors and time with the Asterisk

I'm not sure why it is so hard to find information on summing non-capitalistic variables using stargazer.

I would like to get a summary of the following time variable (number of observations, min and max values โ€‹โ€‹would be great)

Time<-c("2014-07-03 10:57:35 PDT", "2014-07-03 11:02:35 PDT", 
        "2014-07-03 11:07:35 PDT", "2014-07-03 11:12:35 PDT", 
        "2014-07-03 11:17:34 PDT", "2014-07-03 11:22:34 PDT")
Time<-as.POSIXlt(Time, format="%Y-%M-%d %H:%M:%S")

      

And the total sample size and the number of values โ€‹โ€‹of each category of the next factor.

Cat.Var<-rep(c("Level 1","Level 2"), each=3)

      

It seems so basic, but there seems to be almost no documentation related to such an issue. Perhaps the Stargazer package is not what I should be using, but I would like these tables to visually match another release that was created with Stargazer.

Thank!

0


source to share


1 answer


Stargazer is capable of creating a well-formatted factor-variable pivot table. Just pass the factor variables to the ftable function from the base r and then feed that to stargazer.

For example:



stargazer(ftable(data.set$gender, data.set$year), type="text")

This is a summary of the gender distribution of your data for each year. Stargazer requires ftable to have at least two factorial variables, otherwise an error occurs, but this is very easy to work around if you just create factorial variable 1 for each observation.

0


source







All Articles