Sei sulla pagina 1di 9

Data Analytics &

R
Regression and Anova
Assignment-1
SHUSWALINI SHADANGI (BFT/17/128)
For Task 1(Linear Regression) and Task 2(Non-Linear
Regression).

Survival from Malignant Melanoma


Description
The melanoma data frame has 205 rows and 6 columns.

The data consist of measurements made on patients with malignant melanoma. Each patient
had their tumour removed by surgery at the Department of Plastic Surgery, University Hospital
of Odense, Denmark during the period 1962 to 1977. The surgery consisted of complete
removal of the tumour together with about 2.5cm of the surrounding skin. Among the
measurements taken were the whether it was ulcerated or not. These are thought to be
important prognostic variables in that patients with a ulcerated tumour have an increased
chance of death from melanoma. Patients were followed until the end of 1977.

Time

Survival time in days since the operation, possibly censored.

Status

The patients status at the end of the study. 1 indicates that they had died from
melanoma, 2 indicates that they were still alive and 3 indicates that they had died from
causes unrelated to their melanoma.

Sex

The patient’s sex; male and female

Age

Age in years at the time of the operation.

Year
Year of operation.

Ulcer

Indicator of ulceration; present and absent.

Dependent Variables

Status - numerical

Time - numerical

Independent Variables

Age

Sex

Year

Ulcer

Code
Observations

For linear regression of status


For linear regression of time
Result
For linear regression of status

From the above observations we can see that status of the patient will depend mainly on Ulcers
(if it is present or not). As the Pr value of ulcer is less than 0.05 and hence is significant value.

Equation

Status= (-2.802e-0.1)x1 +(-4.744e+0.1)

Where, x1= ulcer.

For linear regression of time

From the above observations we can see that time of survival after operation of the patient will
depend mainly on age and ulcers (if it is present or not). As the Pr value of age and ulcer is less
than 0.05 and hence is significant value.

Time=(-272.640)x1 + (-12.877)x2 + (435396.962)

Where, x1= ulcer, x2= age.

Task 3- Two Way Anova

Animal Survival Times


Description
The poisons data frame has 48 rows and 3 columns.

The data form a 3x4 factorial experiment, the factors being three poisons and four treatments. Each
combination of the two factors was used for four animals, the allocation to animals having been
completely randomized.This data frame contains the following columns:

Time
The survival time of the animal in units of 10 hours.
Poison
A factor with levels 1, 2 and 3 giving the type of poison used.
Treat
A factor with levels A, B, C and D giving the treatment.

Code

Observations

Result
The time for which the animal will survive depends on both poison that the animals are fed and
treatment they are provided with as both their pr value is less than 0.05, making them
significant value.

Potrebbero piacerti anche