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.
A cyclist has to cover 180 km. She rides the first 20% at 25 kmph, half of the distance at 30 kmph, and the remainder at 20 kmph. What is her approximat...
The speeds of Ram and Rohan are 40km/hr and 50km/hr respectively. Rohan initially is at a place A and Ram is at a place B. The distance between A and B ...
Raman traveled a certain distance at a particular speed. If he had traveled 6 km/h faster, he would have taken 30 minutes less. If he had traveled 5 km/...
Parag starts chasing a Vipul, 6 hours after the Vipul starts running. Parag takes 7 hours to catch the Vipul. If the average speed of the Parag is 26 km...
Train P starts from Lucknow to Dehradun at 11:55 am with an average speed of 27.5 m/s. Train Q starts from Dehradun to Lucknow at 1:35 pm with an averag...
During the first 90 km of his trip, 'X' drove at a speed of 60 km/h. In the next 150 km, he increased his speed by 'y%' compared to his initial speed. F...
In every 20minutes the time of a watch increases by 5 minutes. After setting the correct time at 5 am,What time will it show after 12 hours?
Buses start from a bus terminal with a speed of 10 km/hr at intervals of 8 minutes. What is the speed of a boy coming from the opposite direction toward...
Speed of the stream is 15 km/h and speed of boat in still water is 24 km/h. A boat takes a total of 38 hours for travelling downstream from Point M to P...
- Asha travels 40.5 km in 1 hour and 30 minutes. How far will she travel in 4 hours if her speed increases by 3 km/h?