# Example data
set.seed(123)
n <- 1000
p <- 5
d <- list(all = cbind(rnorm(n), matrix(rnorm(n*p), ncol=p)))
# Call the LS function
result <- LS(d, yidx = 1, Xidx = 2:(p + 1), n = c(1, 300, 600, 1000))
# View the results
print(result$beta) # Regression coefficients
print(result$SSE) # Sum of squared residuals
Run the code above in your browser using DataLab