In R, how do I find the optimal variable to maximize or minimize correlation between several datasets

后端 未结 3 2189
自闭症患者
自闭症患者 2020-12-10 22:00

I am able to do this easily in Excel, but my dataset has gotten too large. In excel, I would use solver.

Column A,B,C,D = random numbers 
Column E = random          


        
3条回答
  •  天涯浪人
    2020-12-10 22:22

    This may not be the easiest way first time thru, but I wrote a function which uses the package BB to back-solve systems of equations. You can download it: http://home.comcast.net/~cgwcgw/ktsolve.R .

    update

    Of course comcast's home pages are long gone. Go get the "ktsolve" package at CRAN

    There's reasonably comprehensible documentation in the comments at the top of the source file. Basically, you create a function whose outputs are the results of all your equations, feed ktsolve a set of "knowns" and a list of the variables which are 'unknowns,' and rather like the commercial app "TK!Solver" it finds the answers for you. If you do decide to try this out, feel free to email me for help in using it.

提交回复
热议问题