Hi, I'm trying to do a multiple regression using a CSV data file, but when I run the lines of code I get the following error message.
Warning messages:
1: In model.response(mf, "numeric") :
using type = "numeric" with a factor response will be ignored
2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors
These are the codes I use:
# Codes to read csv file
Data2018<- read.csv(file = "Data2018.csv", head = TRUE, sep=";")
Data2018
#attach data
Data2018$ISIN
Data2018$Name
Data2018$Industry
Data2018$Currency
Data2018$Assets
Data2018$Debt
Data2018$Market.Value
Data2018$ROE
Data2018$Revenu
Data2018$Tobins.Q
# Fit model using variables
Model0 <- lm(Tobins.Q ~ Industry + Currency + Assets + Debt + Market.Value + ROE + Revenu)
These are 6 lines of outcome:
ISIN:
[1] US88579Y1010
[2] US0028241000
[3] US00287Y1091
[4] ES0125220311
[5] DE000A1EWWW0
[6] US00724F1012
Name:
[1] 3M
[2] ABBOTT LABORATORIES
[3] ABBVIE
[4] ACCIONA
[5] ADIDAS
[6] ADOBE (NAS)
Industry:
[1] Surgical & Medical Instruments & Apparatus
[2] Pharmaceutical Preparations
[3] Pharmaceutical Preparations
[4] Electric Services
[5] Footwear, (No Rubber)
[6] Services-Prepackaged Software
Currency:
[1] U$
[2] U$
[3] U$
[4] E
[5] E
[6] U$
Assets:
[1] 36.135.000.000,00
[2] 65.305.000.000,00
[3] 59.352.000.000,00
[4] 14.150.215.000,00
[5] 14.961.000.000,00
[6] 18.768.682.000,00
Debt:
[1] 11.376.000.000,00
[2] 15.366.000.000,00
[3] 32.117.000.000,00
[4] 4.680.648.000,00
[5] -1.230.000.000,00
[6] 841.835.000,00
Market Value
[1] 109.861.000.000,00
[2] 127.036.000.000,00
[3] 138.674.000.000,00
[4] 4.231.480.000,00
[5] 36.716.240.000,00
[6] 110.435.000.000,00
ROE:
[1] 42,01
[2] 1,54
[3] 103,65
[4] 5,85
[5] 17,01
[6] 20,02
Revenu:
[1] 316.570.000.000,00
[2] 273.900.000.000,00
[3] 282.160.000.000,00
[4] 72.539.740.000,00
[5] 212.180.000.000,00
[6] 73.015.050.000,00
Tobin's Q
[1] 3,040293344
[2] 1,945272184
[3] 2,336467179
[4] 0,299039979
[5] 2,454130072
[6] 5,884004002
Please let me know if someone has a solution.
Thank you!