File:Monica.zip
From Testiwiki
Monica.zip (file size: 594 KB, MIME type: application/zip)
Warning: This file type may contain malicious code.
By executing it, your system may be compromised.
This page is a study.
The page identifier is Op_en6253 |
---|
Moderator:Nobody (see all) Click here to sign up. |
Give your opinion to the peer rating of the content of this page. |
Upload data
|
An example data from Monica study.
Rationale
An rcode for managing the Monica data into a more easily usable format. The produced csv file was then converted to zip and uploaded to File:Monica.zip.
Show details |
---|
#File: http://www.tilastotiede.fi/ReplicaX/example_MONICA.r #Author: Juha Karvanen (juha.karvanen at iki.fi) # #Summary: This code demonstrates the creation of data replicas with ReplicaX R functions. #The R functions needed are available as http://www.tilastotiede.fi/ReplicaX/ReplicaX_functions.r #For information see http://www.tilastotiede.fi/ReplicaX/ReplicaX_esitys.pdf (in Finnish) # #The data used is a published sample of WHO MONICA data. #Before running the code, you should download the data from #http://www.thl.fi/publications/monica/monograph_cd/data/form04_3.zip # #The data documentation can be found at #http://www.thl.fi/publications/monica/monograph_cd/formats/form048.htm #http://www.thl.fi/publications/monica/monograph_cd/formats/survey.htm # #For more information on the MONICA project see http://www.thl.fi/monica/ print("ReplicaX demonstration with the MONICA data. Running the code takes a couple minutes.") #rm(list=ls()) set.seed(20131103) #to reproduce the results #path <- "/home/jutakarv/Documents/replica_gen/" #path <- "/home/q/tiede/replica_gen/" #path <- paste(getwd(),"/",sep="") #source(paste(path,"ReplicaX_functions.r",sep="")) path <- "//cesium/jtue$/_Downloads/form04_3/" # This was the temporary file on my own computer when doing the conversion. if(!file.exists(paste(path,"form04_3.txt",sep=""))) { stop("Data file form04_3.txt does not exist in the current path. Please download it from http://www.thl.fi/publications/monica/monograph_cd/data/form04_3.zip or change the path definition") } widths <- c( 2,1,2,2,6,1,3,8,8,1,1,1,1,2,1,3,1,1,4,1,3,2,1,3,1,3,2,1,1,1,1,1,1,1,1,1,2,1,1,3,3,2,3,3,2,1,2,2,4,2,3,3,8,3,3,8,3,4,2,3,4, 4,4,2,1,2,1,1,1,1,1,4,4,4,4 ) colnames <- c( "form","versn","centre","runit","serial","numsur","samunit","dexam","mbirth","agegr","sex","marit","edlevel", "school","cigs","numcigs","daycigs","evercig","stop","iflyear","maxcigs","cigage","cigarsm","cigar","pipesm","pipe", "othersm","hibp","drugs","bprecd","hich","chdt","chrx","chrecd","asp","menop","agem","horm","pill","syst1", "diast1","rz1","syst2","diast2","rz2","cuff","arm","bpcoder","timebp","rtemp","chol","choldl","dchol","hdl", "hdldl","dhdl","scn","cotin","carbmon","height","weight","waist","hip","whcoder","oversion","eage","eageg", "cohort1","cohort2","edtert1","edtert2","systm","diastm","chola","hdla" ) monica <- read.fwf(file=paste(path,"form04_3.txt",sep=""),widths=widths,col.names=colnames) selectedcolnames <- c("marit","edlevel","school","height","weight","waist","hip") monica2 <- monica[,selectedcolnames] vartype <- c("discrete","discrete","discrete","continuous","continuous","continuous","continuous") #decoding missing values monica$height[monica$height==999] <- NA monica$weight[monica$weight==9999] <- NA monica$waist[monica$waist==9999] <- NA monica$hip[monica$hip==9999] <- NA monica$school[monica$school == 99] <- NA #unit transformations monica$weight <- monica$weight/10 #transform to kg monica$waist <- monica$waist/10 #transform to cm monica$hip <- monica$hip/10 #transform to cm write.csv(monica, "//cesium/jtue$/_Documents/Monica.csv") # This csv file was then zipped and uploaded to [[:File:Monica.zip]] |
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Dimensions | User | Comment | |
---|---|---|---|---|
current | 17:47, 8 December 2013 | (594 KB) | Jouni (talk | contribs) | Some decodings and transformations applied. |
11:28, 8 December 2013 | (590 KB) | Jouni (talk | contribs) | An example data from Monica study. {{study}} Category:Cardiovascular disease Category:Data Category:Finland |
- You cannot overwrite this file.
File usage
There are no pages that link to this file.