R: Rcmdr -- how to
From MathWiki
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.
[edit]
Graphs with Rcmdr
Purpose | Rcmdr menu | Notes |
---|---|---|
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 |
[edit]
Statistics with Rcmdr
Purpose | Rcmdr menu | Notes |
---|---|---|
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 |
[edit]
Regression with two variables with Rcmdr
Purpose | Rcmdr menu | Notes |
---|---|---|
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 |
Purpose | Rcmdr menu | Notes |
---|---|---|
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 |
[edit]
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
- the drop-down menu selections to perform the analysis
- the input menu
- the ouput
Each is annotated as it seems appropriate.
The following analyses and transformations are shown:
- Recoding a numeric variable into a categorical variable
- To form meaningful categories from a numerical variable.
- 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.
- Proportion for a single population
- Proportions for samples from two populations
- Proportions for three or more populations
- Analyzing two levels of a category with three or more levels
- Mean from one population
- Comparing means from two populations
- Comparing means from three of more populations
- Simple regression
[edit]
Recoding a numeric variable into a categorical variable
To transform a numerical variable into a categorical variable, use 'recode'.
[edit]
Dichotomizing a categorical variable
[edit]
Proportion for a single population
[edit]
Proportions for samples from two populations
[edit]
Proportions for three or more populations
[edit]
Analyzing two levels of a category with three or more levels
[edit]
Mean from one population
[Image:StatisticsOneSampleTTest.png|thumb|center|400px]]
[edit]
Comparing means from two populations
[edit]
Comparing means from three of more populations
[edit]