diff --git a/.gitignore b/.gitignore index 77cc18b..b51d6b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ man/.Rhistory + +man/.Rapp.history diff --git a/DESCRIPTION b/DESCRIPTION old mode 100755 new mode 100644 index f9d8cd8..62a8165 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,19 +1,15 @@ -Package: interflex -Type: Package -Title: Multiplicative Interaction Models Diagnostics and Visualization -Version: 1.0.2 -Date: 2017-1-25 -Author: Jens Hainmueller, Jonathan Mummolo and Yiqing Xu -Maintainer: Yiqing Xu -Description: Performs diagnostic tests of multiplicative interaction models and plots non-linear marginal effects of a treatment on an outcome across different values of a moderator. -License: GPL-2 -Imports: Rcpp (>= 0.12.3), - ggplot2 (>= 2.1.0), - sandwich (>= 2.3-4), - pcse (>= 1.9), - lmtest (>= 0.9-34), - Lmoments (>= 1.2-3), - doParallel (>= 1.0.10), - foreach (>= 1.4.3), - mgcv(>= 1.8-16) -LinkingTo: Rcpp, RcppArmadillo +Package: interflex +Type: Package +Title: Multiplicative Interaction Models Diagnostics and Visualization +Version: 1.0.2 +Date: 2017-1-25 +Author: Jens Hainmueller, Jonathan Mummolo and Yiqing Xu +Maintainer: Yiqing Xu +Description: Performs diagnostic tests of multiplicative interaction models and plots non-linear marginal effects of a treatment on an outcome across different values of a moderator. +License: GPL-2 +Imports: Rcpp (>= 0.12.3), ggplot2 (>= 2.1.0), sandwich (>= 2.3-4), + pcse (>= 1.9), lmtest (>= 0.9-34), Lmoments (>= 1.2-3), + doParallel (>= 1.0.10), foreach (>= 1.4.3), mgcv(>= 1.8-16) +LinkingTo: Rcpp, RcppArmadillo +NeedsCompilation: yes +Packaged: 2017-02-25 16:02:46 UTC; lenovo diff --git a/NAMESPACE b/NAMESPACE old mode 100755 new mode 100644 index 62eab70..4dc146f --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -useDynLib(interflex) +useDynLib(interflex, .registration=TRUE) importFrom(Rcpp, evalCpp) importFrom("grDevices", "col2rgb", "graphics.off", "pdf", "rgb") importFrom("parallel", "detectCores", "stopCluster", "makeCluster") diff --git a/R/RcppExports.R b/R/RcppExports.R old mode 100755 new mode 100644 diff --git a/R/interflex.R b/R/interflex.R old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 786c6bd..8d63515 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ **Maintainer:** Yiqing Xu [] -**How to Uses:** [Examples](http://yiqingxu.org/software/interplot/RGuide.html) +**How to Uses:** [Examples](http://yiqingxu.org/software/interaction/RGuide.html) **Reference:** "How Much Should We Trust Estimates from Multiplicative Interaction Models? Simple Tools to Improve Empirical Practice." Available at SSRN: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2739221 diff --git a/man/.Rapp.history b/man/.Rapp.history deleted file mode 100644 index e69de29..0000000 diff --git a/man/inter.binning.Rd b/man/inter.binning.Rd old mode 100755 new mode 100644 diff --git a/man/inter.gam.Rd b/man/inter.gam.Rd old mode 100755 new mode 100644 diff --git a/man/inter.kernel.Rd b/man/inter.kernel.Rd old mode 100755 new mode 100644 diff --git a/man/inter.raw.Rd b/man/inter.raw.Rd old mode 100755 new mode 100644 diff --git a/man/interflex-package.Rd b/man/interflex-package.Rd old mode 100755 new mode 100644 diff --git a/man/s1.Rd b/man/s1.Rd old mode 100755 new mode 100644 diff --git a/man/s2.Rd b/man/s2.Rd old mode 100755 new mode 100644 diff --git a/man/s3.Rd b/man/s3.Rd old mode 100755 new mode 100644 diff --git a/man/s4.Rd b/man/s4.Rd old mode 100755 new mode 100644 diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp old mode 100755 new mode 100644 diff --git a/src/fastplm.cpp b/src/fastplm.cpp old mode 100755 new mode 100644 index 87ed08e..debe74c --- a/src/fastplm.cpp +++ b/src/fastplm.cpp @@ -7,7 +7,7 @@ using namespace Rcpp; List fastplm(arma::mat data, arma::mat FE, arma::colvec weight, - int FEcoefs = 0 + int FEcoefs = 0L ){ // parse data @@ -33,9 +33,9 @@ List fastplm(arma::mat data, //arma::colvec se; // SE (full) arma::colvec coef; // coefficient //arma::colvec stderror; // SE - int df; // degrees of freedom - double sig2; // sigma2 - double mu; // grand mean + //int df; // degrees of freedom + //double sig2; // sigma2 + double mu = 0; // grand mean arma::colvec LHS; // group means arma::mat W; // big weighting matrix to calculate fixed effects arma::colvec alphas; // fixed effect coefficients @@ -146,8 +146,8 @@ List fastplm(arma::mat data, // std.err. - df = n - gtot - p; - sig2 = arma::as_scalar(resid.t()*resid/df); + // df = n - gtot - p; + //sig2 = arma::as_scalar(resid.t()*resid/df); // if (p>0) { // stderror = arma::sqrt(sig2 * arma::diagvec(arma::inv(arma::trans(X)*X))); // } diff --git a/src/interflex_init.c b/src/interflex_init.c new file mode 100644 index 0000000..3fc0628 --- /dev/null +++ b/src/interflex_init.c @@ -0,0 +1,21 @@ +// This file was automatically generated by 'Kmisc::registerFunctions()' + +#include +#include + +#include + +SEXP interflex_fastplm(SEXP dataSEXP, SEXP FESEXP, SEXP weightSEXP, SEXP FEcoefsSEXP); +SEXP interflex_fastplm_predict(SEXP muSEXP, SEXP FEvaluesSEXP, SEXP FESEXP, SEXP newxSEXP, SEXP betaSEXP); + +R_CallMethodDef callMethods[] = { + {"C_interflex_fastplm", (DL_FUNC) &interflex_fastplm, 4}, + {"C_interflex_fastplm_predict", (DL_FUNC) &interflex_fastplm_predict, 5}, + {NULL, NULL, 0} +}; + +void R_init_interflex(DllInfo *info) { + R_registerRoutines(info, NULL, callMethods, NULL, NULL); + R_useDynamicSymbols(info, FALSE); +} + diff --git a/src/symbols.rds b/src/symbols.rds deleted file mode 100755 index c382061..0000000 Binary files a/src/symbols.rds and /dev/null differ