Attitude estimation is crucial in aerospace engineering, robotics, and virtual reality applications, but faces difficulties due to nonlinear system dynamics and sensor limitations. This paper addresses the challenge of attitude estimation using quaternion-based adaptive right invariant extended Kalman filtering (RI-EKF) that integrates data from inertial and magnetometer sensors. Our approach applies the expectation-maximization (EM) algorithm to estimate noise covariance, exploiting RI-EKF symmetry properties. We analyze the adaptive RI-EKF's stability, convergence, and accuracy, validating its performance through simulations and comparison with the left invariant EKF. Monte Carlo simulations validate the effectiveness of our noise covariance estimation technique across various window lengths.