0

These are my column names:

colnames(QTrain70)

[1] "Depth"``"Garage_Spa"``"Total_Liva"``"NEAR_DIST.Vac"
[5]"NEAR_DIST.ComCor"``"NEAR_DIST.LIViol"``"NEAR_DIST.Retail"``"NEAR_DIST.SeptST"

[9] "NEAR_DIST.TrafDat" "NEAR_DIST.HwyEx"``"Sale_Pri_1"``"Tax_Build"`` [13] "Tax_Land"

However my stargazer code : stargazer(QTrain70, type="text", title = "Summary Statistics")

Only returns summary statistics for 5 of the 13 columns.

Specifically these 5:

Garage_Spa 170,227 0.308 0.613 0 72
Total_Liva 170,227 1,308.933 733.466 0 29,524
Sale_Pri_1 169,295 126,100.400 229,805.900 1,001 30,000,000 Tax_Build 170,227 98,574.050 97,399.690 0 2,310,000 Tax_Land 170,227 31,967.470 45,871.640 0 5,088,300

I want it to output statistics for all of the columns. Why would it not go through all the columns?

Spacedman
  • 92,590
  • 12
  • 140
  • 224
  • 1
    Check data types with `str(QTrain70)`, are the missing ones factors or non-numeric? – Parfait Jan 07 '17 at 04:36
  • @Parfait the missing ones are factors and the ones showing up are `int`. How do I transform them? – CityPlanner Jan 07 '17 at 04:52
  • `as.integer(as.character(QTrain70$colname))` – Parfait Jan 07 '17 at 04:53
  • @Parfait all that does is cause R to print out all of the observations in the column and then stop and print ` [ reached getOption("max.print") -- omitted 160227 entries ]` After checking if the character has changed to `is.integer(QTrain70$NEAR_DIST.Retail)` for example it reports `False` – CityPlanner Jan 07 '17 at 04:57
  • 1
    You have to assign it (thought that goes without saying): `QTrain70$colname <- as.integer(as.character(QTrain70$colname))` – Parfait Jan 07 '17 at 04:59
  • @Parfait Strangely enough after these have been transformed into integers they still don't show up in the core plot output. – CityPlanner Jan 10 '17 at 22:32
  • Your original question concerns `stargazer()`. Do all 13 summary statistics output after integer conversion? I am not seeing a plot line. Do only the original 5 show up in this plot? Or none? Be sure assignment is run prior to these methods. – Parfait Jan 10 '17 at 23:47
  • @Parfait you're right. The plot line is simply `corrplot (QTrain70, method = "number")` these same variables are the showing perfect correlation with themselves but not with other variables in the list. Any thoughts? – CityPlanner Jan 11 '17 at 00:04
  • *Same*, *other*...please be specific. The original 5? The other 8 out of 13 converted too integer? What are the types of first 5? Possibly they have decimal precision as `numeric` type vs `integer` type. – Parfait Jan 11 '17 at 00:08
  • @Parfait, the 8 out of the 13 converted to integer are each respectively showing correlation with themselves. Any variable starting with `NEAR` shows correlation with other variables also starting with `NEAR` but not with the remainder of variables. The remaining 5 show correlation amongst themselves as well. – CityPlanner Jan 11 '17 at 00:22

0 Answers0