code: def generate_crossed(
      n_group1=100,
      n_group2=100,
      n_rep=4,
      group1_sd=2,
      group2_sd=3,
      unexplained_sd=4,
  ):
      # Group 1 indicators
      group1 = np.kron(
          np.arange(n_group1, dtype=int),
          np.ones(n_group2 * n_rep, dtype=int),
      )
      group1 = group1[np.random.permutation(len(group1))]
  
      # Group 1 effects
      u = group1_sd * np.random.normal(size=n_group1)
      effects1 = u[group1]
  
      # Group 2 indicators
      group2 = np.kron(
          np.arange(n_group2, dtype=int),
          np.ones(n_group2 * n_rep, dtype=int),
      )
      group2 = group2[np.random.permutation(len(group2))]
  
      # Group 2 effects
      u = group2_sd * np.random.normal(size=n_group2)
      effects2 = u[group2]
  
      e = unexplained_sd * np.random.normal(
          size=n_group1 * n_group2 * n_rep
      )
      y = effects1 + effects2 + e
  
      df = pd.DataFrame({"y": y, "group1": group1, "group2": group2})
  
      return df
  
file_path: statsmodels/examples/python/variance_components.py
imports: import numpy
  import statsmodels.api
  from statsmodels.regression.mixed_linear_model import VCSpec
  import pandas
label_desc: Use image node_id 3 for calling a global function with example usage: generate_crossed(n_group1, n_group2, n_rep, group1_sd, group2_sd, unexplained_sd) and returns: df