title: Basic - T-Test -> Grouping Factor Must have Exactly 2 Levels
body: <p>I am relatively new to R. For my assignment I have to start by conducting a T-Test by looking at the effect of a politician's (Conservative or Labour) wealth on their real gross wealth and real net wealth. I have to attempt to estimate the effect of serving in office wealth using a simple t-test.</p>
  
  <p>The dataset is called takehome.dta</p>
  
  <p>Labour and Tory are binary where 1 indicates that they serve for that party and 0 otherwise.</p>
  
  <p>The variables for wealth are lnrealgross and lnrealnet. </p>
  
  <p>I have imported and attached the dataset, but when I attempt to conduct a simple t-test. I get the following message "grouping factor must have exactly 2 levels." Not quite sure where I appear to be going wrong. Any assistance would be appreciated! </p>