code: def linear_regression_gwas(
      genotypes: Union[Column, str],
      phenotypes: Union[Column, str],
      covariates: Union[Column, str],
  ) -> Column:
      """
      Performs a linear regression association test optimized for performance in a GWAS setting. See :ref:`linear-regression` for details.
  
      Added in version 0.3.0.
  
      Examples:
          >>> from pyspark.ml.linalg import DenseMatrix
          >>> phenotypes = [2, 3, 4]
          >>> genotypes = [0, 1, 2]
          >>> covariates = DenseMatrix(numRows=3, numCols=1, values=[1, 1, 1])
          >>> df = spark.createDataFrame([Row(genotypes=genotypes, phenotypes=phenotypes, covariates=covariates)])
          >>> df.select(glow.expand_struct(glow.linear_regression_gwas('genotypes', 'phenotypes', 'covariates'))).collect()
          [Row(beta=0.9999999999999998, standardError=1.4901161193847656e-08, pValue=9.486373847239922e-09)]
  
      Args:
          genotypes : A numeric array of genotypes
          phenotypes : A numeric array of phenotypes
          covariates : A ``spark.ml`` ``Matrix`` of covariates
  
      Returns:
          A struct containing ``beta``, ``standardError``, and ``pValue`` fields. See :ref:`linear-regression`.
      """
      assert check_argument_types()
      output = Column(
          sc()._jvm.io.projectglow.functions.linear_regression_gwas(
              _to_java_column(genotypes),
              _to_java_column(phenotypes),
              _to_java_column(covariates),
          )
      )
      assert check_return_type(output)
      return output
  
imports: from pyspark import SparkContext
  from pyspark.sql.column import Column, _to_java_column, _to_seq
  from typeguard import check_argument_types, check_return_type
  from typing import Union
label_desc: Use image node_id 21 for calling a global function with example usage: linear_regression_gwas(genotypes, phenotypes, covariates) and returns: output