Skip to main content
added 2 characters in body
Source Link
User1865345
  • 10.3k
  • 12
  • 23
  • 40

First Createcreate the model

library(data.table)
data = fread(paste0("http://www1.aucegypt.edu/faculty/hadi/RABE5/Data5/", "P060.txt"))
model <- lm(data = data, Y ~ X1 + X3)

Then you can use the following code:

library(car)
linearHypothesis(model, c("X1=X3", "X1=0.5"))

You will get the same output with less code and hassle.

First Create the model

library(data.table)
data = fread(paste0("http://www1.aucegypt.edu/faculty/hadi/RABE5/Data5/", "P060.txt"))
model <- lm(data = data, Y ~ X1 + X3)

Then you can use the following code:

library(car)
linearHypothesis(model, c("X1=X3", "X1=0.5"))

You will get the same output with less code and hassle.

First create the model

library(data.table)
data = fread(paste0("http://www1.aucegypt.edu/faculty/hadi/RABE5/Data5/", "P060.txt"))
model <- lm(data = data, Y ~ X1 + X3)

Then you can use the following code:

library(car)
linearHypothesis(model, c("X1=X3", "X1=0.5"))

You will get the same output with less code and hassle.

First Create the model

data = fread(paste0("http://www1.aucegypt.edu/faculty/hadi/RABE5/Data5/", "P060.txt"))
model <- lm(data = data, Y ~ X1 + X3)
library(data.table)
data = fread(paste0("http://www1.aucegypt.edu/faculty/hadi/RABE5/Data5/", "P060.txt"))
model <- lm(data = data, Y ~ X1 + X3)

Then you can use the following code:

library(car)
linearHypothesis(model, c("X1=X3", "X1=0.5"))
library(car)
linearHypothesis(model, c("X1=X3", "X1=0.5"))

You will get the same output with less code and hassle.

First Create the model

data = fread(paste0("http://www1.aucegypt.edu/faculty/hadi/RABE5/Data5/", "P060.txt"))
model <- lm(data = data, Y ~ X1 + X3)

Then you can use the following code:

library(car)
linearHypothesis(model, c("X1=X3", "X1=0.5"))

You will get the same output with less code and hassle.

First Create the model

library(data.table)
data = fread(paste0("http://www1.aucegypt.edu/faculty/hadi/RABE5/Data5/", "P060.txt"))
model <- lm(data = data, Y ~ X1 + X3)

Then you can use the following code:

library(car)
linearHypothesis(model, c("X1=X3", "X1=0.5"))

You will get the same output with less code and hassle.

Source Link

First Create the model

data = fread(paste0("http://www1.aucegypt.edu/faculty/hadi/RABE5/Data5/", "P060.txt"))
model <- lm(data = data, Y ~ X1 + X3)

Then you can use the following code:

library(car)
linearHypothesis(model, c("X1=X3", "X1=0.5"))

You will get the same output with less code and hassle.