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.
Who is the author of "Homeless: Growing up Lesbian and Dyslexic in India"?
SBI has issued additional tier-1 (AT1) bonds worth a total of Rs 6,872 crore at a cut-off of how many %?
What is the full form of ANKUR, the urban transformation initiative launched by Odisha?
The currency of Russia is:
What were the dates of the 28th National Conference on e-Governance 2025 in Visakhapatnam?
What is the main benefit for NSDL Payments Bank being added to the Second Schedule of the RBI Act?Â
What challenge continues to delay the finalization of the New Collective Quantified Goal (NCQG) for climate finance?
SEBI has restructured its advisory committee on market data that recommends policy measures pertaining to areas like securities market data access and p...
Justice Mohammad Yousuf Wani was administered the oath of office as an Additional Judge of which High Court?
Which Life Insurance company has launched its dedicated 24X7 inbound contact centre to address before and after purchase queries related to comprehensiv...