Question
Which of the following R functions is most appropriate
for fitting a linear regression model?Solution
Explanation: The lm() function in R is specifically designed for fitting linear models, including linear regression. This function takes the formula for the dependent and independent variables, along with the dataset, and returns an object containing all the necessary information about the fitted model. For example, using lm(y ~ x, data=dataset) fits a linear regression model to predict y based on x . This makes it an essential tool for statistical modeling and predictive analytics. The lm() function forms the backbone for many analyses in R, enabling data analysts to understand relationships between variables and build models for forecasting or hypothesis testing. Option A: The plot() function creates visualizations but does not perform statistical modeling. Option C: The summary() function provides details about a fitted model, but it doesn’t fit models itself. Option D: The predict() function makes predictions based on a model fitted by lm() but does not perform fitting. Option E: The cor() function calculates correlation between variables, which is useful for analysis but not for fitting models.
Which operating system was the latest version of Windows as of 2025?
Which smartphone component is irrelevant to voice call quality?
What does Ctrl + C does on a Windows keyboard?
What is the default cell address in Excel?
The accounting software ‘Tally’ was developed by :
Which of these is an input device?
Which of the following is different from other ?
What is the base of the Octal number system?
The set of computer programs that manage the hardware/software of a computer is called
The ability to query data, as well as insert, delete, and alter tuples, is offered by