comp.soft-sys.sas - The SAS statistics package.
Hi all OK - todays questions: I'd like to use the lsmeans procedure to provide estimates based on the variables in the code below. My problem is that the variable "spddv" (a dummy variable with subjects 1,2,3 and 4) is a class variable, and so does not allow mixed to process this without an error "spddv is not a covariate in the model". How do I do this? Many thanks Stuart proc mixed data = bothtp covtest noclprint ratio ic method = ml; class species treeID regenplot subplot plot year tai spddv; model lnai = /*main effects*/ height species tab Pretapr spddv /*2 way interactive effects*/ Height*tapr baperha*species /*3 way interactive effects*/ species*Yc*ci species*tai*tab species*tapr*yc / cl solution residual noint/*influence outpm = resultbmtp*/; *random int / sub=plot type=un s; *(randomly selected plots); random int / sub=subplot (plot) type=un s; *(randomly selected subplots nested in plots); random int / sub=regenplot(subplot plot) type=un s cl; *(randomly selected regenplots nested in subplots); repeated year / sub=treeID(regenplot subplot plot) type=sp(exp) (year); *(repeated measures per tree over time); lsmeans species / diff at (height ci tapr pretapr baperha spddv yc) = (100 -0.13824 10 10 0 1 12); lsmeans species / diff at (height ci tapr pretapr baperha spddv yc) = (200 0.11197 10 10 0 1 12); lsmeans species / diff at (height ci tapr pretapr baperha spddv yc) = (300 0.21460 10 10 0 1 12); lsmeans species / diff at (height ci tapr pretapr baperha spddv yc) = (400 0.27720 10 10 0 1 12); lsmeans species / diff at (height ci tapr pretapr baperha spddv yc) = (500 0.26826 10 10 0 1 12); ods output /*solutionf = fixed solutionr = random*/ lsmeans = lsmean /*influence = infbmtp*/; run;
Dear SAS users, I am interested in estimated means and SE's of variable SpawnInterval for two values of binary variable Major4, taking nested phylogenetic covariance into account. Two apparent problems in the results (see below) are: 1) the mean spawning intervals given by the "lsmeans" statement are different when the random statements are included and when they are not. I expected the estimates themselves to be identical, but a larger SE for GLS, as discussed in Litton and generally held for GLS vs. OLS. 2) the SE's given in the 1st case (with random statements) are large and clearly overlap, yet the the p-value for the coefficient Major is 0.065. Am I doing something wrong, or is something wrong with my expectations? Thanks (details below), Yetta I submitted the following statements: Title "Relationship between SI and Major4 accessory, nested random effects for class order"; 29 Proc mixed data=Phylo.FishData method=REML covtest noclprint=10 noitprint; 30 class Major4 class order family; 31 model SpawnInterval = Major4 / solution chisq; 32 random intercept / subject=class; 33 random intercept / subject=order(class); 34 lsmeans major4; 35 run; WARNING: Class levels for Order are not printed because of excessive size. WARNING: Class levels for Family are not printed because of excessive size. NOTE: 5 observations are not included because of missing values. NOTE: PROCEDURE MIXED used (Total process time): real time 1.39 seconds cpu time 0.12 seconds *** Results of analysis with random statements below *** Type 3 Tests of Fixed Effects Num Den Effect DF DF Chi-Square F Value Pr > ChiSq Pr > F Major4 1 316 3.41 3.41 0.0646 0.0656 Least Squares Means Major accessory Standard Effect 1=true Estimate Error DF t Value Pr > |t| Major4 0 1.3808 0.3978 316 3.47 0.0006 Major4 1 1.5093 0.3957 316 3.81 0.0002 *** Versus case with random statements commented out ****** Proc mixed data=Phylo.FishData method=REML covtest noclprint=10 noitprint; 44 class Major4 class order family; 45 model SpawnInterval = Major4 / solution chisq; 46 * random intercept / subject=class; 47 * random intercept / subject=order(class); 48 lsmeans major4; 49 run; *** Results - no random statements *** Type 3 Tests of Fixed Effects Num Den Effect DF DF Chi-Square F Value Pr > ChiSq Pr > F Major4 1 351 42.18 42.18 <.0001 <.0001 Least Squares Means Major accessory Standard Effect 1=true Estimate Error DF t Value Pr > |t| Major4 0 0.9028 0.06796 351 13.28 <.0001 Major4 1 1.5029 0.06259 351 24.01 <.0001
Hello All, As far as I know, SAS Proc Mixed is not calculating the CONTRAST between covariates. It does not even do LSMEANS. I have some covariates in the model that I want to compare them. Please look at the following code: PROC MIXED DATA = Analyze; CLASS cont sex; MODEL colour = sex CovA1 CovA2 CovB1 CovB2 CovA1*CovB1 CovA1*CovB2 CovA2*CovB1 CovA2*CovB2 / SOLUTION; RANDOM cont; RUN; Assume that the interaction is significant, how I can say that the CovA solutions are differnt from each other within each class on CovB and ...? Thanks, MJK
Does anyone know why I am getting non-est lsmeans? ********************************************************************* Program: proc glm data=ana; class product_offer_new pdb_list_type_new zip10r_seg; model resp=product_offer_new pdb_list_type_new zip10r_seg /solution; weight season_effect_weight; lsmeans product_offer_new /stderr pdiff out=prod_adjmeans; lsmeans pdb_list_type_new /stderr pdiff out=list_adjmeans; lsmeans zip10r_seg /stderr pdiff out=zip_score_adjmeans; Class Levels Values PRODUCT_OFFER_NEW 10 PDB_LIST_TYPE_NEW 4 ZIP10R_SEG 20 Output: NOTE: The X'X matrix has been found to be singular, and a generalized inverse was used to solve the normal equations. Terms whose estimates are followed by the letter 'B' are not uniquely estimable. The GLM Procedure Least Squares Means PRODUCT_OFFER_ LSMEAN NEW RESP LSMEAN Number Commits Non-est 1 Competitor Price Non-est 2 Content Non-est 3 General Price Non-est 4 Intro Price Non-est 5 Offer Non-est 6 Premium Offers Non-est 7 Premium Services Non-est 8 Price Choice Non-est 9 Registration Non-est 10