
147 Cal.App.3d 1186 (1983)
195 Cal. Rptr. 724
THE PEOPLE, Plaintiff and Respondent,
v.
ANDREW MICHAEL DURAN, Defendant and Appellant.
Docket No. 15149.
Court of Appeals of California, Fourth District, Division One.
October 14, 1983.
*1188 COUNSEL
Quin Denvir, State Public Defender, under appointment by the Court of Appeal, and Jeffrey J. Stuetz, Deputy State Public Defender, for Defendant and Appellant.
John K. Van de Kamp, Attorney General, John W. Carney and Yvonne H. Behart, Deputy Attorneys General, for Plaintiff and Respondent.
[Opinion certified for partial publication.[1]]
OPINION
WIENER, J.
Sixteen-year-old Andrew Michael Duran participated in two gang-related killings, was certified as an adult (Welf. & Inst. Code, § 707) and entered a negotiated guilty plea to one count of second degree murder. (Pen. Code, §§ 187, 189.) Before sentencing Duran to prison the court remanded him to the California Youth Authority (YA) for a diagnostic study. (Welf. & Inst. Code, § 707.2.) The court originally determined Duran was entitled to 18 days conduct credit (Pen. Code, § 4019) for the 35 days of diagnostic time he spent at YA; however, after receiving a letter from the Department of Corrections asserting Duran was not entitled to that credit under In re Ricky H. (1981) 30 Cal.3d 176 [178 Cal. Rptr. 324, 636 P.2d 13], the court modified the judgment by subtracting 18 days from the amount of credit Duran received.
*1189 Duran appeals, contending the court's finding he was not amenable to YA treatment is not supported by substantial evidence. He also argues the court unconstitutionally denied him conduct credits for the diagnostic time he spent at YA. We conclude the court's amenability finding is supported by substantial evidence and decide a juvenile who is not committed to YA but simply remanded there for an amenability evaluation (Welf. & Inst. Code, § 707.2) and then sentenced to prison is entitled on equal protection grounds to conduct credits against his prison sentence for the diagnostic time spent at YA. We thus modify the judgment by crediting Duran with an additional 18 days against his sentence and, as modified, affirm the judgment.

I[*]
.... .... .... .... .... .... .

II
(1a) Duran's contention he is entitled to conduct credits for the diagnostic time he spent at YA (Welf. & Inst. Code, § 707.2) is grounded on equal protection principles. He argues an adult convicted in the criminal courts and sentenced to prison is entitled to conduct credits for time spent in a diagnostic facility of the Department of Corrections (Pen. Code, § 1203.03, subd. (g)), and maintains there is no rational basis for, much less a compelling state interest in, withholding similar credits for diagnostic time spent at YA from a juvenile who is likewise prosecuted and convicted as an adult in the criminal courts and then sentenced to prison.
"Penal Code section 1203.03 provides that the trial court may order a defendant placed in a diagnostic facility for up to 90 days. (2) Such placement is warranted where the court concludes a diagnostic study is essential to a just disposition of the case. [Citation.]" (People v. Peace (1980) 107 Cal. App.3d 996, 1001 [166 Cal. Rptr. 202].) The "[t]ime spent by a defendant in confinement in a diagnostic facility of the Department of Corrections [DOC] pursuant to this section or as an inpatient of the California Rehabilitation Center [CRC] shall be credited on the term of imprisonment in state prison, if any, to which defendant is sentenced in the case." (Pen. Code, § 1203.03, subd. (g).) (3) The "time spent" by defendants confined as CRC inpatients before being sentenced to prison includes time attributable to conduct credits. (People v. Hankins (1982) 137 Cal. App.3d 694, 697-700 [187 Cal. Rptr. 210]; see also People v. Rutledge (1983) 139 Cal. App.3d 620, 625 [188 Cal. Rptr. 846].) Absent anything in the statute *1190 or the legislative history to the contrary, we agree with Duran's major premise that the "time spent" by defendants confined in DOC diagnostic facilities before sentencing also includes conduct credits. (See People v. Dillon (1983) 34 Cal.3d 441, 468 [194 Cal. Rptr. 390, 668 P.2d 697].)
Adults convicted in the criminal courts and sentenced to prison and juveniles prosecuted and convicted as adults in the criminal courts and then sentenced to prison are similarly situated for purposes of equal protection challenges to sentencing schemes. (People v. Olivas (1976) 17 Cal.3d 236, 242-243 [131 Cal. Rptr. 55, 551 P.2d 375]; compare id., at p. 243, fn. 11; In re Eric J. (1979) 25 Cal.3d 522, 529-530, 533 [159 Cal. Rptr. 317, 601 P.2d 549].) Given this identity, we agree with Duran's minor premise that such adults and juveniles remain similarly situated when temporarily confined for diagnostic purposes before sentencing. Although two different statutes and locations are involved, both defendant groups are confined for purposes of determining their need for, and amenability to, treatment services in a nonprison setting. (See Pen. Code, § 1203.03, subds. (a) and (h); Welf. & Inst. Code, § 707.2.) Were it not mandatory under Welfare and Institutions Code section 707.2 for sentencing courts to remand juveniles to YA (see People v. Black (1982) 32 Cal.3d 1, 4 [184 Cal. Rptr. 454, 648 P.2d 104]), the courts likely would place juveniles in need of diagnosis in a DOC facility under Penal Code section 1203.03. The fact one defendant group undergoes diagnosis at YA while another does so at DOC does not create a dissimilarity between them for equal protection purposes.
Based on these two premises Duran argues equal protection principles require juveniles who are treated as adults be given conduct credits for diagnostic time spent at YA before being sentenced to prison. Denial of such credits would constitute dissimilar treatment affecting the juveniles' fundamental interests in personal liberty. (See People v. Olivas, supra, 17 Cal.3d at pp. 244-251.) To defend such treatment from constitutional attack the Attorney General must show it is necessary to further a compelling state interest. (Id., at pp. 243-244, 251.)
(4) The Attorney General correctly points out the state has a compelling interest in the rehabilitation of minors (In re Ricky H., supra, 30 Cal.3d at p. 190) and youthful offenders. (People v. Austin (1981) 30 Cal.3d 155, 166 [178 Cal. Rptr. 312, 636 P.2d 1].) Such rehabilitation and related treatment are the reasons for YA commitment. (Welf. & Inst. Code, § 1700; In re Eric J., supra, 25 Cal.3d at pp. 531-532.) Because of the flexible and indeterminate nature of YA commitments, and because the granting of conduct credits is meaningful only within the context of a fixed term, it is consistent with equal protection principles to withhold conduct credits for presentence custody from juveniles who are committed to YA. (In re Ricky *1191 H., supra, 30 Cal.3d at pp. 189-190; People v. Austin, supra, 30 Cal.3d at pp. 164-166.) Duran, however, was not committed to YA. He was simply remanded there for an amenability evaluation, after which the court found Duran was not a suitable subject for YA treatment and sentenced him to prison. The purpose of imprisonment is punishment for a fixed term. (Pen. Code, § 1170, subd. (a)(1); In re Eric J., supra, 25 Cal.3d at p. 531.) Thus, in the context of this case, rehabilitation cannot serve as a rationale for disparate treatment.
The Attorney General also relies on People v. Reynolds (1981) 116 Cal. App.3d 141 [171 Cal. Rptr. 461], in which a juvenile originally committed to YA but later returned to court (Welf. & Inst. Code, § 1737.1) and sentenced to prison was denied conduct credits against his prison sentence for the time he spent at YA. (Id., at pp. 144-147.) This case, however, again is different because, unlike Reynolds, Duran was not committed to YA before he was sentenced to prison. The Reynolds court concluded "... that to superimpose the Penal Code's behavior credit scheme on the Youth Authority is to provide the youthful felon with what he already has: the opportunity to reduce his time in confinement because of his conduct." (Id., at p. 147.) A juvenile who is remanded to YA solely for an amenability evaluation does not have that opportunity. The remanded juvenile is much like the juvenile sentenced to prison after being confined in juvenile hall pending the court's determination whether he should be adjudged under the Juvenile Court Law. (Welf. & Inst. Code, § 707.) (5) Equal protection principles require juveniles so confined be given conduct credits against their prison sentences for time spent at juvenile hall. (People v. Twine (1982) 135 Cal. App.3d 59, 62-63 [185 Cal. Rptr. 85], relying on Pen. Code, § 4019 as interpreted in People v. Sage (1980) 26 Cal.3d 498, 507-508 [165 Cal. Rptr. 280, 611 P.2d 874].) Remanded juveniles found unamenable for YA treatment and then sentenced to prison should likewise receive conduct credits against their prison sentences for diagnostic time spent at YA.
Finally, the Attorney General urges us to follow People v. Lawrence (1983) 144 Cal. App.3d 290 [192 Cal. Rptr. 165] in support of the court's denial of conduct credits in this case. Lawrence was a juvenile ultimately sentenced to prison after spending two separate periods of time in local and YA custody. The first period began with 112 days in juvenile hall, followed by 55 days on diagnostic remand to YA (Welf. & Inst. Code, § 707.2), followed in turn by 70 days back in juvenile hall and county jail pending the service of what turned out to be a 2-year YA commitment. Then, after an eight-month interlude, Lawrence returned to custody, first serving 87 days in county jail, followed by over 9 months again committed to YA, followed in turn by 32 days back in county jail pending sentence and commitment to prison. (People v. Lawrence, supra, 144 Cal. App.3d at pp. 292-293.) *1192 The court denied Lawrence conduct credit against his prison sentence for the diagnostic time he spent at YA. The appellate court affirmed, equating a YA diagnostic remand with a YA commitment and thereby justifying the denial of conduct credits on a rehabilitation rationale. (Id., at pp. 293-294.)
We believe Lawrence is distinguishable both on its facts and in its legal analysis. Following the diagnostic remand in Lawrence, the trial court presumably found Lawrence amenable to YA treatment and then committed Lawrence to YA. It was not until after Lawrence spent two years at YA, followed by eight months free from custody, followed in turn by over thirteen months back in custody (including over nine months recommitted to YA), that the trial court finally sentenced Lawrence to prison. Lawrence's diagnostic remand was directly related to his original commitment to YA; it was not related at all to his ultimate prison sentence. Thus, in a transactional sense, the diagnostic time Lawrence spent at YA was akin to presentence custody preceding a YA commitment and unlike presentence custody pending sentence and commitment to prison. On these facts, the Lawrence court correctly denied conduct credits against Lawrence's eventual unrelated prison sentence based on his earlier diagnostic remand. In the case of a diagnostic remand followed by YA commitment, as in Lawrence, conduct credits for presentence custody while on remand are not constitutionally required. (See In re Ricky H., supra, 30 Cal.3d at pp. 189-190; People v. Austin, supra, 30 Cal.3d at pp. 164-166.) However, in the case of a diagnostic remand followed by sentence and commitment to prison, as occurred here, equal protection principles require conduct credits be given for presentence custody while on remand. (See People v. Twine, supra, 135 Cal. App.3d at pp. 62-63.)
As for its legal analysis, Lawrence is not authority for propositions not considered. (People v. Burnick (1975) 14 Cal.3d 306, 317 [121 Cal. Rptr. 488, 535 P.2d 352].) Lawrence did not consider the equal protection arguments Duran presents based on Penal Code section 1203.03. Thus Lawrence does not preclude us from reaching a different result based on different grounds.
(1b) To reiterate, juveniles and adults convicted in the criminal courts and sentenced to prison are similarly situated. The state's purpose of punishment is identical for both groups. Juveniles remanded to YA before sentencing (Welf. & Inst. Code, § 707.2) and adults likewise confined in DOC diagnostic facilities (Pen. Code, § 1203.03, subd. (a)) also are similarly situated. The state's purpose of evaluating both groups for amenability to alternative dispositions is the same. Because an adult confined in a DOC diagnostic facility before sentencing is entitled to conduct credits against his *1193 prison sentence for time spent at the facility, we conclude a juvenile remanded to YA for an amenability evaluation and then sentenced to prison also is entitled on equal protection grounds to conduct credits against his prison sentence for the diagnostic time spent at YA.

Disposition
The judgment is modified by adding 18 days to Duran's presentence credits. As modified, the judgment is affirmed.
Cologne, Acting P.J., and Staniforth, J., concurred.
Respondent's petition for a hearing by the Supreme Court was denied December 22, 1983.
NOTES
[1]  Certified for publication with the exception of section I.
[*]   See footnote 1, ante, page 1186.
