LME_POWER_EFFECTSIZE-Findstheminimumdetectableeffectsize(MDES)viasimulation.Thisisthecoreworkerfunctionforthepoweranalysistoolkit.Itsystematicallysearchesforthesmallesteffectsizethatcanbedetectedwithaspecifiedstatisticalpower(theMDES).Process:1.Abaselinelinearmixed-effectsmodelisfittotheactualdatatoextractitsvariancecomponents(randomeffectsandresidualerror).2.Thefunctionentersaloop,startingwithasmallhypotheticaleffectsize.3.Ineachloopiteration,itrunshundredsorthousandsofsimulations.Eachsimulationgeneratesanewdatasetwiththesamenoisecharacteristicsastherealdatabutwiththecurrenthypotheticaleffect"injected"intothespecifiedcategory.4.AnLMEmodelisfittoeachsimulateddataset,andthefunctionchecksifthep-valuefortheeffectissignificant(e.g.,<0.05).5.Thestatisticalpowerforthecurrenteffectsizeiscalculatedastheproportionofsimulationsthatyieldedasignificantresult.6.Ifthecalculatedpowerislessthanthe`target_power`,theeffectsizeisincreased,andthelooprepeats.7.Theloopterminateswhenthe`target_power`isachieved,andtheeffectsizefromthatiterationisreturnedastheMDES.Inputs:tbl-Theinputdatatable.categories_name-Stringnameofthecolumnwithfixed-effectcategories.y_name-Stringnameoftheresponsevariablecolumn.reference_category-Stringnameofthecategorytouseasabaseline.group_name-Stringnameofacolumnfortherandom-effectsgrouping.category_to_test-Stringnameofthespecificcategorytotest.target_power-Thedesiredstatisticalpower(e.g.,0.80for80%).Name-ValueOptions:'Alpha'-Thesignificancelevel(p-valuethreshold).Defaultis0.05.'NumSimulations'-Thenumberofsimulationstorunateachstepoftheeffect-sizesearch.Moresimulationsleadtomorestableestimatesbuttakelonger.Defaultis500.'EffectStep'-Theamounttoincreasetheeffectsizeateachstepofthesearch.Ifnotspecified(-1),itisauto-calculatedbasedonthedata's standard deviation. 'Method' - The simulation method to use: 'gaussian', 'shuffle', or 'hierarchical'. Default is 'gaussian'. Outputs: mdes - The minimum detectable effect size for the target power. power_curve - A table containing the results of the search, with columns 'EffectSize' and 'Power'. This is useful for plotting how power changes with effect size.