First create the model ```r 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: ```r library(car) linearHypothesis(model, c("X1=X3", "X1=0.5")) ``` You will get the same output with less code and hassle.