<!-- Define a rwizard -->
<rwizard name="logreg" description="Logistic regression" 
         menu="/Regression" icon="logisticregression.png" selectionas="DV">
    <about 
        name="Logistic regression"
        version="0.1"
        copyright="(c) 2010 Dan Dediu"
        comments="Logistic regression using glm"
        license="GLPv3"
        website="http://rgedit.sourceforge.net/"
        authors="Dan Dediu &lt;ddediu@hotmail.com&gt;" 
        documenters=""
        artists=""
        translator_credits=""
        logo_icon_name="logisticregression.png"/>
        
    <help rhelp="?glm"/>

    <vars>  
        <!-- Define the variables (placeholders) -->
    
        <!-- This will be a single dialog (screen) in the vertical order given -->
        <block title="The DV, IVs, link function and dataset">
            <variable name="DV" description="The dependent variable" type="text" default="" required="True" tooltip="Must be either a binary/factor column or a two-column proportions matrix"/>
            <variable name="IVs" description="The model containing the independent variables" type="text" default="" required="True" tooltip="Describe the full model using &lt;b&gt;+&lt;/b&gt; &lt;b&gt;*&lt;/b&gt; &lt;b&gt;:&lt;/b&gt; &lt;b&gt;I(.)&lt;/b&gt; (e.g., &lt;b&gt;x * I(x^2)&lt;/b&gt;)."/>
            <variable name="dataset" description="The dataset (if any)" type="text" default="NA" required="True" tooltip="NA means that no dataset is defined"/>
            <variable name="family" description="The link function" type="text" default='binomial(link = "logit")' required="True" tooltip="Consult &lt;b&gt;?family&lt;/b&gt; for details"/>
        </block>
        
    </vars>  

    <template> 
        <!-- The actual R code template: only strange thing is the placeholders call using ${PLACEHOLDER_NAME} -->
        <!-- and the Python scripts within $[Python ... $] which are evlautated and the result inserted in the R code -->
glm( ${DV} ~ ${IVs}, family=${family} $[Python ', data=${dataset}' if '${dataset}' != 'NA' else '' $] );
    </template> 

</rwizard>

