a week ago
Abdus-Salaam
Obsidian | Level 7
Member since
07-29-2024
- 25 Posts
- 11 Likes Given
- 2 Solutions
- 0 Likes Received
-
Latest posts by Abdus-Salaam
Subject Views Posted 361 01-20-2025 05:21 AM 463 01-19-2025 02:52 PM 645 01-14-2025 10:40 AM 690 01-14-2025 05:43 AM 694 01-14-2025 05:38 AM 704 01-14-2025 04:46 AM 710 01-14-2025 04:17 AM 809 01-13-2025 07:00 AM 973 12-30-2024 07:47 AM 1020 12-30-2024 05:03 AM -
Activity Feed for Abdus-Salaam
- Posted Re: problems with subject option for empirical option in proc mixed on Statistical Procedures. 01-20-2025 05:21 AM
- Liked Re: problems with subject option for empirical option in proc mixed for Ksharp. 01-20-2025 05:15 AM
- Posted problems with subject option for empirical option in proc mixed on Statistical Procedures. 01-19-2025 02:52 PM
- Posted Re: PROC NLmixed: estimated covariance matrix is not full rank on Statistical Procedures. 01-14-2025 10:40 AM
- Posted Re: PROC NLmixed: estimated covariance matrix is not full rank on Statistical Procedures. 01-14-2025 05:43 AM
- Liked Re: PROC NLmixed: estimated covariance matrix is not full rank for Ksharp. 01-14-2025 05:41 AM
- Posted Re: PROC NLmixed: estimated covariance matrix is not full rank on Statistical Procedures. 01-14-2025 05:38 AM
- Posted Re: PROC NLmixed: estimated covariance matrix is not full rank on Statistical Procedures. 01-14-2025 04:46 AM
- Posted Re: PROC NLmixed: estimated covariance matrix is not full rank on Statistical Procedures. 01-14-2025 04:17 AM
- Liked Re: PROC NLmixed: estimated covariance matrix is not full rank for SteveDenham. 01-14-2025 04:17 AM
- Posted PROC NLmixed: estimated covariance matrix is not full rank on Statistical Procedures. 01-13-2025 07:00 AM
- Liked Re: SGPANEL unbold title for yabwon. 01-09-2025 08:21 AM
- Liked Re: SGPANEL unbold title for DanH_sas. 01-09-2025 08:20 AM
- Posted Re: SGPANEL unbold title on Graphics Programming. 12-30-2024 07:47 AM
- Liked Re: SGPANEL unbold title for yabwon. 12-30-2024 07:44 AM
- Posted SGPANEL unbold title on Graphics Programming. 12-30-2024 05:03 AM
- Posted Re: SGPANEL panel heading in two lines on Graphics Programming. 12-01-2024 03:43 AM
- Posted Re: SGPANEL panel heading in two lines on Graphics Programming. 12-01-2024 03:41 AM
- Liked Re: SGPANEL panel heading in two lines for DanH_sas. 12-01-2024 03:40 AM
- Liked Re: SGPANEL panel heading in two lines for Ksharp. 12-01-2024 03:40 AM
-
Posts I Liked
Subject Likes Author Latest Post 2 1 1 2 5
01-20-2025
05:21 AM
Hello Ksharp, thank you a lot 👍. It worked well. the repeated statement with the time variable and the group=Behandlung*NStufe option improved the residual plot of the residuals vs. predicted values a lot compared to the code without the repeated statement.
... View more
01-19-2025
02:52 PM
Dear SAS community, I'm trying to use the empirical option in the proc mixed statement for robust variances in a model because my data doesn*t fulfill homogeneity, even after different transformation (ln, square root). I've also tried it with different groups in the repeated statement, usually i select it via AIC. My model estimates plant numbers of barley plants from a pea-barley intercropping experiment. The experiment design is a randomised incomplete block design with the test factors: - Behandlung(treatment) (6 levels: pure stand, 90:10 (Pea%:Barley%), 70:30, 80:20, 80:40 and 50:50 )
- NStufe(fertiliser level): 0 (no fertilisation), 1 (100 kg N/ha) (for the treatments 80:20 and 80:40 is just NStufe 0 available)
There are 4 observations for each combination, with one missing value for treatment 80:20. I've tried to put the subject option to the random statement and with subject=Behandlung*NStufe because this is how my data is grouped, but i've got the following error in the log:
ERROR: Empirical standard errors cannot be computed for this model because there is only one effective subject.
I've tried it with Behandlung, NStufe and Block as subject but for all i get the same error. Then i've put the subject option in the random statement instead and it worked for all subjects that i've already tried with the repeated statement. My random factor is Block so i guess that i should put it as a subject in the random statement but i'm not really know if this is correct. Can someone help me to find the correct way how to implement the subject option in my code and explain it to me how tho decide that? Here is my code
data a3;
input Datum $ Messtermin Block Parzelle Variante Behandlung NStufe Dichte_Erbse Dichte_Gerste Pflanzenzahl_Gerste;
log_Pflanzenzahl_Gerste=1/(log(Pflanzenzahl_Gerste));
datalines;
06.06.2024 1 1 1 2 1 1 0 100 162.0053691
06.06.2024 1 1 2 10 6 0 80 20 34.6878687
06.06.2024 1 1 3 6 3 0 90 10 26.2
06.06.2024 1 1 4 9 5 0 80 40 29.15329531
06.06.2024 1 1 5 7 4 0 70 30 44.13465347
06.06.2024 1 1 8 5 3 0 90 10 26.71594872
06.06.2024 1 1 9 1 1 0 0 100 159.7818182
06.06.2024 1 1 10 11 7 0 50 50 165.3264368
06.06.2024 1 1 12 8 4 1 70 30 112.1639344
06.06.2024 1 1 14 12 7 1 50 50 76.45019608
06.06.2024 1 2 15 11 7 0 50 50 190.9146341
06.06.2024 1 2 17 5 3 0 90 10 24.98595041
06.06.2024 1 2 18 10 6 0 80 20 .
06.06.2024 1 2 19 7 4 0 70 30 66.45525767
06.06.2024 1 2 20 2 1 1 0 100 262.4124286
06.06.2024 1 2 21 9 5 0 80 40 80.12765957
06.06.2024 1 2 22 6 3 1 90 10 35.16582915
06.06.2024 1 2 25 8 4 1 70 30 111.3658537
06.06.2024 1 2 26 12 7 1 50 50 115.5
06.06.2024 1 2 27 1 1 0 0 100 140.4141414
06.06.2024 1 3 29 8 4 1 70 30 109.1770335
06.06.2024 1 3 30 1 1 0 0 100 160.2692308
06.06.2024 1 3 32 11 7 0 50 50 190.1124051
06.06.2024 1 3 34 10 6 0 80 20 70.88881988
06.06.2024 1 3 35 12 7 1 50 50 57.50456026
06.06.2024 1 3 36 2 1 1 0 100 188.1761006
06.06.2024 1 4 37 9 5 0 80 40 44.62406417
06.06.2024 1 4 38 5 3 0 90 10 23.99574468
06.06.2024 1 4 40 7 4 0 70 30 124.7916667
06.06.2024 1 4 41 6 3 1 90 10 35.54
06.06.2024 1 3 43 1 1 0 0 100 200.3962264
06.06.2024 1 3 44 11 7 0 50 50 92.76923077
06.06.2024 1 3 47 8 4 1 70 30 114.6013072
06.06.2024 1 3 48 9 5 0 80 40 60.27710843
06.06.2024 1 3 49 6 3 1 90 10 29.90909091
06.06.2024 1 3 50 7 4 0 70 30 60.33128834
06.06.2024 1 4 51 5 3 0 90 10 45.22580645
06.06.2024 1 4 52 12 7 1 50 50 75.63299663
06.06.2024 1 4 54 10 6 0 80 20 91.33333333
06.06.2024 1 4 56 2 1 1 0 100 233.2857143
;run;
; /* Pflanzenzahl Gerste = plant count barley*/ Proc mixed data=a3 empirical; class Block Behandlung NStufe; model log_Pflanzenzahl_Gerste = Behandlung*NStufe; repeated/group=Behandlung*NStufe; random Block /subject=Block; lsmeans Behandlung*NStufe/cl; ods output lsmeans = lsmeans; run; ;
... View more
01-14-2025
10:40 AM
My supervisor has found a simple solution for my problem: First he has created new start for the parameters of the model in proc NLmixed with proc mixed (means of the variants and the corresponding (standard errors)²) without the repeated /group=block value that i've had in the proc mixed code for creating start values for nlmixed. That he did since the block effect in my model was set 0, what i haven't recognised. Additionally he divided the grain dry matter values by 1000 wich doesn*t effect the CV since it's calculated with a quotient with two values that are equally effected by the transformation of the dry matter values. Thank you again Mr. Denham and KSharp for your efforts to help me
... View more
01-14-2025
05:43 AM
Hello KSharp,
thank you for the document. It helped me to understand the warning better.
... View more
01-14-2025
05:38 AM
I think the covariance matrix of the parameter estimates from the original data is helpful to understand the problem. I guess the model is overparameterised, or what do you think ? The issue is that i need all the variants in the model to compare their CV's.
covariance matrix of the parameter estimates
t1
t2
t3
t4
t5
t6
t7
t8
t9
t10
t11
t12
v1
v2
v3
v4
v5
v6
v7
v8
v9
v10
v11
v12
t1
88381
0
-5.14E-07
0
6.28E-07
-1.60E-07
0
-1.34E-07
-1.29E-07
0
4.10E-07
2.64E-07
35.243
.
.
0
0
.
.
0
.
.
0
.
t2
0
68045
-1.63E-07
-1.96E-07
4.11E-07
-2.38E-07
1.92E-07
-3.53E-07
1.42E-07
-1.59E-07
2.30E-07
-1.31E-07
0
.
.
0
0
.
.
0
.
.
0
.
t3
-5.14E-07
-1.63E-07
65533
-1.82E-06
0
-2.20E-07
-2.08E-07
-1.34E-07
-3.16E-07
-2.10E-07
-1.12E-07
0
0
.
.
0
0
.
.
0
.
.
0
.
t4
0
-1.96E-07
-1.82E-06
708844
-4.06E-07
-2.56E-06
-2.50E-07
-9.31E-07
-5.56E-07
3.82E-07
0
1.11E-06
8.51E-08
.
.
65.6625
8.12E-08
.
.
0
.
.
2.09E-07
.
t5
6.28E-07
4.11E-07
0
-4.06E-07
91854
0
2.59E-07
-6.47E-07
6.06E-07
1.91E-07
3.69E-07
2.12E-07
0
.
.
0
19.1913
.
.
0
.
.
0
.
t6
-1.60E-07
-2.38E-07
-2.20E-07
-2.56E-06
0
35216
-3.98E-07
1.74E-07
0
0
1.20E-07
-8.15E-08
0
.
.
0
0
.
.
0
.
.
0
.
t7
0
1.92E-07
-2.08E-07
-2.50E-07
2.59E-07
-3.98E-07
65382
0
1.39E-07
0
0
9.81E-08
0
.
.
0
0
.
.
0
.
.
0
.
t8
-1.34E-07
-3.53E-07
-1.34E-07
-9.31E-07
-6.47E-07
1.74E-07
0
94267
-3.08E-07
-1.16E-07
0
2.21E-07
0
.
.
0
0
.
.
74.6835
.
.
0
.
t9
-1.29E-07
1.42E-07
-3.16E-07
-5.56E-07
6.06E-07
0
1.39E-07
-3.08E-07
65556
0
2.76E-07
1.11E-07
0
.
.
0
0
.
.
0
.
.
0
.
t10
0
-1.59E-07
-2.10E-07
3.82E-07
1.91E-07
0
0
-1.16E-07
0
62535
0
1.01E-07
0
.
.
0
0
.
.
0
.
.
0
.
t11
4.10E-07
2.30E-07
-1.12E-07
0
3.69E-07
1.20E-07
0
0
2.76E-07
0
36036
0
0
.
.
0
0
.
.
0
.
.
31.9055
.
t12
2.64E-07
-1.31E-07
0
1.11E-06
2.12E-07
-8.15E-08
9.81E-08
2.21E-07
1.11E-07
1.01E-07
0
27782
0
.
.
0
0
.
.
0
.
.
0
.
v1
35.243
0
0
8.51E-08
0
0
0
0
0
0
0
0
0.01405
.
.
0
0
.
.
0
.
.
0
.
v2
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
v3
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
v4
0
0
0
65.6625
0
0
0
0
0
0
0
0
0
.
.
0.006083
0
.
.
0
.
.
0
.
v5
0
0
0
8.12E-08
19.1913
0
0
0
0
0
0
0
0
.
.
0
0.00401
.
.
0
.
.
0
.
v6
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
v7
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
v8
0
0
0
0
0
0
0
74.6835
0
0
0
0
0
.
.
0
0
.
.
0.05917
.
.
0
.
v9
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
v10
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
v11
0
0
0
2.09E-07
0
0
0
0
0
0
31.9055
0
0
.
.
0
0
.
.
0
.
.
0.02825
.
v12
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... View more
01-14-2025
04:46 AM
I'm sorry, i've forgotten to mention an additional note that appears in the log and that may be relevant:
NOTE: Moore-Penrose inverse is used in covariance matrix.
... View more
01-14-2025
04:17 AM
Hello Mr. Denham,
thank you for your answer. I've tried it again with just variants 1 and 2 with the same warning in the log as before.
data Total_Grain_DM_Sample;
input Block Variant Total_Grain_DM_kg_ha;
datalines;
2 1 4016.79
1 1 3904.58
3 1 3857.5
3 1 3962.11
4 2 3777.43
2 2 3857.63
1 2 4053.94
3 2 3902.49
4 3 4494.53
3 3 4607.35
1 3 4616.06
2 3 4660.09
2 4 4580.31
4 4 5225.37
1 4 4666.99
4 4 4782.53
1 5 5271.92
4 5 5302.86
4 5 5056.13
2 5 5033.14
2 6 5213.04
3 6 5477.23
4 6 5173.18
1 6 5482.44
3 7 5389.63
2 7 5482.13
1 7 5764.17
4 7 4824.41
1 8 5662.74
3 8 5906.35
3 8 5904.86
2 8 5693.09
2 9 5821.93
3 9 5989.53
1 9 6351.82
4 9 5813.85
4 10 6210.08
1 10 6257.52
3 10 6125.38
2 10 5959
1 11 6225.87
2 11 6236.02
3 11 6328.76
4 11 6395.25
3 12 6677.88
4 12 6447.28
1 12 6274.82
2 12 6341.02
;run;
;
/* Dummy-Variables for NLMixed */
data Total_Grain_DM_Sample;set Total_Grain_DM_Sample;
if Variant=1 then trt1=1;else trt1=0;
trt2=0;if Variant=2 then trt2=1;
run;
;
/* Berechnung und Vergleich der Variationskoeffizienten */
Proc nlmixed data=Total_Grain_DM_Sample;
parameters t1=3200 t2=4500.00 t3=3700.00 t4=5800 t5=4200.00 t6=4000.00 t7=3250.00 t8=4600.99 t9=4500.00 t10=3200.00 t11=3800.00 t12=4800.00 v1=26000.00 v2=27000.00 v3=262133.76 v4=2120000.00 v5=275000 v6=140500.00 v7=261000.00 v8=280000.00 v9=262500.00 v10=250000.00 v11=108000.00 v12=111000.00;
mu=trt1*t1+trt2*t2+u1*trt1+u2*trt2;
model Total_Grain_DM_kg_ha ~ normal (mu,0.0000001);
random u1 u2 ~ normal([0,0],
[v1,
0, v2]) SUBJECT = block OUT = ausgabe;
/* Calculation of CV-values */
predict ((v1)**(1/2)/(t1))*100 out=cv_t1;
predict ((v2)**(1/2)/(t2))*100 out=cv_t2;
/* Comparison of the CV-values */
/* Between the fertiliser levels */
predict ((v2)**(1/2)/(t2))*100-((v1)**(1/2)/(t1))*100 out=cv_t2_vs_cv_t1;
run;
;
... View more
01-13-2025
07:00 AM
Dear SAS-Community, i want to calculate coefficients of variance (CV) for grain dry matter data with 12 variants and 4 replicates. I want then to test differences of CV-Values between the treatments and the fertiliser levels. Here is a table containing the variants with the corresponding treatment and fertiliser level:
Variant
treatment
fertiliser level
1
1
0
2
1
1
3
2
0
4
2
1
5
3
0
6
3
1
7
4
0
8
4
1
9
5
0
10
6
0
11
7
0
12
7
1
13
8
0
14
8
1
When i run my code i get the following warning in the Log:
The final Hessian matrix is not positive definite, and therefore the estimated covariance matrix is not full rank and may be unreliable. The variance of some parameter estimates is zero or some parameters are linearly related to other parameters.
Could someone of you help me with finding a solution to this problem? Here comes my code with sample data (similar to my own data):
data Total_Grain_DM_Sample;
input Block Variant Total_Grain_DM_kg_ha;
datalines;
2 1 4016.79
1 1 3904.58
3 1 3857.5
3 1 3962.11
4 2 3777.43
2 2 3857.63
1 2 4053.94
3 2 3902.49
4 3 4494.53
3 3 4607.35
1 3 4616.06
2 3 4660.09
2 4 4580.31
4 4 5225.37
1 4 4666.99
4 4 4782.53
1 5 5271.92
4 5 5302.86
4 5 5056.13
2 5 5033.14
2 6 5213.04
3 6 5477.23
4 6 5173.18
1 6 5482.44
3 7 5389.63
2 7 5482.13
1 7 5764.17
4 7 4824.41
1 8 5662.74
3 8 5906.35
3 8 5904.86
2 8 5693.09
2 9 5821.93
3 9 5989.53
1 9 6351.82
4 9 5813.85
4 10 6210.08
1 10 6257.52
3 10 6125.38
2 10 5959
1 11 6225.87
2 11 6236.02
3 11 6328.76
4 11 6395.25
3 12 6677.88
4 12 6447.28
1 12 6274.82
2 12 6341.02
;run;
;
/* Dummy-Variables for NLMixed */
data Total_Grain_DM_Sample;set Total_Grain_DM_Sample;
if Variant=1 then trt1=1;else trt1=0;
trt2=0;if Variant=2 then trt2=1;
trt3=0;if Variant=3 then trt3=1;
trt4=0;if Variant=4 then trt4=1;
trt5=0;if Variant=5 then trt5=1;
trt6=0;if Variant=6 then trt6=1;
trt7=0;if Variant=7 then trt7=1;
trt8=0;if Variant=8 then trt8=1;
trt9=0;if Variant=9 then trt9=1;
trt10=0;if Variant=10 then trt10=1;
trt11=0;if Variant=11 then trt11=1;
trt12=0;if Variant=12 then trt12=1;
run;
;
/* Berechnung und Vergleich der Variationskoeffizienten */
Proc nlmixed data=Total_Grain_DM_Sample;
parameters t1=3200 t2=4500.00 t3=3700.00 t4=5800 t5=4200.00 t6=4000.00 t7=3250.00 t8=4600.99 t9=4500.00 t10=3200.00 t11=3800.00 t12=4800.00 v1=26000.00 v2=27000.00 v3=262133.76 v4=2120000.00 v5=275000 v6=140500.00 v7=261000.00 v8=280000.00 v9=262500.00 v10=250000.00 v11=108000.00 v12=111000.00;
mu=trt1*t1+trt2*t2+trt3*t3+trt4*t4+trt5*t5+trt6*t6+trt7*t7+trt8*t8+trt9*t9+trt10*t10+trt11*t11+trt12*t12+u1*trt1+u2*trt2+u3*trt3+u4*trt4+u5*trt5+u6*trt6+u7*trt7+u8*trt8+u9*trt9+u10*trt10+u11*trt11+u12*trt12;
model Total_Grain_DM_kg_ha ~ normal (mu,0.0000001);
random u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 ~ normal([0,0,0,0,0,0,0,0,0,0,0,0],
[v1,
0, v2,
0, 0, v3,
0, 0, 0, v4,
0, 0, 0, 0, v5,
0, 0, 0, 0, 0, v6,
0, 0, 0, 0, 0, 0, v7,
0, 0, 0, 0, 0, 0, 0, v8,
0, 0, 0, 0, 0, 0, 0, 0, v9,
0, 0, 0, 0, 0, 0, 0, 0, 0, v10,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, v11,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, v12]) SUBJECT = block OUT = ausgabe;
/* Calculation of CV-values */
predict ((v1)**(1/2)/(t1))*100 out=cv_t1;
predict ((v2)**(1/2)/(t2))*100 out=cv_t2;
predict ((v3)**(1/2)/(t3))*100 out=cv_t3;
predict ((v4)**(1/2)/(t4))*100 out=cv_t4;
predict ((v5)**(1/2)/(t5))*100 out=cv_t5;
predict ((v6)**(1/2)/(t6))*100 out=cv_t6;
predict ((v7)**(1/2)/(t7))*100 out=cv_t7;
predict ((v8)**(1/2)/(t8))*100 out=cv_t8;
predict ((v9)**(1/2)/(t9))*100 out=cv_t9;
predict ((v10)**(1/2)/(t10))*100 out=cv_t10;
predict ((v11)**(1/2)/(t11))*100 out=cv_t11;
predict ((v12)**(1/2)/(t12))*100 out=cv_t12;
/* Comparison of the CV-values */
/* Between the treatments */
/* with fertiliser level 0 */
predict ((v1)**(1/2)/(t1))*100-((v3)**(1/2)/(t3))*100 out=cv_t1_vs_cv_t3;
predict ((v5)**(1/2)/(t5))*100-((v1)**(1/2)/(t1))*100 out=cv_t5_vs_cv_t1;
predict ((v5)**(1/2)/(t5))*100-((v3)**(1/2)/(t3))*100 out=cv_t5_vs_cv_t3;
predict ((v5)**(1/2)/(t5))*100-((v7)**(1/2)/(t7))*100 out=cv_t5_vs_cv_t7;
predict ((v5)**(1/2)/(t5))*100-((v9)**(1/2)/(t9))*100 out=cv_t5_vs_cv_t9;
predict ((v5)**(1/2)/(t5))*100-((v10)**(1/2)/(t10))*100 out=cv_t5_vs_cv_t10;
predict ((v5)**(1/2)/(t5))*100-((v11)**(1/2)/(t11))*100 out=cv_t5_vs_cv_t11;
predict ((v7)**(1/2)/(t7))*100-((v1)**(1/2)/(t1))*100 out=cv_t7_vs_cv_t1;
predict ((v7)**(1/2)/(t7))*100-((v9)**(1/2)/(t9))*100 out=cv_t7_vs_cv_t9;
predict ((v7)**(1/2)/(t7))*100-((v10)**(1/2)/(t10))*100 out=cv_t7_vs_cv_t10;
predict ((v7)**(1/2)/(t7))*100-((v11)**(1/2)/(t11))*100 out=cv_t7_vs_cv_t11;
predict ((v9)**(1/2)/(t9))*100-((v1)**(1/2)/(t1))*100 out=cv_t9_vs_cv_t1;
predict ((v9)**(1/2)/(t9))*100-((v3)**(1/2)/(t3))*100 out=cv_t9_vs_cv_t3;
predict ((v9)**(1/2)/(t9))*100-((v10)**(1/2)/(t10))*100 out=cv_t9_vs_cv_t10;
predict ((v9)**(1/2)/(t9))*100-((v11)**(1/2)/(t11))*100 out=cv_t9_vs_cv_t11;
predict ((v10)**(1/2)/(t10))*100-((v1)**(1/2)/(t1))*100 out=cv_t10_vs_cv_t1;
predict ((v10)**(1/2)/(t10))*100-((v3)**(1/2)/(t3))*100 out=cv_t10_vs_cv_t3;
predict ((v10)**(1/2)/(t10))*100-((v11)**(1/2)/(t11))*100 out=cv_t10_vs_cv_t11;
/* with fertiliser 1evel 1 */
predict ((v2)**(1/2)/(t2))*100-((v4)**(1/2)/(t4))*100 out=cv_t2_vs_cv_t4;
predict ((v6)**(1/2)/(t6))*100-((v2)**(1/2)/(t2))*100 out=cv_t6_vs_cv_t2;
predict ((v6)**(1/2)/(t6))*100-((v4)**(1/2)/(t4))*100 out=cv_t6_vs_cv_t4;
predict ((v6)**(1/2)/(t6))*100-((v8)**(1/2)/(t8))*100 out=cv_t6_vs_cv_t8;
predict ((v6)**(1/2)/(t6))*100-((v12)**(1/2)/(t12))*100 out=cv_t6_vs_cv_t12;
predict ((v8)**(1/2)/(t8))*100-((v2)**(1/2)/(t2))*100 out=cv_t8_vs_cv_t2;
predict ((v8)**(1/2)/(t8))*100-((v4)**(1/2)/(t4))*100 out=cv_t8_vs_cv_t4;
predict ((v8)**(1/2)/(t8))*100-((v12)**(1/2)/(t12))*100 out=cv_t8_vs_cv_t12;
predict ((v12)**(1/2)/(t12))*100-((v2)**(1/2)/(t2))*100 out=cv_t12_vs_cv_t2;
predict ((v12)**(1/2)/(t12))*100-((v4)**(1/2)/(t4))*100 out=cv_t12_vs_cv_t4;
/* Between the fertiliser levels */
predict ((v2)**(1/2)/(t2))*100-((v1)**(1/2)/(t1))*100 out=cv_t2_vs_cv_t1;
predict ((v4)**(1/2)/(t4))*100-((v3)**(1/2)/(t3))*100 out=cv_t4_vs_cv_t3;
predict ((v6)**(1/2)/(t6))*100-((v5)**(1/2)/(t5))*100 out=cv_t6_vs_cv_t5;
predict ((v8)**(1/2)/(t8))*100-((v7)**(1/2)/(t7))*100 out=cv_t8_vs_cv_t7;
predict ((v12)**(1/2)/(t12))*100-((v11)**(1/2)/(t11))*100 out=cv_t12_vs_cv_t11;
run;
;
... View more
12-30-2024
07:47 AM
It works. Thank you really much! I'm sorry, i haven't thought of sample data.
... View more
12-30-2024
05:03 AM
Dear SAS community,
i want to unbold the title of a SGPANEL graphic but i haven't found a working solution for it. here is my code:
data Gesamt_Pflanzen_TM_NStufe_MT1;
...
/* Presettings */
ods html5 style=analysis path="D:\Masterthesis\Statistik\2024\Grafiken"
file="Gesamt-Pflanzen-TM_25-4-24_NStufe.html";
ods graphics / reset;
ods graphics / width=3.5in height=3.0in;
ods escapechar='^';
* ods text="^S={font_face='Arial' font_weight=normal font_size=11pt color=black}Mischungsverhältnis Erbse : Gerste (%)"; /* hasn't worked */
title height=11pt "Mischungsverhältnis Erbse : Gerste (%)";
/* Data preparation */
data Gesamt_Pflanzen_TM_NStufe_MT1;
set Gesamt_Pflanzen_TM_NStufe_MT1;
Low = Mittelwert - Standardfehler; /* Untere Grenze Fehlerbalken*/
High = Mittelwert + Standardfehler; /* Obere Grenze Fehlerbalken */
LabelPos = High + 10.0; /* Position der Buchstaben */
run;
proc format;
value NStufeFmt
0 = "0 kg N ha(*ESC*){unicode '207B'x}^{unicode '00B9'x}"
1 = "96 kg N ha(*ESC*){unicode '207B'x}^{unicode '00B9'x}";
run;
proc format;
value BehandlungFmt
1 = "0:100"
2 = "100:0"
3 = "90:10"
4 = "70:30"
5 = "80:40"
6 = "80:30"
7 = "50:50"
8 = "Brache";
run;
/* Creating bar chart*/
proc sgpanel data=Gesamt_Pflanzen_TM_NStufe_MT1 noautolegend/* Legende wird nicht automatisch erstellt */;
format Behandlung Behandlungfmt.;
panelby Behandlung / noheaderborder headerattrs=(size=11pt weight=normal)
columns=5 rows=1 novarname;
format Duengerstufe NStufefmt.;
vbarparm category=Duengerstufe response=Mittelwert /
group=Duengerstufe
groupdisplay=cluster;
highlow x=Duengerstufe low=Low high=High / group=Duengerstufe
lineattrs=(color=black thickness=1 pattern=solid) /* Schwarze, durchgezogene Linie */
highcap=serif lowcap=serif; /* vertikale Striche an den Enden */
scatter x=Duengerstufe y=LabelPos /
datalabel=Buchstabe /* Buchstaben für Fehlerbalken */
datalabelattrs=(size=10pt weight=bold color=black)
datalabelpos=center /* Zentrierung der Buchstaben auf Fehlerbalken */
markerattrs=(size=0); /* Unsichtbarer Marker */
rowaxis label="Pflanzen-TM (kg ha^{unicode '207B'x}^{unicode '00B9'x})" labelattrs=(size=11pt);
colaxis label="Düngerstufe" labelattrs=(size=11pt weight=normal) valueattrs=(size=10pt)/* Schriftgröße der Achsenwerte */;
run;
ods html5 close; Can someone of you help me with this problem?
... View more
12-01-2024
03:43 AM
Thank you for your explanation and the sample code. These were helpful 👍
... View more
11-29-2024
09:52 AM
Dear SAS community,
i've created a bar chart with SGPANEL with five panels. My panel headings consist of two variables (Pflanzenart and Mischung). I've put these two variables in one variable (Behandlung) for the panel headings and the categories for the panels. I want now that one part of the heading (Pflanzenart) is in one line and the other part (Mischung) is in a new line below: I've tried it with:
Behandlung = catx('0A'x, put(Pflanzenart, PflanzenartFmt.), put(Mischung, MischungFmt.));
but both, Pflanzenart and Mischung are standing together in one line followed by an empty line.
Here is the complete code:
/* Voreinstellungen */
ods html5 style=analysis path="D:\Masterthesis\Statistik\2024\Grafiken"
file="Pflanzen-TM_25-4-24_NStufe.html";
ods graphics /reset;
ods graphics / width=5in height=2.5in;
ods escapechar='^';
title height = 1.5 "Median der Pflanzen-Trockenmasse der Düngerstufen";
footnote "Düngerstufen innerhalb einer Behandlung mit gleichem Buchstabe sind nicht signifikant voneinander verschieden.";
/* Format für Duengerstufe*/
proc format;
value NStufeFmt
0 = "0 kg N ha(*ESC*){unicode '207B'x}^{unicode '00B9'x}"
1 = "96 kg N ha(*ESC*){unicode '207B'x}^{unicode '00B9'x}";
run;
/* Format für Pflanzenart */
proc format;
value PflanzenartFmt
1 = "Erbse"
2 = "Gerste";
run;
/* Format für Mischung */
proc format;
value MischungFmt
0 = "RS"
1 = "90:10"
2 = "70:30"
3 = "80:40"
4 = "80:30"
5 = "50:50";
run;
/* Datenvorbereitung */
data Pflanzen_TM_NStufe_MT1;
set Pflanzen_TM_NStufe_MT1;
Low = Median - Standardfehler; /* Untere Grenze Fehlerbalken*/
High = Median + Standardfehler; /* Obere Grenze Fehlerbalken */
LabelPos = High + 10.0; /* Position der Buchstaben */
Behandlung = catx('0A'x, put(Pflanzenart, PflanzenartFmt.), put(Mischung, MischungFmt.));
run;
/* Erstellen des Balkendiagramms mit 2 Panels */
proc sgpanel data=Pflanzen_TM_NStufe_MT1;
panelby Behandlung / noheaderborder headerattrs=(size=6pt weight=bold) novarname
columns=8 rows=1;
format Duengerstufe NStufefmt.;
vbarparm category=Duengerstufe response=Median /
group=Duengerstufe
groupdisplay=cluster;
highlow x=Duengerstufe low=Low high=High / group=Behandlung
lineattrs=(color=black thickness=1 pattern=solid) /* Schwarze, durchgezogene Linie */
highcap=serif lowcap=serif; /* vertikale Striche an den Enden */
scatter x=Duengerstufe y=LabelPos /
datalabel=Buchstabe /* Buchstaben für Fehlerbalken */
datalabelattrs=(size=10pt weight=bold color=black)
datalabelpos=center /* Zentrierung der Buchstaben auf Fehlerbalken */
markerattrs=(size=0); /* Unsichtbarer Marker */
rowaxis label="Pflanzen-TM (kg ha^{unicode '207B'x}^{unicode '00B9'x})" labelattrs=(size=11pt);
colaxis display=none;
run;
ods html5 close;
Could you help me to get the contents of the variable Pflanzenart in the first line of the panel heading and the contents of the variable Mischung in the second line of the panel headings?
... View more
11-22-2024
04:14 AM
Thank you really much for your help 🙂.
... View more
- Tags:
- Thanks
11-22-2024
04:13 AM
Thank you really much for your help 🙂.
... View more