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.
If the area of a square field is 625 m2, then find the diagonal of the square field.
- A water tank is shaped like a right circular cylinder with a height of 10 cm and a base radius of 2.8 cm. What is its volume? (Use π = 22/7)
The length and breadth of a rectangular field are 51m and 30m respectively. A tank of length 8m, breadth 7m and depth 5m is dug out at the middle of the...
The total area of a circle and a square is 5450 cm2; the diameter of the circle is 70 cm, what is the difference between the circumference of...
A solid cylinder of radius 4 cm and height 9 cm is melted and recast into right circular cones of radius 2 cm and height 6 cm. How many such cones can b...
The perimeter of a rhombus is 40 m and its height is 6 m. Its area is:
A rectangular tank is 50 meter long and 29meter deep. If 1000 cubic meters of water be drawn off the tank, the level of the water in the tank goes down ...
A hemispherical bowl of internal radius 9 cm, contains a liquid. This liquid is to be filled into small cylindrical bottles of diameter 3 cm and height ...
The total surface area of a cube is given as 216 cm². The radius of a cone is twice the length of the edge of the cube, and the height of the cone is 1...
A right circular cone & a right circular cylinder have equal base & equal height. If the radius of the base & the height are in the ratio 8:...