Reputation: 1
I'm trying to run a fixed effects regression using panel data in R with package plm
and I keep getting an error saying that my vector "Fixed is not found", ergo I cannot run my regressions.
Here is my script
library(readr)
library(plm)
eco_490_data <- read_csv("C:/Users/Steve's pc/Downloads/New folder (2)/Stephens eco class/eco 490 data.csv")
View(eco_490_data)
names(eco_490_data)
Fixed <- plm(Hom ~ LRM + Comp Employment + beer + Poverty, + pop + Unemployment + Employment + Personal inc + prison pop data = eco_490_data, index = c("year", "msa"), model="within")
summary(Fixed)
### Here are the error's I'm getting
Fixed <- plm(Hom ~ LRM + Comp Employment + beer + Poverty, + pop + Unemployment + Employment + Personal inc + prison pop data = eco_490_data, index = c("year", "msa"), model="within")
# Error: unexpected symbol in "Fixed <- plm(Hom ~ LRM + Comp Employment"
summary(Fixed)
# Error in summary(Fixed) : object 'Fixed' not found
library(readr)
library(plm)
eco_490_data <- read_csv("C:/Users/Steve's pc/Downloads/New folder (2)/Stephens eco class/eco 490 data.csv")
View(eco_490_data)
names(eco_490_data)
Fixed <- plm(Hom ~ LRM + Comp Employment + beer + Poverty, + pop + Unemployment + Employment + Personal inc + prison pop data = eco_490_data, index = c("year", "msa"), model="within")
summary(Fixed)
Fixed <- plm(Hom ~ LRM + Comp Employment + beer + Poverty, + pop + Unemployment + Employment + Personal inc + prison pop data = eco_490_data, index = c("year", "msa"), model="within")
# Error: unexpected symbol in "Fixed <- plm(Hom ~ LRM + Comp Employment"
summary(Fixed)
# Error in summary(Fixed) : object 'Fixed' not found
Upvotes: -1
Views: 390
Reputation: 2604
Remove the comma in your formula and move it before your data
argument.
It also looks like some columns have spaces in them. You need to wrap those in back ticks for them to be processed correctly.
Fixed <- plm(Hom ~ LRM + Comp Employment + beer + Poverty + pop + Unemployment + Employment + `Personal inc` + `prison pop`,
data = eco_490_data,
index = c("year", "msa"),
model="within")
Upvotes: 1