# R: Rcmdr -- how to

With a bit of experience, it's easy to find one's way around the menus in Rcmdr to reach a desired analysis. It's harder for a beginner and the following recipes should help you get started.

## Graphs with Rcmdr

Getting graphs with Rcmdr
one categorical variable Graphs | Bar graph
Graphs | Pie chart
two categorical variables need command line library(lattice);with(Dataset, barchart( table( Xcat, Ycat), stack = F, auto.key=T))
X categorical
and Y numeric
Graphs | Boxplot click on Plot by groups
one numeric variable Graphs | Histogram
Graphs | Boxplot
two numeric variables Scatterplot prompts for x and y variables
X and Y numeric
and Z categorical
Graphs | Scatterplot click on Plot by groups to choose Z

## Statistics with Rcmdr

Getting numerical statistics with Rcmdr
all variables Data | Summaries | Active data sets
one categorical variable Statistics | Summaries | Frequency distributions
two categorical variables in a data frame Statistics | Contingency tables | Two-way tables Choose X as Row variable and Y as Column variable
request multiple tables selecting No percentages and Column percentages
two categorical variables using a table Statistics | Contingency tables | Enter and analyze two-way tables Enter the table manually
X categorical and Y numeric Statistics | Means | One-way ANOVA
Statistics | Summaries | Numerical summaries
X variable is groups
one numeric variable Statistics | Means | Single-sample t-test
Statistics | Summaries | Numerical summaries
two numeric variables Statistics | Fit models
X and Y numeric
and Z categorical
Statistics | Fit models

## Regression with two variables with Rcmdr

Relationships between two quantitative variables with Rcmdr
Explore numeric variables
+ possibly 1 categorical variable
Graphs | Scatterplot matrix
Graphs | 3D Graphs | 3D scatterplot
Statistics | Summaries | Numerical summaries
You can also include one categorical variable by selecting "Summarize by groups" or "Plot by groups"
Scatterplot Graphs | Scatterplot
Correlation Statistics | Summaries | Correlation matrix Use correlation test for p-values
Fitting the least-squares line
i.e. the estimated linear regression equation
Statistics | Fit models | Linear regression
Models | Summarize models / Confidence intervals / Add observation statistics to data /etc.
After adding observation statistics to data you can plot residuals in various ways to whether there are patterns remaining in the residuals

Relationships between two categorical variables with Rcmdr
Graph need command line library(lattice);with(Dataset, barchart( table( Xcat, Ycat), stack = F, auto.key=T))
Statistics Statistics | Contingency tables | Two-way tables Choose X as Row variable and Y as Column variable
request multiple tables selecting No percentages and Column percentages

## Using Rcmdr for basic analyses (with pictures)

The following is a pictorial how-to guide for basic analyses with Rcmdr. For most analyses, you will see

1. the drop-down menu selections to perform the analysis
3. the ouput

Each is annotated as it seems appropriate.

The following analyses and transformations are shown:

1. Recoding a numeric variable into a categorical variable
To form meaningful categories from a numerical variable.
2. Dichotomizing a categorical variable
For some analyses, e.g. proportions from a single population or proportions from two populations, you need a 'dichotomous' categorical variable, i.e. a variable with only two values (e.g. 'male' and 'female', or 'professional' and 'other') plus, possibly, NAs.
3. Proportion for a single population
4. Proportions for samples from two populations
5. Proportions for three or more populations
6. Analyzing two levels of a category with three or more levels
7. Mean from one population
8. Comparing means from two populations
9. Comparing means from three of more populations
10. Simple regression

### Recoding a numeric variable into a categorical variable

To transform a numerical variable into a categorical variable, use 'recode'.

### Mean from one population

[Image:StatisticsOneSampleTTest.png|thumb|center|400px]]