Can anyone help with this one please, I do not quite understand the problem
Write a function (call it mylm) that takes two inputs: a vector y of n elements and a matrix X of n times k elements, where n should be greater than k, and returns two outputs: X'X and X'y (the prime symbol means transpose). Use the attr method to return the second output.
Homework inspired questions are welcome here, but you have to tell us what have you tried so far? what is your specific problem? We are more inclined towards helping you with specific coding problems rather than doing your work for you.
For guidelines about how to properly ask homework related questions here, please read our homework policy.