Hi, I'm trying to conduct sensitivity analysis in R using the 'sensitivity' package. Although the description of functions seem straightforward, I can?t succeed. The definition of input factors can be the problem. library(sensitivity) #A simple model with 4 input factor to test the morris function: model01=function(a1,a2,a3,a4) { Z<-numeric(10) Z[1]<-runif(1) Z[2]<-runif(1,a1,30) Z[3]<-6*runif(1,min(a1,a2),max(a1,a3)) Z[4]<-runif(1,2,5)*runif(1,min(a2,a4),max(a2,a4)) Z[5]<-0.5*runif(1,min(a3,a4),max(a3,a4)) Z[6]<-2*runif(1,min(a1,a4),max(a1,a4)) Z[7]<-runif(1) Z[8]<-2*runif(1,min(2*a1,5*a4),max(10*a1,100*a4)) Z[9]<-2.5*runif(1,min(a2,a3),max(a2,a3)) Z[10]<-rnorm(1,10*a1,1) mean(Z) } xx=morris(model = model01, factors=c("a1","a2","a3","a4"), r=4, design=list(type="oat", levels = 5, grid.jump = 3), binf =1,bsup=20, scale=F) Error message suggests that the second input factor is not used How should I define the input factors? Thanks in advance, Mark
Hi Szalai I had used only "src" function, and on that case you need to have a vector with your Y variable, and a data-frame with all your X (i.e. explanatory) variables. I have interest on stay in touch with others that have been using sensitivity package! bests milton On Tue, Apr 13, 2010 at 11:08 AM, "Szalai Márk" <Szalai.Mark@mkk.szie.hu>wrote:> Hi, > > > I'm trying to conduct sensitivity analysis in R using the 'sensitivity' > package. Although the description of functions seem straightforward, I can’t > succeed. The definition of input factors can be the problem. > > library(sensitivity) > #A simple model with 4 input factor to test the morris function: > model01=function(a1,a2,a3,a4) > { > Z<-numeric(10) > Z[1]<-runif(1) > Z[2]<-runif(1,a1,30) > Z[3]<-6*runif(1,min(a1,a2),max(a1,a3)) > Z[4]<-runif(1,2,5)*runif(1,min(a2,a4),max(a2,a4)) > Z[5]<-0.5*runif(1,min(a3,a4),max(a3,a4)) > Z[6]<-2*runif(1,min(a1,a4),max(a1,a4)) > Z[7]<-runif(1) > Z[8]<-2*runif(1,min(2*a1,5*a4),max(10*a1,100*a4)) > Z[9]<-2.5*runif(1,min(a2,a3),max(a2,a3)) > Z[10]<-rnorm(1,10*a1,1) > mean(Z) > } > > xx=morris(model = model01, factors=c("a1","a2","a3","a4"), r=4, > design=list(type="oat", levels = 5, grid.jump = 3), binf =1,bsup=20, > scale=F) > > > Error message suggests that the second input factor is not used > How should I define the input factors? > > > Thanks in advance, > Mark > ______________________________________________ > R-help@r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > R-project.org/posting-guide.html<r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Hi List, Running R 2.10.1 on a fresh install of Windows 7. I get the following error when loading the RPostgreSQL package. >library(RPostgreSQL) Loading required package: DBI Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared library 'C:/Users/james/Documents/R/win-library/2.10/RPostgreSQL/libs/RPostgreSQL.dll': LoadLibrary failure: The specified module could not be found. Error: package/namespace load failed for 'RPostgreSQL' I have reinstalled the RPostgreSQL package from several different mirrors and reinstalled R, and the error remains. I know that RPostgreSQL depends on libpq.dll and others, so I downloaded and installed Postgres, then copied the contents of PostgreSQL\8.4\lib to the RPostgreSQL library (C:/Users/james/Documents/R/win-library/2.10/RPostgreSQL/libs/) TIA to anyone who can shed some light. Regards, Jim Hargreaves