]> henry.ined.fr Git - .git/commitdiff
*** empty log message ***
authorN. Brouard <brouard@ined.fr>
Wed, 19 Jul 2023 15:21:39 +0000 (15:21 +0000)
committerN. Brouard <brouard@ined.fr>
Wed, 19 Jul 2023 15:21:39 +0000 (15:21 +0000)
src/setup.iss
src/simulation.R

index 743322617cfcfb25527b79502b4b45047e3f81f9..f6791b90f854521f1692ffa2cf5e2f46016dda4a 100644 (file)
 ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!\r
 \r
 [Setup]\r
-AppName=IMaCh-0.99r36\r
-AppVerName=IMaCh-0.99r36 Version 0.99r36\r
+AppName=IMaCh-0.99r46\r
+AppVerName=IMaCh-0.99r46 Version 0.99r46\r
 AppCopyright=Copyright (C)  2002-2022 INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121) - Intel Software 2016-19\r
-DefaultDirName={pf}\IMaCh-0.99r36\r
+DefaultDirName={pf}\IMaCh-0.99r46\r
 DefaultGroupName=IMaCh\r
-OutputManifestFile=imach-0.99r36-icl-filelist.txt
-OutputBaseFilename=imach-0.99r36-icl-setup\r
+OutputManifestFile=imach-0.99r46-icl-filelist.txt
+OutputBaseFilename=imach-0.99r46-icl-setup\r
 UninstallDisplayIcon={app}\imach.exe\r
 Compression=lzma2\r
 SolidCompression=yes\r
@@ -82,12 +82,12 @@ ArchitecturesInstallIn64BitMode=x64
 ChangesAssociations=yes\r
 \r
 [Files]\r
-; Install IMaCh-x640.99r36.exe if running in 64-bit mode (x64; see above),\r
+; Install IMaCh-x640.99r46.exe if running in 64-bit mode (x64; see above),\r
 ; IMaCh.exe otherwise.\r
-;Source: "IMaCh-icl64-0.99r36.exe"; DestDir: "{app}\bin"; DestName: "IMaCh.exe"; Check: Is64BitInstallMode
-Source: "..\build\icl64\Release\IMaCh-0.99r36.exe"; DestDir: "{app}\bin"; DestName: "IMaCh.exe"; Check: Is64BitInstallMode
-;Source: "IMaCh-icl32-0.99r36.exe"; DestDir: "{app}\bin"; DestName: "IMaCh.exe"; Check: not Is64BitInstallMode
-Source: "..\build\icl32\Release\IMaCh-0.99r36.exe"; DestDir: "{app}\bin"; DestName: "IMaCh.exe"; Check: not Is64BitInstallMode
+;Source: "IMaCh-icl64-0.99r46.exe"; DestDir: "{app}\bin"; DestName: "IMaCh.exe"; Check: Is64BitInstallMode
+Source: "..\build\icl64\Release\IMaCh-0.99r46.exe"; DestDir: "{app}\bin"; DestName: "IMaCh.exe"; Check: Is64BitInstallMode
+;Source: "IMaCh-icl32-0.99r46.exe"; DestDir: "{app}\bin"; DestName: "IMaCh.exe"; Check: not Is64BitInstallMode
+Source: "..\build\icl32\Release\IMaCh-0.99r46.exe"; DestDir: "{app}\bin"; DestName: "IMaCh.exe"; Check: not Is64BitInstallMode
 ;Source: "IMaCh.chm"; DestDir: "{app}\bin"\r
 Source: ..\html\doc\imach.htm; DestDir: {app}\doc\r
 Source: README.txt; DestDir: {app}; Flags: isreadme\r
@@ -172,8 +172,8 @@ Source: ..\tests\data\data2.txt; DestDir: {app}\tests\data
 ;P.S. -silent is recommended for use in install scripts\r
 \r
 [Icons]\r
-Name: {group}\IMaCH; Filename: {app}\bin\imach.exe; Comment: IMaCh-0.99r36 0.99r36; IconFilename: {app}\imach.ico\r
-Name: {userdesktop}\IMaCH; Filename: {app}\bin\imach.exe; Comment: IMaCh-0.99r36 0.99r36; Flags: runmaximized\r
+Name: {group}\IMaCH; Filename: {app}\bin\imach.exe; Comment: IMaCh-0.99r46 0.99r46; IconFilename: {app}\imach.ico\r
+Name: {userdesktop}\IMaCH; Filename: {app}\bin\imach.exe; Comment: IMaCh-0.99r46 0.99r46; Flags: runmaximized\r
 Name: {group}\Visit the IMaCh web site; Filename: {app}\website.url\r
 \r
 ; NOTE: Most apps do not need registry entries to be pre-created. If you\r
@@ -189,7 +189,7 @@ Name: {group}\Visit the IMaCh web site; Filename: {app}\website.url
 ;;Root: HKCU; Subkey: "Software\EuroREVES_INED\IMaCh"; Flags: uninsdeletekey\r
 ;;Root: HKLM; Subkey: "Software\EuroREVES_INED"; Flags: uninsdeletekeyifempty\r
 Root: HKLM; Subkey: Software\IMaCh; Flags: uninsdeletekeyifempty\r
-Root: HKLM; Subkey: Software\IMaCh\imach; ValueType: string; ValueName: Current Version; ValueData: 0.99r36; Flags: uninsdeletekeyifempty\r
+Root: HKLM; Subkey: Software\IMaCh\imach; ValueType: string; ValueName: Current Version; ValueData: 0.99r46; Flags: uninsdeletekeyifempty\r
 Root: HKLM; Subkey: Software\IMaCh\imach; ValueType: string; ValueName: InstallPath; ValueData: {app}\r
 Root: HKLM; Subkey: Software\IMaCh\gnuplot; ValueType: string; ValueName: Current Version; ValueData: 5.1; Flags: uninsdeletekeyifempty\r
 Root: HKLM; Subkey: Software\IMaCh\gnuplot; ValueType: string; ValueName: InstallPath; ValueData: {app}\r
index 4da38d7cb409f29a25fbdc7a2310455eae2cc9d9..a383f247f915da49e8995e79e347058960c410fb 100644 (file)
@@ -1,3 +1,6 @@
+# $Id$
+#  $State$
+#  
 # Simulating data for IMaCh tests
 # Feinuo Sun and Nicolas Brouard (INED, July 2023)
 # 
@@ -9,7 +12,8 @@ if(!require("tidyverse")){
   }
 # LIBRARIES
 library(haven)
-samplesize<- 10000
+#samplesize<- 10000
+samplesize<- 50000
 
 # Which Life table?
 # Simulating a gompertz law of mortality: slope of line mu_m (about 9% increase per year)
@@ -26,7 +30,8 @@ exp(exp(mum*(65-am)))/mum*expint(exp(mum*(65-am)))
 e65 <- exp(exp(mum*(65-am)))/mum*expint(exp(mum*(65-am)))
 
 e65 <- exp(exp(mum*(65-am)))/mum*expint(exp(mum*(65-am)))
-# Life table from 0
+e65
+                                        # Life table from 0
 l <- function(a,am,mum){
     exp(-exp(mum*(a-am)))/exp(-exp(-mum*am))
 }
@@ -59,18 +64,25 @@ mum
 l65bisinv <- function(la){
     84.8506+log(exp(0.09*(65-84.8506)) -log(la))/0.09
 }
-l65bisinv(0.001)
+l65bisinv(0.0001)
 l65bisinv(1)
 
 set.seed(128)
+zeroone<-runif(samplesize,min=0.00000001,max=1)
 zeroone<-runif(samplesize,min=0.001,max=1)
 lifelength <- lapply(zeroone,l65bisinv)
+#slife<- sort(unlist(lifelength),decreasing=TRUE)
+#?sort
+#head(slife)
+#mean(unlist(lifelength)-65) #17.99482
+#head(lifelength,10)
+#class(lifelength)
 
 #lifelength <- rnorm(n=samplesize, mean=85, sd=16)
 
 set.seed(124)
 # First interview 4th semester
-monthinterview <- runif(samplesize, min=9,max=12)
+monthinterview <- runif(samplesize, min=10,max=13)
 st_98 <- rbinom(n=samplesize, size=1, prob=0.5)+1
 # state 2
 st_00 <- rbinom(n=samplesize, size=1, prob=0.2)+1
@@ -79,28 +91,34 @@ popage65110in1998<- runif(samplesize, min=65, max=110)
 #gender
 ragender <- rbinom(n=samplesize, size=1, prob=0.56)
 
+r98iwmid <- 1998 + monthinterview/12
 yrinterview1 <- floor(r98iwmid)
-monthinw1 <- floor((monthinterview - floor(monthinterview))*12)+1
+#monthinw1 <- floor((monthinterview - floor(monthinterview))*12)+1
+monthinw1 <- floor(monthinterview)
+
 
 int_98 <- paste0(monthinw1,"/",yrinterview1)
 
-r98iwmid <- 1998 + monthinterview/12
 rabdate <- r98iwmid - popage65110in1998 
 birthyr <- floor(rabdate)
 monthdb <- floor((rabdate - floor(rabdate))*12)+1
 brt <- paste0(monthdb,"/",birthyr)
 # date of death for dropping cases
-raddate <- rabdate + lifelength
+#raddate <- rabdate + lifelength
+raddate <- rabdate + unlist(lifelength)
 dateinterview2 <- 1998 + 2 + monthinterview/12
 #head(cbind(r98iwmid,dateinterview2,raddate),70)
 # people whose death occured before the interview will be dropped (radnate)
 radndate <- if_else(raddate < r98iwmid,  NA, raddate )
+head(cbind(r98iwmid,dateinterview2,raddate,radndate,lifelength),n=5299)
 #head(cbind(r98iwmid,dateinterview2,raddate,radndate,lifelength),70)
 # in order to avoid date of death known after last wave and potential bias
 # people whose death will occur after last interview will have an unkwonn (99/9999) date of death
 lastinterview<- dateinterview2
-radldate<- if_else(radndate > dateinterview2,  9999, radndate )
-head(cbind(r98iwmid,dateinterview2,raddate,radndate,lifelength,radldate),70)
+radldate<- if_else(radndate > dateinterview2+1/12,  9999, radndate )
+head(cbind(r98iwmid,dateinterview2,raddate,radndate,lifelength,radldate),n=5299)
+radldate<- if_else(dateinterview2+1/12 > radndate & radndate > dateinterview2, radndate , radldate )
+head(cbind(r98iwmid,dateinterview2,raddate,radndate,lifelength,radldate),n=5299)
 ddtyr <- if_else((!is.na(radldate) & radldate ==9999),  9999, floor(radldate))
 monthdd <- if_else((!is.na(radldate) & radldate ==9999),  99,floor((radldate - floor(radldate))*12)+1)
 #head(cbind(r98iwmid,dateinterview2,raddate,lifelength,radldate,ddtyr,monthdd),70)
@@ -114,6 +132,7 @@ ageatinterview1 <- r98iwmid - rabdate
 yrinterview2 <- floor(dateinterview2)
 monthinw2 <- floor((dateinterview2 - floor(dateinterview2))*12)+1
 int_00 <- paste0(monthinw2,"/",yrinterview2)
+#head(cbind(r98iwmid,dateinterview2,int_00,raddate,radndate,lifelength,radldate),70)
 ageatinterview2 <- dateinterview2 - rabdate
 # state 2
 st_00 <- if_else(raddate < dateinterview2, 3, st_00)