This Matlab package is written and maintained by Xu Liu.
Copyright 2015 Michigan State University. All rights reserved.

The code is for the paper "Partial linear varying multi-index coefficient model for integrative gene-environment interactions" submitted to Statistica Sinica by Xu Liu, Yuehua Cui and Runze Li

This package includes Two main functions, main_Estimation.m and main_TestNonparam.m. There are two files, "TestNonParamMultiFunct" and "plsivcMulti" mexed by Matlab from .cpp.

##########################################################################
All files are listed below:

main_Estimation.m ----- the main function for estimation.

% Input:
%          data_pheno --- input phonetype data with format [y, z, x];
%          G ------------ genotype data as a vector
%          p------------- dimension of loading parameter beta
%          q------------- dimension of z in linear part
%          order -------- the order of B-spline basic function
%          nq ----------- the number of interior knots
%          isplot ------- if want to plot the estimated curve
%
%
% Output: result.mat, including follow fields.
%
%          alpha_beta --- estimated alpha and beta. It's a nf*(p+q)-vector, where nf is the number of functions.
%          curve -------- estimated curves at preset points w0
%          hatb --------- estimated bias at preset points w0
%          hatv --------- estimated variance at preset points w0
%  
%  
%
%
%   For example:
%   main_Estimation(data,G,3,2,4, 3,1)
%

############################################################################

main_TestNonparam.m ----- the main function for nonparametric Testing.

% Input:
%          data_pheno --- input phenotype data with format [y, z, x];
%          G ------------ input genotype data with a vector;
%          p ------------ dimension of loading parameter beta
%          q ------------ dimension of z in linear part
%          nf ----------- the number of total functions
%          nt ----------- the number of functions to be tested
%          B ------------ the number of bootstrap, B=500
%
%
% Output:  result.mat, including follow fields.
%
%          T0 ----------- the value of test statistic
%          TB ----------- the value of test statistic for all bootstrap
%                         smaples, It is a vector.
%  
%  
%
%
%   For example:
%   main_TestNonParam(data_pheno, G, 3, 2, 2, 1, 10)
%
%
%
% Note: The bandwidth selection is not recommended, but you can still set isbandwidth =1 to select bandwidth.

############################################################################

data files:

data_geno is a genotype data file, a matrix with dimention nxg, where n is the sample size, and g is the number of SNP. There is NO header, NO row name. If one has multiple SNP variables, then a for loop should be applied in the finction. 

data-pheno is a phenotype data file, a matrix with format [Y,Z,X] and dimention nx(p+q+1), where Y is the response, X is the loading covariates with dimention p, Z is the covariates with dimention q in the linear part, and n is the sample size. There is NO header, NO row name.


