class_docstr: A Formula is a model for a mean in a regression model.
  
  It is often given by a sequence of sympy expressions, with the mean
  model being the sum of each term multiplied by a linear regression
  coefficient.
  
  The expressions may depend on additional Symbol instances, giving a
  non-linear regression model.
class_docstr_tok: ["A","Formula","is","a","model","for","a","mean","in","a","regression","model",".","It","is","often","given","by","a","sequence","of","sympy","expressions",",","with","the","mean","model","being","the","sum","of","each","term","multiplied","by","a","linear","regression","coefficient",".","The","expressions","may","depend","on","additional","Symbol","instances",",","giving","a","non-linear","regression","model","."]
docstr: New Formula by deleting terms in `other` from those in `self`
  
  Create and return a new Formula by deleting terms in `other` from those
  in `self`.
  
  No exceptions are raised for terms in `other` that do not appear in
  `self`.
  
  Parameters
  ----------
  other : Formula instance
      Object for which ``is_formula(other)`` is True
  
  Returns
  -------
  subbed : Formula instance
      Formula with terms of `other` removed from terms of `self`
  
  Examples
  --------
  >>> x, y, z = [Term(l) for l in 'xyz']
  >>> f1 = Formula([x, y, z])
  >>> f2 = Formula([y]) + I
  >>> f1.mean
  _b0*x + _b1*y + _b2*z
  >>> f2.mean
  _b0*y + _b1
  >>> f3 = f2 - f1
  >>> f3.mean
  _b0
  >>> f4 = f1 - f2
  >>> f4.mean
  _b0*x + _b1*z
docstr_tok: ["New","Formula","by","deleting","terms","in","`","other","`","from","those","in","`","self","`","Create","and","return","a","new","Formula","by","deleting","terms","in","`","other","`","from","those","in","`","self","`",".","No","exceptions","are","raised","for","terms","in","`","other","`","that","do","not","appear","in","`","self","`",".","Parameters","--","--","--","--","--","other",":","Formula","instance","Object","for","which","``","is_formula","(","other",")","``","is","True","Returns","--","--","--","-","subbed",":","Formula","instance","Formula","with","terms","of","`","other","`","removed","from","terms","of","`","self","`","Examples","--","--","--","--",">",">",">","x",",","y",",","z","=","[","Term","(","l",")","for","l","in","'xyz","'","]",">",">",">","f1","=","Formula","(","[","x",",","y",",","z","]",")",">",">",">","f2","=","Formula","(","[","y","]",")","+","I",">",">",">","f1.mean","_b0","*","x","+","_b1","*","y","+","_b2","*","z",">",">",">","f2.mean","_b0","*","y","+","_b1",">",">",">","f3","=","f2","-","f1",">",">",">","f3.mean","_b0",">",">",">","f4","=","f1","-","f2",">",">",">","f4.mean","_b0","*","x","+","_b1","*","z"]
code: def __sub__(self, other):
      """New Formula by deleting terms in `other` from those in `self`
  
      Create and return a new Formula by deleting terms in `other` from those
      in `self`.
  
      No exceptions are raised for terms in `other` that do not appear in
      `self`.
  
      Parameters
      ----------
      other : Formula instance
          Object for which ``is_formula(other)`` is True
  
      Returns
      -------
      subbed : Formula instance
          Formula with terms of `other` removed from terms of `self`
  
      Examples
      --------
      >>> x, y, z = [Term(l) for l in 'xyz']
      >>> f1 = Formula([x, y, z])
      >>> f2 = Formula([y]) + I
      >>> f1.mean
      _b0*x + _b1*y + _b2*z
      >>> f2.mean
      _b0*y + _b1
      >>> f3 = f2 - f1
      >>> f3.mean
      _b0
      >>> f4 = f1 - f2
      >>> f4.mean
      _b0*x + _b1*z
      """
      if not is_formula(other):
          raise ValueError(
              "only Formula objects can be subtracted from a Formula"
          )
      # Preserve order of terms in subtraction
      unwanted = set(other.terms)
      d = [term for term in self.terms if term not in unwanted]
      return Formula(d)
  
imports: import itertools
  import warnings
  from string import ascii_letters, digits
  import numpy
  import sympy
  from scipy.linalg import pinv
  from sympy import Dummy, default_sort_key
  from sympy.utilities.lambdify import implemented_function, lambdify
  from nipy.algorithms.utils.matrices import full_rank, matrix_rank
  from nipy.utils import VisibleDeprecationWarning, _NoValue
label_desc: Use image node_id 12 for calling the Formula obj's underlying member method code with example usage: obj.__sub__(other) and returns: Formula