Skip to content

Commit

Permalink
updated help docs
Browse files Browse the repository at this point in the history
  • Loading branch information
emerencia committed Jul 28, 2015
1 parent ee43c80 commit 23ff446
Show file tree
Hide file tree
Showing 36 changed files with 128 additions and 138 deletions.
2 changes: 1 addition & 1 deletion R/order_by.r
Expand Up @@ -4,7 +4,7 @@
#' @param av_state an object of class \code{av_state}
#' @param id_field the name of a column in the data set
#' @param impute_method this argument has four possible values: \itemize{
#' \item \code{'BEST_FIT'} - This is not an impute method itself, but tells the function to determine the optimal impute method and use that. This is the default choice for \code{impute_method} when it is not specified.
#' \item \code{'BEST_FIT'} - This is not an imputation method itself, but tells the function to determine the optimal imputation method and use that. This is the default choice for \code{impute_method} when it is not specified.
#' \item \code{'ONE_MISSING'} - Only works when the \code{id_field} in each data subset is an integer range with exactly one value missing and exactly one \code{NA} value. The \code{NA} value is then substituted by the missing index.
#' \item \code{'ADD_MISSING'} - Does not work when one or more rows have an \code{NA} value for \code{id_field}. Only works for integer ranges of \code{id_field} with single increments. Works by adding rows for all missing values in the range between the minimum and maximum value of \code{id_field}. All values in the added rows are \code{NA} except for the \code{id_field} and the field used for grouping the data (if there was one).
#' \item \code{'NONE'} - No imputation is performed.
Expand Down
10 changes: 5 additions & 5 deletions R/var_main.r
Expand Up @@ -4,11 +4,11 @@
#' @param av_state an object of class \code{av_state}
#' @param vars the vector of variables on which to perform vector autoregression. These should be the names of existing columns in the data sets of \code{av_state}.
#' @param lag_max limits the highest possible number of lags that will be used in a model. This number sets the maximum limit in the search for optimal lags.
#' @param significance the maximum P-value for which results are seen as significant. This argument is used in Granger causality tests, Portmanteau tests, and Jarque-Bera tests.
#' @param significance the maximum P-value for which results are seen as significant. This argument is used in Granger causality tests, contemporaneous associations tests, and residual tests.
#' @param exogenous_max_iterations determines how many times we should try to exclude additional outliers for a variable. This argument should be a number between 1 and 3: \itemize{
#' \item \code{1} - When Jarque-Bera tests fail, having \code{exogenous_max_iterations = 1} will only try with removing 3.5x std. outliers for the residuals of variables using exogenous dummy variables.
#' \item \code{2} - When \code{exogenous_max_iterations = 2}, the program will also try with removing 3x std. outliers if JB tests still fail.
#' \item \code{3} - When \code{exogenous_max_iterations = 3}, the program will also try with removing 2.5x std. outliers (not only from the residuals but also from the squares of the residuals) if JB tests still fail.
#' \item \code{1} - When residual tests fail, having \code{exogenous_max_iterations = 1} will only try with removing 3.5x std. outliers for the residuals of variables using exogenous dummy variables.
#' \item \code{2} - When \code{exogenous_max_iterations = 2}, the program will also try with removing 3x std. outliers if residual tests still fail.
#' \item \code{3} - When \code{exogenous_max_iterations = 3}, the program will also try with removing 2.5x std. outliers (not only from the residuals but also from the squares of the residuals) if residual tests still fail.
#' }
#' @param subset specifies which data subset the VAR analysis should run on. The VAR analysis only runs on one data subset at a time. If not specified, the first subset is used (corresponding to \code{av_state$data[[1]]}).
#' @param log_level sets the minimum level of output that should be shown. It should be a number between 0 and 3. A lower level means more verbosity. \code{0} = debug, \code{1} = test detail, \code{2} = test outcomes, \code{3} = normal. The default is set to the value of \code{av_state$log_level} or if that doesn't exist, to \code{0}. If this argument was specified, the original value of \code{av_state$log_level} is be restored at the end of \code{var_main}.
Expand Down Expand Up @@ -41,7 +41,7 @@
#' \item Sets autovar to search only for lag 1 and lag 2 models. Additionally, the lag 2 models are restricted in the sense that only the autoregressive lag 2 is used, i.e., the cross-lagged parameters for lag 2 are constrained.
#' \item The normality assumption (sktest) no longer tests for kurtosis (only for skewness).
#' \item \code{exogenous_max_iterations} is set to 1, meaning we only search one iteration deep for masking outliers, and in this iteration, points that are 2.5xstd away in the residuals or in the squared residuals are masked as outliers.
#' \item Autovar no longer adds constrained versions of the valid models to the list of accepted models.
#' \item Autovar no longer considers constrained versions of the valid models.
#' }
#' @param numcores is the number of cores to use in parallel for evaluation the model. When this variable is \code{1}, no parallel processing is used and all processing is done serially. This variable has to be an integer between 1 and 16. The default value is the detected number of cores on the system (using \code{detectCores()}). If the \code{log_level} is less than 3, the value for \code{numcores} is forced to 1 because output doesn't show up otherwise.
#' @return This function returns the modified \code{av_state} object. The lists of accepted and rejected models can be retrieved through \code{av_state$accepted_models} and \code{av_state$rejected_models}. To print these, use \code{print_accepted_models(av_state)} and \code{print_rejected_models(av_state)}.
Expand Down
Binary file modified inst/help_files/contemporaneous_correlations_plot-6.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified inst/help_files/contemporaneous_correlations_plot-7.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions inst/help_files/convert_to_graph.html
Expand Up @@ -113,8 +113,8 @@ <h2 id="examples">Examples</h2>
d&lt;-load_dataframe(odata,net_cfg)
</div>
<div class='output'>load_dataframe loaded data.frame with 6 columns:
[1] &quot;uw_eigen_factor (scl)&quot; &quot;somberheid (scl)&quot; &quot;ontspanning (scl)&quot; &quot;piekeren (scl)&quot;
[5] &quot;hier_en_nu (scl)&quot; &quot;humor (scl)&quot;
[1] &quot;uw_eigen_factor (scl)&quot; &quot;somberheid (scl)&quot; &quot;ontspanning (scl)&quot; &quot;piekeren (scl)&quot; &quot;hier_en_nu (scl)&quot;
[6] &quot;humor (scl)&quot;
</div>
<div class='input'>d&lt;-add_trend(d)
</div>
Expand All @@ -139,11 +139,11 @@ <h2 id="examples">Examples</h2>

Starting VAR (using 8 cores) with variables: uw_eigen_factor, somberheid, ontspanning, piekeren, hier_en_nu, humor

Done. Processed 72 distinct models, of which 2 were valid.
Done. Processed 71 distinct models, of which 3 were valid.
</div>
<div class='input'>cat(convert_to_graph(d,net_cfg))
</div>
<div class='output'>[{&quot;links&quot;:[{&quot;source&quot;:3,&quot;target&quot;:5,&quot;coef&quot;:&quot;0.481785586106472&quot;}],&quot;nodes&quot;:[{&quot;index&quot;:0,&quot;name&quot;:&quot;uw_eigen_factor&quot;,&quot;type&quot;:&quot;Neutraal&quot;},{&quot;index&quot;:1,&quot;name&quot;:&quot;somberheid&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:2,&quot;name&quot;:&quot;ontspanning&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:3,&quot;name&quot;:&quot;piekeren&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:4,&quot;name&quot;:&quot;hier_en_nu&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:5,&quot;name&quot;:&quot;humor&quot;,&quot;type&quot;:&quot;Positief&quot;}]},{&quot;links&quot;:[{&quot;source&quot;:1,&quot;target&quot;:0,&quot;coef&quot;:&quot;-0.704354443092277&quot;},{&quot;source&quot;:2,&quot;target&quot;:0,&quot;coef&quot;:&quot;0.374887441384029&quot;},{&quot;source&quot;:3,&quot;target&quot;:0,&quot;coef&quot;:&quot;-0.479615443847246&quot;},{&quot;source&quot;:2,&quot;target&quot;:1,&quot;coef&quot;:&quot;-0.490458589750134&quot;},{&quot;source&quot;:3,&quot;target&quot;:1,&quot;coef&quot;:&quot;0.718489480939936&quot;},{&quot;source&quot;:3,&quot;target&quot;:2,&quot;coef&quot;:&quot;-0.641250546144804&quot;},{&quot;source&quot;:4,&quot;target&quot;:2,&quot;coef&quot;:&quot;0.398308436777281&quot;},{&quot;source&quot;:4,&quot;target&quot;:3,&quot;coef&quot;:&quot;-0.41990874105537&quot;},{&quot;source&quot;:5,&quot;target&quot;:3,&quot;coef&quot;:&quot;-0.238867490270759&quot;}],&quot;nodes&quot;:[{&quot;index&quot;:0,&quot;name&quot;:&quot;uw_eigen_factor&quot;,&quot;type&quot;:&quot;Neutraal&quot;},{&quot;index&quot;:1,&quot;name&quot;:&quot;somberheid&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:2,&quot;name&quot;:&quot;ontspanning&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:3,&quot;name&quot;:&quot;piekeren&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:4,&quot;name&quot;:&quot;hier_en_nu&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:5,&quot;name&quot;:&quot;humor&quot;,&quot;type&quot;:&quot;Positief&quot;}]},[{&quot;source&quot;:&quot;piekeren&quot;,&quot;target&quot;:&quot;humor&quot;,&quot;sign&quot;:1}]]</div></pre>
<div class='output'>[{&quot;links&quot;:[{&quot;source&quot;:3,&quot;target&quot;:5,&quot;coef&quot;:&quot;0.458164671592375&quot;}],&quot;nodes&quot;:[{&quot;index&quot;:0,&quot;name&quot;:&quot;uw_eigen_factor&quot;,&quot;type&quot;:&quot;Neutraal&quot;},{&quot;index&quot;:1,&quot;name&quot;:&quot;somberheid&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:2,&quot;name&quot;:&quot;ontspanning&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:3,&quot;name&quot;:&quot;piekeren&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:4,&quot;name&quot;:&quot;hier_en_nu&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:5,&quot;name&quot;:&quot;humor&quot;,&quot;type&quot;:&quot;Positief&quot;}]},{&quot;links&quot;:[{&quot;source&quot;:1,&quot;target&quot;:0,&quot;coef&quot;:&quot;-0.683966901602188&quot;},{&quot;source&quot;:2,&quot;target&quot;:0,&quot;coef&quot;:&quot;0.408214703202763&quot;},{&quot;source&quot;:3,&quot;target&quot;:0,&quot;coef&quot;:&quot;-0.500192327132726&quot;},{&quot;source&quot;:4,&quot;target&quot;:0,&quot;coef&quot;:&quot;0.224864952139855&quot;},{&quot;source&quot;:2,&quot;target&quot;:1,&quot;coef&quot;:&quot;-0.535008299766974&quot;},{&quot;source&quot;:3,&quot;target&quot;:1,&quot;coef&quot;:&quot;0.753548060167665&quot;},{&quot;source&quot;:3,&quot;target&quot;:2,&quot;coef&quot;:&quot;-0.640873526507073&quot;},{&quot;source&quot;:4,&quot;target&quot;:2,&quot;coef&quot;:&quot;0.395905579381768&quot;},{&quot;source&quot;:5,&quot;target&quot;:2,&quot;coef&quot;:&quot;0.215973380741509&quot;},{&quot;source&quot;:4,&quot;target&quot;:3,&quot;coef&quot;:&quot;-0.424190283674256&quot;},{&quot;source&quot;:5,&quot;target&quot;:3,&quot;coef&quot;:&quot;-0.24440840712218&quot;},{&quot;source&quot;:5,&quot;target&quot;:4,&quot;coef&quot;:&quot;0.213104878502493&quot;}],&quot;nodes&quot;:[{&quot;index&quot;:0,&quot;name&quot;:&quot;uw_eigen_factor&quot;,&quot;type&quot;:&quot;Neutraal&quot;},{&quot;index&quot;:1,&quot;name&quot;:&quot;somberheid&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:2,&quot;name&quot;:&quot;ontspanning&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:3,&quot;name&quot;:&quot;piekeren&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:4,&quot;name&quot;:&quot;hier_en_nu&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:5,&quot;name&quot;:&quot;humor&quot;,&quot;type&quot;:&quot;Positief&quot;}]},[{&quot;source&quot;:&quot;piekeren&quot;,&quot;target&quot;:&quot;humor&quot;,&quot;sign&quot;:1}]]</div></pre>
</div>
<div class="span4">
<!-- <ul>
Expand Down
11 changes: 2 additions & 9 deletions inst/help_files/generate_networks.html
Expand Up @@ -144,15 +144,8 @@ <h2 id="examples">Examples</h2>

Starting VAR (using 8 cores) with variables: uw_eigen_factor, somberheid, ontspanning, piekeren, hier_en_nu, humor

Done. Processed 110 distinct models, of which 0 were valid.

====================
var_main(av_state, vars = c(&quot;uw_eigen_factor&quot;, &quot;somberheid&quot;, &quot;ontspanning&quot;, &quot;piekeren&quot;, &quot;hier_en_nu&quot;, &quot;humor&quot;), significance = 0.01, exogenous_max_iterations = 1, log_level = 3, criterion = &quot;AIC&quot;, include_squared_trend = TRUE, split_up_outliers = TRUE, exclude_almost = TRUE, simple_models = TRUE, numcores = 8L)

Starting VAR (using 8 cores) with variables: uw_eigen_factor, somberheid, ontspanning, piekeren, hier_en_nu, humor

Done. Processed 73 distinct models, of which 2 were valid.
[{&quot;links&quot;:[{&quot;source&quot;:3,&quot;target&quot;:5,&quot;coef&quot;:&quot;0.439881753631573&quot;}],&quot;nodes&quot;:[{&quot;index&quot;:0,&quot;name&quot;:&quot;Mijn eigen factor&quot;,&quot;type&quot;:&quot;Neutraal&quot;},{&quot;index&quot;:1,&quot;name&quot;:&quot;Somberheid&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:2,&quot;name&quot;:&quot;Ontspanning&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:3,&quot;name&quot;:&quot;Piekeren&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:4,&quot;name&quot;:&quot;In het hier en nu leven&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:5,&quot;name&quot;:&quot;Humor&quot;,&quot;type&quot;:&quot;Positief&quot;}]},{&quot;links&quot;:[{&quot;source&quot;:1,&quot;target&quot;:0,&quot;coef&quot;:&quot;-0.717631799393314&quot;},{&quot;source&quot;:2,&quot;target&quot;:0,&quot;coef&quot;:&quot;0.380951997236968&quot;},{&quot;source&quot;:3,&quot;target&quot;:0,&quot;coef&quot;:&quot;-0.479650584835714&quot;},{&quot;source&quot;:5,&quot;target&quot;:0,&quot;coef&quot;:&quot;0.269411475157027&quot;},{&quot;source&quot;:2,&quot;target&quot;:1,&quot;coef&quot;:&quot;-0.486195168182016&quot;},{&quot;source&quot;:3,&quot;target&quot;:1,&quot;coef&quot;:&quot;0.722161014531494&quot;},{&quot;source&quot;:5,&quot;target&quot;:1,&quot;coef&quot;:&quot;-0.22425177365318&quot;},{&quot;source&quot;:3,&quot;target&quot;:2,&quot;coef&quot;:&quot;-0.642534855508654&quot;},{&quot;source&quot;:4,&quot;target&quot;:2,&quot;coef&quot;:&quot;0.406163739804556&quot;},{&quot;source&quot;:5,&quot;target&quot;:2,&quot;coef&quot;:&quot;0.302966314209719&quot;},{&quot;source&quot;:4,&quot;target&quot;:3,&quot;coef&quot;:&quot;-0.419174883340831&quot;},{&quot;source&quot;:5,&quot;target&quot;:3,&quot;coef&quot;:&quot;-0.380037618282716&quot;},{&quot;source&quot;:5,&quot;target&quot;:4,&quot;coef&quot;:&quot;0.288767368004057&quot;}],&quot;nodes&quot;:[{&quot;index&quot;:0,&quot;name&quot;:&quot;Mijn eigen factor&quot;,&quot;type&quot;:&quot;Neutraal&quot;},{&quot;index&quot;:1,&quot;name&quot;:&quot;Somberheid&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:2,&quot;name&quot;:&quot;Ontspanning&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:3,&quot;name&quot;:&quot;Piekeren&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:4,&quot;name&quot;:&quot;In het hier en nu leven&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:5,&quot;name&quot;:&quot;Humor&quot;,&quot;type&quot;:&quot;Positief&quot;}]},[{&quot;source&quot;:&quot;piekeren&quot;,&quot;target&quot;:&quot;humor&quot;,&quot;sign&quot;:1}]]</div></pre>
Done. Processed 130 distinct models, of which 1 was valid.
[{&quot;links&quot;:[{&quot;source&quot;:3,&quot;target&quot;:0,&quot;coef&quot;:&quot;0.287260498699047&quot;},{&quot;source&quot;:0,&quot;target&quot;:1,&quot;coef&quot;:&quot;0.483039778494367&quot;},{&quot;source&quot;:3,&quot;target&quot;:5,&quot;coef&quot;:&quot;0.389621951945408&quot;}],&quot;nodes&quot;:[{&quot;index&quot;:0,&quot;name&quot;:&quot;Mijn eigen factor&quot;,&quot;type&quot;:&quot;Neutraal&quot;},{&quot;index&quot;:1,&quot;name&quot;:&quot;Somberheid&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:2,&quot;name&quot;:&quot;Ontspanning&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:3,&quot;name&quot;:&quot;Piekeren&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:4,&quot;name&quot;:&quot;In het hier en nu leven&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:5,&quot;name&quot;:&quot;Humor&quot;,&quot;type&quot;:&quot;Positief&quot;}]},{&quot;links&quot;:[{&quot;source&quot;:1,&quot;target&quot;:0,&quot;coef&quot;:&quot;-0.758949841785574&quot;},{&quot;source&quot;:2,&quot;target&quot;:0,&quot;coef&quot;:&quot;0.344561991781187&quot;},{&quot;source&quot;:3,&quot;target&quot;:0,&quot;coef&quot;:&quot;-0.498409522766993&quot;},{&quot;source&quot;:5,&quot;target&quot;:0,&quot;coef&quot;:&quot;0.236924381820422&quot;},{&quot;source&quot;:2,&quot;target&quot;:1,&quot;coef&quot;:&quot;-0.423916552135352&quot;},{&quot;source&quot;:3,&quot;target&quot;:1,&quot;coef&quot;:&quot;0.683371645024221&quot;},{&quot;source&quot;:3,&quot;target&quot;:2,&quot;coef&quot;:&quot;-0.621180008187608&quot;},{&quot;source&quot;:4,&quot;target&quot;:2,&quot;coef&quot;:&quot;0.374123359048448&quot;},{&quot;source&quot;:5,&quot;target&quot;:2,&quot;coef&quot;:&quot;0.282499905147113&quot;},{&quot;source&quot;:4,&quot;target&quot;:3,&quot;coef&quot;:&quot;-0.385254165880852&quot;},{&quot;source&quot;:5,&quot;target&quot;:3,&quot;coef&quot;:&quot;-0.346368325632066&quot;}],&quot;nodes&quot;:[{&quot;index&quot;:0,&quot;name&quot;:&quot;Mijn eigen factor&quot;,&quot;type&quot;:&quot;Neutraal&quot;},{&quot;index&quot;:1,&quot;name&quot;:&quot;Somberheid&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:2,&quot;name&quot;:&quot;Ontspanning&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:3,&quot;name&quot;:&quot;Piekeren&quot;,&quot;type&quot;:&quot;Negatief&quot;},{&quot;index&quot;:4,&quot;name&quot;:&quot;In het hier en nu leven&quot;,&quot;type&quot;:&quot;Positief&quot;},{&quot;index&quot;:5,&quot;name&quot;:&quot;Humor&quot;,&quot;type&quot;:&quot;Positief&quot;}]},[{&quot;source&quot;:&quot;uw_eigen_factor&quot;,&quot;target&quot;:&quot;somberheid&quot;,&quot;sign&quot;:1},{&quot;source&quot;:&quot;piekeren&quot;,&quot;target&quot;:&quot;humor&quot;,&quot;sign&quot;:1},{&quot;source&quot;:&quot;piekeren&quot;,&quot;target&quot;:&quot;uw_eigen_factor&quot;,&quot;sign&quot;:1}]]</div></pre>
</div>
<div class="span4">
<!-- <ul>
Expand Down
4 changes: 2 additions & 2 deletions inst/help_files/group_by.html
Expand Up @@ -83,7 +83,7 @@ <h2 id="examples">Examples</h2>
print(av_state)
</div>
<div class='output'>
file_name: F:/dropbox/Dropbox/work/work/r/code/preprocessing/../data/input/RuwedataAngela.sav
file_name: /Users/ando/Dropbox/work/work/r/code/preprocessing/../data/input/RuwedataAngela.sav
real_file_name: ../data/input/RuwedataAngela.sav
file_type: SPSS
raw_data: 318 samples with 35 features [missing: 22.47% (2501)]
Expand All @@ -98,7 +98,7 @@ <h2 id="examples">Examples</h2>
<div class='input'>print(av_state)
</div>
<div class='output'>
file_name: F:/dropbox/Dropbox/work/work/r/code/preprocessing/../data/input/RuwedataAngela.sav
file_name: /Users/ando/Dropbox/work/work/r/code/preprocessing/../data/input/RuwedataAngela.sav
real_file_name: ../data/input/RuwedataAngela.sav
file_type: SPSS
raw_data: 318 samples with 35 features [missing: 22.47% (2501)]
Expand Down

0 comments on commit 23ff446

Please sign in to comment.