Question

In: Math

I am using the phbirths data in the faraway package in R. I want to: 1)...

I am using the phbirths data in the faraway package in R.

I want to:
1) create a plot of the birth weight vs the gestational age and I want to colour code the points based on the mothers smoking status to determine whether or not smoking affects the babies.
2) fit a simple model (one regression line) along with both the main effects (parallel lines) and interaction (non parallel lines) ANCOVA model to the data and find out which model is preferred.

what coding would I use for both of these questions? please help, will thumbs up! ?

Thanks.

Solutions

Expert Solution


Related Solutions

1. The dataset prostate (in R package ”faraway”) is from a study on 97 men with...
1. The dataset prostate (in R package ”faraway”) is from a study on 97 men with prostatecancer who were due to receive a radical prostatectomy.Fit a model withlpsa(y) as the response variable andlcavol(x) as the predictor andanswer the following question: •Calculate and plot the 90%confidenceandpredictionbands. Which type ofintervals are wider?
Using the Motor Trend Car Road Tests dataset mtcars, in faraway R package, fit a model...
Using the Motor Trend Car Road Tests dataset mtcars, in faraway R package, fit a model with mpg: Miles/(US) gallon as the response and the other variables as predictors. (a) Which variables are statistically significant at the 5% level? For each and every test provide the null and alternative hypotheses, critical region (or rejection region), test statistics and your conclusions. (30) (b) What interpretation should be given to the coefficient for vs: Engine? (3) (c) Compute 90 and 95% confidence...
The data can find in potuse (faraway package). The national Youth Survey collected a sample of...
The data can find in potuse (faraway package). The national Youth Survey collected a sample of 11-17 year-olds with 117 boys and 120 girls, asking questions about marijuana usage. This data is actually longitudinal – the same boys and girls are followed for five years. However, for the purposes of this question, imagine that the data is cross-sectional, that is, a different sample of boys and girls are sampled each year. Build a model for the different levels of marijuana...
I want this to be solved using R studio or R software, please. Here is the...
I want this to be solved using R studio or R software, please. Here is the example: The data in stat4_prob5 present the performance of a chemical process as a function of sever controllable process variables. (a) Fit a multiple regression modelrelating CO2product (y) to total solvent (x1) and hydrogen consumption (x2) and report the fitted regression line. (b) Find a point estimatefor the variance term σ2. (c) Construct the ANOVA tableand test for the significance of the regression using...
Using the package “wooldridge’, and the data ‘hprice1’ (in R-Software) to estimate the model price =...
Using the package “wooldridge’, and the data ‘hprice1’ (in R-Software) to estimate the model price = β0 + β1sqrft + β2bdrms + u , where is the house price measured in thousands of dollars. 1. Write out the results in equation form. 2.  What is the estimated increase in price for a house with one more bedroom, holding square footage constant? 3. What is the estimated increase in price for a house with an additional bedroom that is 140 square feet...
I am trying to work on LCD display using VHDL. I want to display the word...
I am trying to work on LCD display using VHDL. I want to display the word “TECH” and make it blink on LCD. I need the complete source code (If anyone helps me and the code works I will offer bonus cash for it )
Please use R to do it. Using the SATGPA data set in Stat2Data package. Test by...
Please use R to do it. Using the SATGPA data set in Stat2Data package. Test by using α= .05 Question: Test if the proportion of MathSAT greater than VerbalSAT is 0.60 > library(Stat2Data) > data("SATGPA") > data(SATGPA) > SATGPA
I am trying to find HPD credible set using R -- Sample values for X: 1,...
I am trying to find HPD credible set using R -- Sample values for X: 1, 2, 0, 1 Poisson Distribution, posterior is a gamma distribution with alpha = 0.5 and beta = 0.4 What is 95% HPD credible set using R?
1. I am trying to determine the level of measurement of my data type? I am...
1. I am trying to determine the level of measurement of my data type? I am looking for advice on Nominal, Ordinal, Interval, and Ratio 2. Does the data set have any categorical variables? I am trying to Describe the data set below in very general terms? This data consist of 8 variables: Which are GRE Scores, TOEFL Scores, University Rating, Statement of Purpose, Letter of Recommendation Strength, Undergraduate GPA, . Research Experience, and Chance of Admit. Name Type Description...
USING R ---locate the pre-loaded MASS package, then load the data frame cats within that packag....
USING R ---locate the pre-loaded MASS package, then load the data frame cats within that packag. This provides data on sex, body weight (in kgs), and heart weight (in grams) for 144 household cats. Load the MASS package with a call to library("MASS"), and access the object directly by entering cats at the console prompt. 1. Fit a least-squares multiple linear regression model using heart weight as the response variable and the other two variables as predictors, and view a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT