Skip to content

Commit

Permalink
CRAN Version
Browse files Browse the repository at this point in the history
Updated
  • Loading branch information
xuyiqing committed Feb 26, 2017
1 parent dfef56a commit 02b253b
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

man/.Rhistory

man/.Rapp.history
34 changes: 15 additions & 19 deletions DESCRIPTION
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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 <yiqingxu@ucsd.edu>
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 <yiqingxu@ucsd.edu>
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
2 changes: 1 addition & 1 deletion NAMESPACE
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
Empty file modified R/RcppExports.R
100755 → 100644
Empty file.
Empty file modified R/interflex.R
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

**Maintainer:** Yiqing Xu [<yiqingxu@ucsd.edu>]

**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

Expand Down
Empty file removed man/.Rapp.history
Empty file.
Empty file modified man/inter.binning.Rd
100755 → 100644
Empty file.
Empty file modified man/inter.gam.Rd
100755 → 100644
Empty file.
Empty file modified man/inter.kernel.Rd
100755 → 100644
Empty file.
Empty file modified man/inter.raw.Rd
100755 → 100644
Empty file.
Empty file modified man/interflex-package.Rd
100755 → 100644
Empty file.
Empty file modified man/s1.Rd
100755 → 100644
Empty file.
Empty file modified man/s2.Rd
100755 → 100644
Empty file.
Empty file modified man/s3.Rd
100755 → 100644
Empty file.
Empty file modified man/s4.Rd
100755 → 100644
Empty file.
Empty file modified src/RcppExports.cpp
100755 → 100644
Empty file.
12 changes: 6 additions & 6 deletions src/fastplm.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)));
// }
Expand Down
21 changes: 21 additions & 0 deletions src/interflex_init.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// This file was automatically generated by 'Kmisc::registerFunctions()'

#include <R.h>
#include <Rinternals.h>

#include <R_ext/Rdynload.h>

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);
}

Binary file removed src/symbols.rds
Binary file not shown.

0 comments on commit 02b253b

Please sign in to comment.