Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Objective: To analyze a datasets using R Procedures: 1. Individual project 2. Se

ID: 3874253 • Letter: O

Question

Objective: To analyze a datasets using R

Procedures:

1. Individual project

2. Select a datasets on your own.

3. Identify your plan on how to use this datasets.

4. Write R codes to analyze the datasets

5. Prepare 10 min presentation to discuss your datasets and analysis procedure

6. Submit a report of your work.

What to submit:

Presentation: Your 10 min presentations should include

1. Descriptions of your selected datasets;

2. Descriptions of your analysis procedures and outcomes.

3. A live run of your R codes

Report: (Max of 2 pages) your report should include:

1. Descriptions of your selected datasets and why did you chose it.

2. Descriptions of your analysis procedures and your objective.

3. List of R codes that were used in these analyses.

4. Conclusions that include you learn experience of this project.

Rubrics: Project work worth 30% out of your total grades.

1. Datasets: (5% marks)

a. Propose datasets are creative and challenging.

b. Submitting datasets ( by Friday 01-05- 2018)

2. Presentations (10 % marks)

a. All the required elements are presented.

b. The analysis procedures and R codes are well defined and creative.

c. R codes must run smoothly

d. The delivery of presentations must be constrictive and neat.

3. Report: (15% marks)

a. Analysis of the project shows understanding and insight beyond smile observations.

b. Datasets selected are well defined.

c. The analysis procedures and objectives are discussed and well defined

d. R codes are listed and discussed

e. Comments about the learning experiences are relevant and constrictive.

f. Formats and presentations ( including spelling and grammar)

Explanation / Answer

Investigating the proper data set is very important for a logical project's success. Maximum time, data from transactional systems or different sources such as social media, reports and sensors are not set to be analyzed directly. Data needs to mix- matched and preprocessed to convert it into a proper form which can be analyzed. Without this, the data being analyzed and reported will be of no use. And this small difference can make a significant difference in the outcomes that can affect an organization's performance.

So here we will consider the dataset for ICU patients

First step: load packages, read data and view data

          #load packages

          library(table1)

          library(matching)

          #read data

          load(url(“provide any of your desired url”))

          #view data

          View(rhc)

Create new dataset if only variables that will be used, convert character to numeric(not mandatory)

// creating dataset with variables//

         

          ARF<-as.numeric(rhc$cat1==’ARF’)

          CHF<-as.numeric(rhc$cat1==’CHF’)

          coma<-as.numeric(rhc$cat1==’coma’)

          lungcan<-as.numeric(rhc$cat1==’lungcan’)

          Female<-as.numeric(rhc$sex==’Female’)

          died<-as.numeric(rhc$cdeath==’yes’)

          age<-rhc$age

          treatment<-as.numeric(rhc$swang1==’RHC’)

          meanbp1<-rhc$meanbp1

         

#new dataset

mydata <- cbind(ARF,CHF,coma,lungcan,Female,died,age,treatment,meanbpi)

mydata <- data.frame(mydata)

#covariate to be used

xvars <- c (“ARF”,”CHF”,”coma”,”lungcan”,”Female”,”died”,”age”,”treatment”,”meanbpi”)

Now create table1

table1<- CreateTable1(vars=xvars, strata = “treatment” , data = mydata , test = False)

# include standardized mean difference(smd)

print(table1, smd = true)

//Insert a set of data create by own in any tool, analyze the data of data of smd//

We can also perform greedy matching after the above pre-matching

greedymatch <- Match(tr=treatment, M=1, X=mydata[xvars]) //these are the variable we need to match up//

matched <- mydata[unlist(greedymatch[c(“index.treated”, “index.control”)])]

// after matching store the data in index//

Matched data

matchedtable1 <- CreateTable1(vars=xvars ,strata= “treatment”, data = matched , test = FALSE)

print(matchedtable1, smd = TRUE)

Outcome analysis by carrying paired t-test

#outcome analysis

y_trt <- matched$died[matched$treatment==1]

y_con<- matched$died[matched$treatment==0]

#pairwise difference

diffy <- y_trt – y_con

#paired t-test

t.test(diffy)

//Compare the difference with your actual difference of data set//

Just keep in mind. When we’re initializing a new analysis and creating own dataset, this is a rough outline of the steps probably need to execute.